Merging with Edouard's changes
authorMario de Sousa <msousa@fe.up.pt>
Tue, 17 May 2011 10:35:12 +0100
changeset 299 de1be61482fa
parent 298 022a874149ce (diff)
parent 294 aae14da3c296 (current diff)
child 300 092a6fa4926f
child 302 d120740a6b58
Merging with Edouard's changes
--- a/stage1_2/iec.y	Mon May 16 14:19:20 2011 +0200
+++ b/stage1_2/iec.y	Tue May 17 10:35:12 2011 +0100
@@ -5186,7 +5186,7 @@
 step_name: any_identifier;
 
 action_association:
-  action_name '(' {cmd_goto_sfc_qualifier_state()} action_qualifier {cmd_pop_state()} indicator_name_list ')'
+  action_name '(' {cmd_goto_sfc_qualifier_state();} action_qualifier {cmd_pop_state();} indicator_name_list ')'
 	{$$ = new action_association_c($1, $4, $6, locloc(@$));}
 /* ERROR_CHECK_BEGIN */
 /*| action_name '(' error ')'
--- a/stage4/generate_c/generate_c_st.cc	Mon May 16 14:19:20 2011 +0200
+++ b/stage4/generate_c/generate_c_st.cc	Tue May 17 10:35:12 2011 +0100
@@ -205,22 +205,22 @@
 void *visit(symbolic_variable_c *symbol) {
   unsigned int vartype;
   if (wanted_variablegeneration == complextype_base_vg)
-	generate_c_base_c::visit(symbol);
+         generate_c_base_c::visit(symbol);
   else if (wanted_variablegeneration == complextype_suffix_vg)
-	return NULL;
+         return NULL;
   else if (this->is_variable_prefix_null()) {
-	vartype = search_varfb_instance_type->get_vartype(symbol);
-	if (wanted_variablegeneration == fparam_output_vg) {
-	  s4o.print("&(");
-      generate_c_base_c::visit(symbol);
-      s4o.print(")");
-    }
-    else {
-      generate_c_base_c::visit(symbol);
-    }
+         vartype = search_varfb_instance_type->get_vartype(symbol);
+         if (wanted_variablegeneration == fparam_output_vg) {
+           s4o.print("&(");
+           generate_c_base_c::visit(symbol);
+           s4o.print(")");
+         } 
+         else {
+           generate_c_base_c::visit(symbol);
+         }
   }
   else
-	print_getter(symbol);
+      print_getter(symbol);
   return NULL;
 }
 
@@ -301,7 +301,9 @@
       if (current_array_type == NULL) ERROR;
 
       s4o.print(".table");
+      wanted_variablegeneration = expression_vg;
       symbol->subscript_list->accept(*this);
+      wanted_variablegeneration = complextype_suffix_vg;
 
       current_array_type = NULL;
       break;
--- a/stage4/stage4.cc	Mon May 16 14:19:20 2011 +0200
+++ b/stage4/stage4.cc	Tue May 17 10:35:12 2011 +0100
@@ -93,6 +93,10 @@
   }
 }
 
+void stage4out_c::flush(void) {
+  out->flush();
+}
+
 void stage4out_c::enable_output(void) {
   allow_output = true;
 }
--- a/stage4/stage4.hh	Mon May 16 14:19:20 2011 +0200
+++ b/stage4/stage4.hh	Tue May 17 10:35:12 2011 +0100
@@ -48,7 +48,9 @@
     stage4out_c(std::string indent_level = "  ");
     stage4out_c(const char *dir, const char *radix, const char *extension, std::string indent_level = "  ");
     ~stage4out_c(void);
-
+    
+    void flush(void);
+    
     void enable_output(void);
     void disable_output(void);