absyntax/absyntax.def
changeset 813 0630cc31569f
parent 810 d9c48ad646f1
child 862 2b6b1202f8a8
equal deleted inserted replaced
804:7898ba56c7cf 813:0630cc31569f
   443 					elementary_string_type_name,
   443 					elementary_string_type_name,
   444 					string_type_declaration_size,
   444 					string_type_declaration_size,
   445 					string_type_declaration_init) /* may be == NULL! */
   445 					string_type_declaration_init) /* may be == NULL! */
   446 
   446 
   447 
   447 
       
   448 /* helper symbol for fb_name_decl_c */
       
   449 /* This symbol/leaf does not exist in the IEC standard syntax as an isolated symbol,
       
   450  * as, for some reason, the standard syntax defines FB variable declarations in a slightly 
       
   451  * different style as all other spec_init declarations. I.e., fr FBs variable declarations, 
       
   452  * the standard defines a single leaf/node (fb_name_decl) that references:
       
   453  *   a) the variable name list
       
   454  *   b) the FB datatype
       
   455  *   c) the FB intial value
       
   456  *
       
   457  * All other variable declarations break this out into two nodes:
       
   458  *   1) references b) and c) above (usually named ***_spec_init)
       
   459  *   2) references a), and node 1)
       
   460  *
       
   461  * In order to allow the datatype analyses to proceed without special cases, we will handle
       
   462  * FB variable declarations in the same style. For this reason, we have added the
       
   463  * following node to the Abstract Syntax Tree, even though it does not have a direct equivalent in 
       
   464  * the standard syntax.
       
   465  */
       
   466 /*  function_block_type_name ASSIGN structure_initialization */
       
   467 /* structure_initialization -> may be NULL ! */
       
   468 SYM_REF2(fb_spec_init_c, function_block_type_name, structure_initialization)
       
   469 
       
   470 
   448 /*********************/
   471 /*********************/
   449 /* B 1.4 - Variables */
   472 /* B 1.4 - Variables */
   450 /*********************/
   473 /*********************/
   451 SYM_REF1(symbolic_variable_c, var_name)
   474 SYM_REF1(symbolic_variable_c, var_name)
   452 
   475 
   513  *       whether this declaration was in the original source code (method -> implicit_definition_c) 
   536  *       whether this declaration was in the original source code (method -> implicit_definition_c) 
   514  *       or not (method -> explicit_definition_c).
   537  *       or not (method -> explicit_definition_c).
   515  */
   538  */
   516 SYM_REF0(implicit_definition_c)
   539 SYM_REF0(implicit_definition_c)
   517 SYM_REF0(explicit_definition_c)
   540 SYM_REF0(explicit_definition_c)
   518 SYM_REF4(en_param_declaration_c, name, type, value, method)
   541 /* type_decl is a simple_spec_init_c */
       
   542 SYM_REF3(en_param_declaration_c, name, type_decl, method)
   519 SYM_REF3(eno_param_declaration_c, name, type, method)
   543 SYM_REF3(eno_param_declaration_c, name, type, method)
   520 
   544 
   521 /* edge -> The F_EDGE or R_EDGE directive */
   545 /* edge -> The F_EDGE or R_EDGE directive */
   522 SYM_REF2(edge_declaration_c, edge, var1_list)
   546 SYM_REF2(edge_declaration_c, edge, var1_list)
   523 
   547 
   566 
   590 
   567 /*  var1_list ':' initialized_structure */
   591 /*  var1_list ':' initialized_structure */
   568 SYM_REF2(structured_var_init_decl_c, var1_list, initialized_structure)
   592 SYM_REF2(structured_var_init_decl_c, var1_list, initialized_structure)
   569 
   593 
   570 /* fb_name_list ':' function_block_type_name ASSIGN structure_initialization */
   594 /* fb_name_list ':' function_block_type_name ASSIGN structure_initialization */
       
   595 /* NOTE: in order to allow datatype handling to proceed using the normal algorithm with no special cases,
       
   596  * we will be storing the 
       
   597  *    function_block_type_name ASSIGN structure_initialization
       
   598  * componentes inside a new node, namely fb_spec_init_c
       
   599  */
   571 /* structure_initialization -> may be NULL ! */
   600 /* structure_initialization -> may be NULL ! */
   572 SYM_REF3(fb_name_decl_c, fb_name_list, function_block_type_name, structure_initialization)
   601 SYM_REF2(fb_name_decl_c, fb_name_list, fb_spec_init)
   573 
   602 
   574 /* fb_name_list ',' fb_name */
   603 /* fb_name_list ',' fb_name */
   575 SYM_LIST(fb_name_list_c)
   604 SYM_LIST(fb_name_list_c)
   576 
   605 
   577 /* VAR_OUTPUT [RETAIN | NON_RETAIN] var_init_decl_list END_VAR */
   606 /* VAR_OUTPUT [RETAIN | NON_RETAIN] var_init_decl_list END_VAR */