8000 fix compilation of SFC transitions written in IL (compiler was enteri… · sm1820/matiec@2937a1e · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
fix compilation of SFC transitions written in IL (compiler was enteri…
Browse files Browse the repository at this point in the history
…ng endless loop)
  • Loading branch information
AndreySV committed Jan 25, 2017
1 parent 38c1eed commit 2937a1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions stage1_2/iec_bison.yy
Original file line number Diff line number Diff line change
Expand Up @@ -5846,14 +5846,14 @@ transition_priority:


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;}
Expand Down
3 changes: 2 additions & 1 deletion stage1_2/iec_flex.ll
Original file line number Diff line number Diff line change
Expand Up @@ -1193,10 +1193,11 @@ INITIAL_STEP { if (isempty_bodystate_buffer()) {unput_text(0); BEGIN(sfc_state
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)
Expand Down

0 comments on commit 2937a1e

Please sign in to comment.
0