# HG changeset patch # User Andrey Skvortsov # Date 1485368995 0 # Node ID ce026aee03e00c0790948a18bd7b35805457da81 # Parent 9aba95daf81a6e8197ef6b404a71213a26295b51 fix compilation of SFC transitions written in IL (compiler was entering endless loop) diff -r 9aba95daf81a -r ce026aee03e0 stage1_2/iec_bison.yy --- a/stage1_2/iec_bison.yy Wed Jan 25 18:25:35 2017 +0000 +++ b/stage1_2/iec_bison.yy Wed Jan 25 18:29:55 2017 +0000 @@ -5846,14 +5846,14 @@ transition_condition: - ':' eol_list simple_instr_list - {$$ = new transition_condition_c($3, NULL, locloc(@$));} + start_IL_body_token ':' eol_list simple_instr_list + {$$ = new transition_condition_c($4, NULL, locloc(@$));} | ASSIGN expression ';' {$$ = new transition_condition_c(NULL, $2, locloc(@$));} /* ERROR_CHECK_BEGIN */ -| eol_list simple_instr_list +| start_IL_body_token eol_list simple_instr_list {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing before IL condition in transition declaration."); yynerrs++;} -| ':' eol_list error +| start_IL_body_token ':' eol_list error {$$ = NULL; if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no instructions defined in IL condition of transition declaration.");} else {print_err_msg(locf(@3), locl(@3), "invalid instructions in IL condition of transition declaration."); yyclearin;} diff -r 9aba95daf81a -r ce026aee03e0 stage1_2/iec_flex.ll --- a/stage1_2/iec_flex.ll Wed Jan 25 18:25:35 2017 +0000 +++ b/stage1_2/iec_flex.ll Wed Jan 25 18:29:55 2017 +0000 @@ -1193,10 +1193,11 @@ else {append_bodystate_buffer(yytext);} } - /* check if ';' occurs before an END_FUNCTION, END_FUNCTION_BLOCK, END_PROGRAM or END_ACTION. (If true => we are parsing ST; If false => parsing IL). */ + /* check if ';' occurs before an END_FUNCTION, END_FUNCTION_BLOCK, END_PROGRAM, END_ACTION or END_TRANSITION. (If true => we are parsing ST; If false => parsing IL). */ END_ACTION | /* execute the next rule's action, i.e. fall-through! */ END_FUNCTION | END_FUNCTION_BLOCK | +END_TRANSITION | END_PROGRAM { append_bodystate_buffer(yytext); unput_bodystate_buffer(); BEGIN(il_state); /*printf("returning start_IL_body_token\n");*/ return start_IL_body_token;} .|\n { append_bodystate_buffer(yytext); if (strcmp(yytext, ";") == 0)