stage1_2/iec.y
changeset 75 0e381bdb8888
parent 74 85af9521bf63
child 77 fe4ecf7efa79
equal deleted inserted replaced
74:85af9521bf63 75:0e381bdb8888
   912 // %type  <leaf>	direction
   912 // %type  <leaf>	direction
   913 %type  <leaf>	task_configuration
   913 %type  <leaf>	task_configuration
   914 %type  <leaf>	task_name
   914 %type  <leaf>	task_name
   915 %type  <leaf>	task_initialization
   915 %type  <leaf>	task_initialization
   916 // 3 helper symbols for task_initialization
   916 // 3 helper symbols for task_initialization
   917 %type  <leaf>	task_initialization_single 	
   917 %type  <leaf>	task_initialization_single
   918 %type  <leaf>	task_initialization_interval	
   918 %type  <leaf>	task_initialization_interval
   919 %type  <leaf>	task_initialization_priority	
   919 %type  <leaf>	task_initialization_priority
   920 
   920 
   921 %type  <leaf>	data_source
   921 %type  <leaf>	data_source
   922 %type  <leaf>	program_configuration
   922 %type  <leaf>	program_configuration
   923 // helper symbol for program_configuration
   923 // helper symbol for program_configuration
   924 %type  <leaf>	optional_task_name
   924 %type  <leaf>	optional_task_name
  4135 task_configuration:
  4135 task_configuration:
  4136   TASK task_name task_initialization
  4136   TASK task_name task_initialization
  4137 	{$$ = new task_configuration_c($2, $3, locloc(@$));}
  4137 	{$$ = new task_configuration_c($2, $3, locloc(@$));}
  4138 ;
  4138 ;
  4139 
  4139 
  4140 /* NOTE: The specification does nopt mention the namespace to which task names
  4140 /* NOTE: The specification does not mention the namespace to which task names
  4141  *       should belong to. Unlike resource and program names, for the moment we
  4141  *       should belong to. Unlike resource and program names, for the moment we
  4142  *       let the task names belong to their own private namespace, as they do not
  4142  *       let the task names belong to their own private namespace, as they do not
  4143  *       produce any conflicts in the syntax parser.
  4143  *       produce any conflicts in the syntax parser.
  4144  *       If in the future our interpretation of the spec. turns out to be incorrect,
  4144  *       If in the future our interpretation of the spec. turns out to be incorrect,
  4145  *       the definition of task_name may have to be changed!
  4145  *       the definition of task_name may have to be changed!
  4147 task_name: any_identifier;
  4147 task_name: any_identifier;
  4148 
  4148 
  4149 
  4149 
  4150 task_initialization:
  4150 task_initialization:
  4151 //  '(' [SINGLE ASSIGN data_source ','] [INTERVAL ASSIGN data_source ','] PRIORITY ASSIGN integer ')' //
  4151 //  '(' [SINGLE ASSIGN data_source ','] [INTERVAL ASSIGN data_source ','] PRIORITY ASSIGN integer ')' //
  4152   '(' task_initialization_single task_initialization_interval task_initialization_priority ')'
  4152   '(' {cmd_goto_task_init_state();} task_initialization_single task_initialization_interval task_initialization_priority ')'
  4153 	{$$ = new task_initialization_c($2, $3, $4, locloc(@$));}
  4153 	{$$ = new task_initialization_c($3, $4, $5, locloc(@$));}
  4154 ;
  4154 ;
  4155 
  4155 
  4156 
  4156 
  4157 task_initialization_single:
  4157 task_initialization_single:
  4158 // [SINGLE ASSIGN data_source ',']
  4158 // [SINGLE ASSIGN data_source ',']
  4159   /* empty */
  4159   /* empty */
  4160 	{$$ = NULL;}
  4160 	{$$ = NULL;}
  4161 | {cmd_goto_task_init_state();} SINGLE ASSIGN {cmd_pop_state();} data_source ','
  4161 | SINGLE ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} 
  4162 	{$$ = $5;}
  4162 	{$$ = $4;}
  4163 ;
  4163 ;
  4164 
  4164 
  4165 
  4165 
  4166 task_initialization_interval:
  4166 task_initialization_interval:
  4167 // [INTERVAL ASSIGN data_source ','] 
  4167 // [INTERVAL ASSIGN data_source ','] 
  4168   /* empty */
  4168   /* empty */
  4169 	{$$ = NULL;}
  4169 	{$$ = NULL;}
  4170 | {cmd_goto_task_init_state();} INTERVAL ASSIGN {cmd_pop_state();} data_source ','
  4170 | INTERVAL ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
  4171 	{$$ = $5;}
  4171 	{$$ = $4;}
  4172 ;
  4172 ;
       
  4173 
  4173 
  4174 
  4174 
  4175 
  4175 task_initialization_priority:
  4176 task_initialization_priority:
  4176 // PRIORITY ASSIGN integer
  4177 // PRIORITY ASSIGN integer
  4177 {cmd_goto_task_init_state();} PRIORITY ASSIGN {cmd_pop_state();} integer
  4178   PRIORITY ASSIGN {cmd_pop_state();} integer 
  4178 	{$$ = $5;}
  4179 	{$$ = $4;}
  4179 ;
  4180 ;
  4180 
  4181 
  4181 
       
  4182 /*
       
  4183 task_initialization:
       
  4184 //  '(' [SINGLE ASSIGN data_source ','] [INTERVAL ASSIGN data_source ','] PRIORITY ASSIGN integer ')' //
       
  4185   '(' {cmd_goto_task_init_state();} PRIORITY ASSIGN {cmd_pop_state();} integer ')'
       
  4186 	{$$ = new task_initialization_c(NULL, NULL, $6, locloc(@$));}
       
  4187 | '(' {cmd_goto_task_init_state();} SINGLE ASSIGN {cmd_pop_state();} data_source ','
       
  4188                                     PRIORITY ASSIGN integer ')'
       
  4189 	{$$ = new task_initialization_c($6, NULL, $10, locloc(@$));}
       
  4190 | '(' {cmd_goto_task_init_state();} INTERVAL ASSIGN {cmd_pop_state();} data_source ',' PRIORITY ASSIGN integer ')'
       
  4191 	{$$ = new task_initialization_c(NULL, $6, $10, locloc(@$));}
       
  4192 | '(' {cmd_goto_task_init_state();} SINGLE ASSIGN {cmd_pop_state();} data_source ',' INTERVAL ASSIGN data_source ',' PRIORITY ASSIGN integer ')'
       
  4193 	{$$ = new task_initialization_c($6, $10, $14, locloc(@$));}
       
  4194 ;
       
  4195 */
       
  4196 
  4182 
  4197 
  4183 
  4198 data_source:
  4184 data_source:
  4199   constant
  4185   constant
  4200 | global_var_reference
  4186 | global_var_reference