Correct the number given to actions in the #define's
authormjsousa
Sat, 10 Jan 2015 23:17:08 +0000
changeset 991 7c01878bd525
parent 986 2064a22cc1f2
child 992 aa642302fa60
Correct the number given to actions in the #define's
stage4/generate_c/generate_c_sfcdecl.cc
--- a/stage4/generate_c/generate_c_sfcdecl.cc	Thu Jan 08 19:04:03 2015 +0000
+++ b/stage4/generate_c/generate_c_sfcdecl.cc	Sat Jan 10 23:17:08 2015 +0000
@@ -192,14 +192,16 @@
           break;
         case actiondef_sd:
           s4o.print("// Actions definitions\n");
-          for(int i = 0; i < symbol->n; i++)
-             symbol->elements[i]->accept(*this);
           {
             // first fill up the this->variable_list variable!
             wanted_sfcdeclaration = actioncount_sd;
             for(int i = 0; i < symbol->n; i++)
                symbol->elements[i]->accept(*this);
+            action_number = 0; // reset the counter!
             wanted_sfcdeclaration = actiondef_sd;
+            // Now do the defines for actions!
+            for(int i = 0; i < symbol->n; i++)
+              symbol->elements[i]->accept(*this);
             // Now do the defines for actions that reference a variable instead of an action block!
             std::list<VARIABLE>::iterator pt;
             for(pt = variable_list.begin(); pt != variable_list.end(); pt++) {