absyntax/absyntax.def
changeset 963 e3d4dca7520b
parent 958 7474d2cd1d6e
child 1014 a61f8f58f612
equal deleted inserted replaced
962:98e7a0d3af21 963:e3d4dca7520b
   524 /*********************/
   524 /*********************/
   525 /* B 1.4 - Variables */
   525 /* B 1.4 - Variables */
   526 /*********************/
   526 /*********************/
   527 SYM_REF1(symbolic_variable_c, var_name)
   527 SYM_REF1(symbolic_variable_c, var_name)
   528 
   528 
       
   529 /* symbolic_constant_c is used only when a variable is used inside the subrange of an array declaration
       
   530  *    e.g.: ARRAY [1 .. maxval] OF INT
       
   531  *  where maxval is a CONSTANT variable. 
       
   532  *  When maxval shows up in the POU body,          it will be stored as a standard symbolic_variable_c in the AST.
       
   533  *  When maxval shows up in the ARRAY declaration, it will be stored as a          symbolic_constant_c in the AST.
       
   534  *  This will allow us to more easily handle this special case, without affecting the remaining working code.
       
   535  */ 
       
   536 SYM_REF1(symbolic_constant_c, var_name)  // a non-standard extension!!
       
   537 
   529 /********************************************/
   538 /********************************************/
   530 /* B.1.4.1   Directly Represented Variables */
   539 /* B.1.4.1   Directly Represented Variables */
   531 /********************************************/
   540 /********************************************/
   532 SYM_TOKEN(direct_variable_c)
   541 SYM_TOKEN(direct_variable_c)
   533 
   542 
   558 /******************************************/
   567 /******************************************/
   559 SYM_REF0(constant_option_c)
   568 SYM_REF0(constant_option_c)
   560 SYM_REF0(retain_option_c)
   569 SYM_REF0(retain_option_c)
   561 SYM_REF0(non_retain_option_c)
   570 SYM_REF0(non_retain_option_c)
   562 
   571 
       
   572 /* VAR_INPUT [option] input_declaration_list END_VAR */
   563 /* option -> the RETAIN/NON_RETAIN/<NULL> directive... */
   573 /* option -> the RETAIN/NON_RETAIN/<NULL> directive... */
   564 /* NOTE: We need to implicitly define the EN and ENO function and FB parameters when the user
   574 /* NOTE: We need to implicitly define the EN and ENO function and FB parameters when the user
   565  *       does not do it explicitly in the IEC 61131-3 source code. 
   575  *       does not do it explicitly in the IEC 61131-3 source code. 
   566  *       To be able to distinguish later on between implictly and explicitly defined
   576  *       To be able to distinguish later on between implictly and explicitly defined
   567  *       variables, we use the 'method' flag that allows us to remember
   577  *       variables, we use the 'method' flag that allows us to remember