stage1_2/iec.y
changeset 151 3b898fb11e73
parent 147 f34f9084a20e
child 175 dadda1b5401e
equal deleted inserted replaced
150:398cfd6e8e4a 151:3b898fb11e73
   293   octal_digit
   293   octal_digit
   294   hex_digit
   294   hex_digit
   295 */
   295 */
   296 %token <ID>	identifier_token
   296 %token <ID>	identifier_token
   297 %type  <leaf>	identifier
   297 %type  <leaf>	identifier
   298 %token INVALID_IDENTIFIER
       
   299 
   298 
   300 /*********************/
   299 /*********************/
   301 /* B 1.2 - Constants */
   300 /* B 1.2 - Constants */
   302 /*********************/
   301 /*********************/
   303 %type <leaf>	constant
   302 %type <leaf>	constant
   837 %type  <leaf>	steps
   836 %type  <leaf>	steps
   838 %type  <list>	step_name_list
   837 %type  <list>	step_name_list
   839 %type  <leaf>	transition_priority
   838 %type  <leaf>	transition_priority
   840 %type  <leaf>	transition_condition
   839 %type  <leaf>	transition_condition
   841 %type  <leaf>	action
   840 %type  <leaf>	action
       
   841 %type  <leaf>	action_body
   842 %type  <leaf>	transition_name
   842 %type  <leaf>	transition_name
   843 
   843 
   844 
   844 
   845 // %token ASSIGN
   845 // %token ASSIGN
   846 %token ACTION
   846 %token ACTION
  5065 
  5065 
  5066 
  5066 
  5067 
  5067 
  5068 action:
  5068 action:
  5069 //  ACTION identifier ':' ... 
  5069 //  ACTION identifier ':' ... 
  5070   ACTION action_name ':' {cmd_goto_body_state();} function_block_body END_ACTION
  5070   ACTION action_name {cmd_goto_body_state();} action_body END_ACTION
  5071 	{$$ = new action_c($2, $5, locloc(@$));}
  5071 	{$$ = new action_c($2, $4, locloc(@$));}
  5072 /* ERROR_CHECK_BEGIN */
  5072 /* ERROR_CHECK_BEGIN */
  5073 | ACTION ':' {cmd_goto_body_state();} function_block_body END_ACTION
  5073 | ACTION {cmd_goto_body_state();} action_body END_ACTION
  5074   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no action name defined in action declaration."); yynerrs++;}
  5074   {$$ = NULL; print_err_msg(locl(@1), locf(@3), "no action name defined in action declaration."); yynerrs++;}
  5075 | ACTION error ':' {cmd_goto_body_state();} function_block_body END_ACTION
  5075 | ACTION error {cmd_goto_body_state();} action_body END_ACTION
  5076 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid action name defined in action declaration."); yyerrok;}
  5076 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid action name defined in action declaration."); yyerrok;}
  5077 | ACTION action_name {cmd_goto_body_state();} function_block_body END_ACTION
  5077 | ACTION action_name {cmd_goto_body_state();} function_block_body END_ACTION
  5078 	{$$ = NULL; print_err_msg(locl(@2), locf(@4), "':' missing after action name in action declaration."); yynerrs++;}
  5078 	{$$ = NULL; print_err_msg(locl(@2), locf(@4), "':' missing after action name in action declaration."); yynerrs++;}
  5079 | ACTION action_name ':' END_ACTION
  5079 /*| ACTION action_name {cmd_goto_body_state();} action_body END_OF_INPUT
  5080 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "no body defined in action declaration."); yynerrs++;}
  5080 	{$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed action declaration."); yyerrok;}*/
  5081 /*| ACTION action_name ':' {cmd_goto_body_state();} function_block_body END_OF_INPUT
       
  5082 	{$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed action declaration."); yyerrok;}*/
       
  5083 | ACTION error END_ACTION
  5081 | ACTION error END_ACTION
  5084 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in action declaration."); yyerrok;}
  5082 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in action declaration."); yyerrok;}
       
  5083 /* ERROR_CHECK_END */
       
  5084 ;
       
  5085 
       
  5086 action_body:
       
  5087   ':' function_block_body
       
  5088   {$$ = $2;}
       
  5089 /* ERROR_CHECK_BEGIN */
       
  5090 | ':' error
       
  5091 	{$$ = NULL;
       
  5092 	 if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no body defined in action declaration.");}
       
  5093 	 else {print_err_msg(locf(@2), locl(@2), "invalid body defined in action declaration."); yyclearin;}
       
  5094 	 yyerrok;
       
  5095 	}
  5085 /* ERROR_CHECK_END */
  5096 /* ERROR_CHECK_END */
  5086 ;
  5097 ;
  5087 
  5098 
  5088 
  5099 
  5089 /********************************/
  5100 /********************************/