Fix main state machine in flex (states were being pushed without being poped from the stack)
authormjsousa
Sun, 23 Nov 2014 09:41:16 +0000
changeset 948 543f8319bdf8
parent 947 aca1ab9fcb6d
child 949 734c255d863c
Fix main state machine in flex (states were being pushed without being poped from the stack)
stage1_2/iec_flex.ll
--- a/stage1_2/iec_flex.ll	Sun Nov 16 15:37:12 2014 +0000
+++ b/stage1_2/iec_flex.ll	Sun Nov 23 09:41:16 2014 +0000
@@ -1052,9 +1052,9 @@
 	 *       continue in the <vardecl_state> state, untill the end of the FUNCTION, FUNCTION_BLOCK
 	 *       or PROGAM.
 	 */
-FUNCTION				yy_push_state(header_state); return FUNCTION;
-FUNCTION_BLOCK				yy_push_state(header_state); return FUNCTION_BLOCK;
-PROGRAM					yy_push_state(header_state); return PROGRAM;
+FUNCTION				BEGIN(header_state); return FUNCTION;
+FUNCTION_BLOCK				BEGIN(header_state); return FUNCTION_BLOCK;
+PROGRAM					BEGIN(header_state); return PROGRAM;
 CONFIGURATION				BEGIN(config_state); return CONFIGURATION;
 }
 
@@ -1108,7 +1108,7 @@
 
 	/* vardecl_list_state -> pop to $previous_state (vardecl_list_state) */
 <vardecl_state>{
-END_VAR				yy_pop_state(); return END_VAR; /* pop back to header_state */
+END_VAR				yy_pop_state(); return END_VAR; /* pop back to vardecl_list_state */
 }