# HG changeset patch # User lbessard # Date 1170318598 -3600 # Node ID 0d71456312ab5778507a6e42a5ac74072f2bed72 # Parent 38850ee685e605ec88058e0b5090313aa592de0c stack overflow problem corrected diff -r 38850ee685e6 -r 0d71456312ab stage1_2/iec.flex --- a/stage1_2/iec.flex Wed Jan 31 19:23:46 2007 +0100 +++ b/stage1_2/iec.flex Thu Feb 01 09:29:58 2007 +0100 @@ -764,12 +764,12 @@ /* decl_state -> il_st_state */ { END_VAR{st_whitespace}VAR unput_text(strlen("END_VAR")); return END_VAR; -END_VAR{st_whitespace} unput_text(strlen("END_VAR")); BEGIN(il_st_state); return END_VAR; +END_VAR{st_whitespace} unput_text(strlen("END_VAR")); yy_push_state(il_st_state); return END_VAR; } /* il_st_state -> (il_state | st_state | sfc_state) */ { -INITIAL_STEP unput_text(0); BEGIN(sfc_state); +INITIAL_STEP unput_text(0); yy_push_state(sfc_state); {qualified_identifier}{st_whitespace}":=" unput_text(0); BEGIN(st_state); {qualified_identifier}"[" unput_text(0); BEGIN(st_state); @@ -806,8 +806,15 @@ END_ACTION yy_pop_state(); unput_text(0); } - /* (decl_state | sfc_state) -> INITIAL */ -{ + /* sfc_state -> INITIAL */ +{ +END_FUNCTION yy_pop_state(); unput_text(0); +END_FUNCTION_BLOCK yy_pop_state(); unput_text(0); +END_PROGRAM yy_pop_state(); unput_text(0); +} + + /* decl_state -> INITIAL */ +{ END_FUNCTION BEGIN(INITIAL); return END_FUNCTION; END_FUNCTION_BLOCK BEGIN(INITIAL); return END_FUNCTION_BLOCK; END_PROGRAM BEGIN(INITIAL); return END_PROGRAM;