File tree Expand file tree Collapse file tree 2 files changed +20
-12
lines changed
Expand file tree Collapse file tree 2 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ extern "C"
1313{
1414#include < assert.h>
1515#include " rml.h"
16- #include " ../ absyn_builder/yacclib.h"
16+ #include " absyn_builder/yacclib.h"
1717
1818 string top_class;
1919
@@ -537,6 +537,7 @@ extern "C"
537537 }
538538 }
539539 if (index > 0 ) {
540+ output << ends;
540541 output_str << " SetNoSubModels(" << index << " );" << output.str ();
541542 }
542543 }
@@ -556,24 +557,27 @@ extern "C"
556557 string component_str_key = string (component_name);
557558 map<string, map<string,variable> >::iterator search;
558559 search = generated_classes.find (class_str_key);
559- int ret_val = 0 ;// for error checking
560+ int ret_val = - 1 ;// for error checking
560561
561562 if (search != generated_classes.end ()){
562563 map<string,variable>::const_iterator itr;
563564 if (search->second .size () > 0 ){
564- int index;
565+ int index = 0 ;
565566 for (itr = search->second .begin (), index = 0 ; itr != search->second .end (); ++itr)
566567 {
567- if (itr->second .type == string (" class" ) && itr->second .name == component_str_key){
568- ret_val = index++;
568+ if (itr->second .type == string (" class" )){
569+ if (itr->second .name == component_str_key){
570+ ret_val = index;
571+ }
572+ index += 1 ;
569573 }
570574 }
571575 }
572576 }
573577
574578 rmlA0 = (void *) mk_icon (ret_val);
575579
576- if (ret_val == 0 )
580+ if (ret_val == - 1 )
577581 RML_TAILCALLK (rmlFC);
578582 else
579583 RML_TAILCALLK (rmlSC);
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ extern "C"
1313{
1414#include < assert.h>
1515#include " rml.h"
16- #include " ../ absyn_builder/yacclib.h"
16+ #include " absyn_builder/yacclib.h"
1717
1818 string top_class;
1919
@@ -537,6 +537,7 @@ extern "C"
537537 }
538538 }
539539 if (index > 0 ) {
540+ output << ends;
540541 output_str << " SetNoSubModels(" << index << " );" << output.str ();
541542 }
542543 }
@@ -556,24 +557,27 @@ extern "C"
556557 string component_str_key = string (component_name);
557558 map<string, map<string,variable> >::iterator search;
558559 search = generated_classes.find (class_str_key);
559- int ret_val = 0 ;// for error checking
560+ int ret_val = - 1 ;// for error checking
560561
561562 if (search != generated_classes.end ()){
562563 map<string,variable>::const_iterator itr;
563564 if (search->second .size () > 0 ){
564- int index;
565+ int index = 0 ;
565566 for (itr = search->second .begin (), index = 0 ; itr != search->second .end (); ++itr)
566567 {
567- if (itr->second .type == string (" class" ) && itr->second .name == component_str_key){
568- ret_val = index++;
568+ if (itr->second .type == string (" class" )){
569+ if (itr->second .name == component_str_key){
570+ ret_val = index;
571+ }
572+ index += 1 ;
569573 }
570574 }
571575 }
572576 }
573577
574578 rmlA0 = (void *) mk_icon (ret_val);
575579
576- if (ret_val == 0 )
580+ if (ret_val == - 1 )
577581 RML_TAILCALLK (rmlFC);
578582 else
579583 RML_TAILCALLK (rmlSC);
You can’t perform that action at this time.
0 commit comments