# HG changeset patch # User mjsousa # Date 1416735676 0 # Node ID 543f8319bdf8017a3ed0f3dbad44bd6920e3b751 # Parent aca1ab9fcb6d69954af2de0bc57d3fbc7880ff14 Fix main state machine in flex (states were being pushed without being poped from the stack) diff -r aca1ab9fcb6d -r 543f8319bdf8 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 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) */ { -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 */ }