absyntax_utils/absyntax_utils.hh
changeset 716 eb9aad0c3627
parent 698 ec8df1de3e08
child 719 19595fce59f0
equal deleted inserted replaced
700:b0ef6711f2a8 716:eb9aad0c3627
    75  * The symbol_c * associated to the value will point to the data type declaration.
    75  * The symbol_c * associated to the value will point to the data type declaration.
    76  */
    76  */
    77 extern symbol_c null_symbol4;
    77 extern symbol_c null_symbol4;
    78 extern symtable_c<symbol_c *, &null_symbol4> type_symtable;
    78 extern symtable_c<symbol_c *, &null_symbol4> type_symtable;
    79 
    79 
    80 /* A symbol table with all values declared for enumerated type... */
    80 /* A symbol table with all values declared for enumerated types declared in global scope
       
    81  * (i.e. declared inside a TYPE ... END_TYPE declaration.
       
    82  */
    81 /* Notes:
    83 /* Notes:
    82  * - if the value is defined multiple times the value
    84  * (A) - Some enumerations are implicitly declared inside a VAR ... END_VAR declaration
    83  * is the null pointer.
    85  *   (e.g. VAR enum_var : (enumvalue1, enumvalue2); END_VAR)
       
    86  *   These enumvalueX will only be valid (in scope) inside the POU in which the enum_var is declared. 
       
    87  *   Because of this, they are not stored in this symbol table
    84  *
    88  *
    85  * - The stored symbol_c * associated to the value points to the enumerated_type_name
    89  * (B) - if the value is defined multiple times the value is the null pointer.
    86  * (i.e. the name of the enumerated data type) in which the the value/identifier
       
    87  * is used/declared.
       
    88  *
    90  *
    89  * - We could re-use the null_symbol4 object, but it is safer to use a distinct object
    91  * (C) - The stored symbol_c * associated to the value points to the enumerated_type_name
       
    92  *   (i.e. the name of the enumerated data type) in which the the value/identifier is used/declared.
       
    93  *
       
    94  * (D) - We could re-use the null_symbol4 object, but it is safer to use a distinct object
    90  *   (i.e. it might make it easier to find strange bugs).
    95  *   (i.e. it might make it easier to find strange bugs).
    91  */
    96  */
    92 extern symbol_c null_symbol5;
    97 extern symbol_c null_symbol5;
    93 extern symtable_c<symbol_c *, &null_symbol5> enumerated_value_symtable;
    98 extern symtable_c<symbol_c *, &null_symbol5> enumerated_value_symtable;
    94 
    99