stage1_2/iec.y
changeset 5 8860f9917bbc
parent 3 38850ee685e6
child 10 66f4f7f85d0a
equal deleted inserted replaced
4:0d71456312ab 5:8860f9917bbc
  3639 
  3639 
  3640 
  3640 
  3641 /********************************************/
  3641 /********************************************/
  3642 /* B 1.6 Sequential Function Chart elements *
  3642 /* B 1.6 Sequential Function Chart elements *
  3643 /********************************************/
  3643 /********************************************/
  3644 /* TODO ... */
       
  3645 
  3644 
  3646 sequential_function_chart:
  3645 sequential_function_chart:
  3647   sfc_network
  3646   sfc_network
  3648 	{$$ = new sequential_function_chart_c(); $$->add_element($1);}
  3647 	{$$ = new sequential_function_chart_c(); $$->add_element($1);}
  3649 | sequential_function_chart sfc_network
  3648 | sequential_function_chart sfc_network
  3707 	{$$ = new action_qualifier_c($1, NULL);}
  3706 	{$$ = new action_qualifier_c($1, NULL);}
  3708 | timed_qualifier ',' action_time
  3707 | timed_qualifier ',' action_time
  3709 	{$$ = new action_qualifier_c($1, $3);}
  3708 	{$$ = new action_qualifier_c($1, $3);}
  3710 ;
  3709 ;
  3711 
  3710 
  3712 //N_token: N 	{$$ = new N_token_c();};
       
  3713 
       
  3714 qualifier:
  3711 qualifier:
  3715 N		{$$ = new qualifier_c(strdup("N"));}
  3712 N		{$$ = new qualifier_c(strdup("N"));}
  3716 /* NOTE: the following two clash with the R and S IL operators.
  3713 /* NOTE: the following two clash with the R and S IL operators.
  3717  * It will have to be handled when we include parsing of SFC...
  3714  * It will have to be handled when we include parsing of SFC...
  3718  */
  3715  */
  3732 ;
  3729 ;
  3733 
  3730 
  3734 action_time:
  3731 action_time:
  3735   duration
  3732   duration
  3736 | variable_name
  3733 | variable_name
  3737 | transition_name
  3734 //| transition_name
  3738 ;
  3735 ;
  3739 
  3736 
  3740 indicator_name: variable_name;
  3737 indicator_name: variable_name;
  3741 
  3738 
  3742 transition_name: identifier;
  3739 transition_name: identifier;
  3774   ASSIGN expression ';'
  3771   ASSIGN expression ';'
  3775 	{$$ = new transition_condition_c(NULL, $2);};
  3772 	{$$ = new transition_condition_c(NULL, $2);};
  3776 
  3773 
  3777 transition:
  3774 transition:
  3778   transition_header transition_condition_il END_TRANSITION
  3775   transition_header transition_condition_il END_TRANSITION
  3779         {$$ = new transition_c($1.first, $1.second, $1.third, $1.fourth, $2, 
  3776         {$$ = new transition_c($1.first, $1.second, $1.third, $1.fourth, $2, NULL);}
  3780 NULL);}
       
  3781 |  transition_header transition_condition_st END_TRANSITION
  3777 |  transition_header transition_condition_st END_TRANSITION
  3782         {$$ = new transition_c($1.first, $1.second, $1.third, $1.fourth, NULL, 
  3778         {$$ = new transition_c($1.first, $1.second, $1.third, $1.fourth, NULL, $2);}
  3783 $2);}
       
  3784 ;
  3779 ;
  3785 
  3780 
  3786 action_header:
  3781 action_header:
  3787   ACTION action_name ':' 
  3782   ACTION action_name ':' 
  3788 	{$$.first = $2; cmd_goto_body_state();}
  3783 	{$$.first = $2; cmd_goto_body_state();}