absyntax_utils/search_var_instance_decl.hh
author mjsousa
Wed, 17 Dec 2014 13:47:37 +0000
changeset 966 cd7fa00ad774
parent 939 5074236fb3c4
child 1011 76175defb87b
permissions -rw-r--r--
When generating C code, use the const_value of a symbolic_variable when it is used in a subrange.
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
     1
/*
265
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
     2
 *  matiec - a compiler for the programming languages defined in IEC 61131-3
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
     3
 *
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
     4
 *  Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
279
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 265
diff changeset
     5
 *  Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
265
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
     6
 *
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
     7
 *  This program is free software: you can redistribute it and/or modify
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
     8
 *  it under the terms of the GNU General Public License as published by
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
     9
 *  the Free Software Foundation, either version 3 of the License, or
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
    10
 *  (at your option) any later version.
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
    11
 *
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
    12
 *  This program is distributed in the hope that it will be useful,
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
    13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
    14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
    15
 *  GNU General Public License for more details.
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
    16
 *
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
    17
 *  You should have received a copy of the GNU General Public License
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
    18
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
    19
 *
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    20
 *
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    21
 * This code is made available on the understanding that it will not be
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    22
 * used in safety-critical situations without a full and competent review.
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    23
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    24
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    25
/*
265
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 226
diff changeset
    26
 * An IEC 61131-3 compiler.
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    27
 *
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    28
 * Based on the
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    29
 * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    30
 *
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    31
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    32
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    33
504
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    34
/* Search in a VAR* END_VAR declaration for the delcration of the specified variable instance. 
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    35
 * Will return:
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    36
 *     - the declaration itself (get_decl() )
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    37
 *     - the type of declaration in which the variable was declared (get_vartype() )
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    38
 *
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    39
 * The variable instance may NOT be a member of a structure of a memeber
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    40
 * of a structure of an element of an array of ...
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    41
 *
504
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    42
 * For example, considering the following 'variables':
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    43
 *    window.points[1].coordinate.x
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    44
 *    window.points[1].colour
504
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    45
 *    offset[99]
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    46
 *
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    47
 *   passing a reference to 'points', 'points[1]', 'points[1].colour', 'colour'
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    48
 *    ARE NOT ALLOWED!
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    49
 *
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    50
 * This class must only be passed the name of the variable that will appear
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    51
 * in the variable declaration. In the above examples, this would be
504
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    52
 *   'window.points[1].coordinate.x'
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    53
 *   'window.points[1].coordinate'
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    54
 *   'window.points[1]'
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    55
 *   'window'
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    56
 *   'window.points[1].colour'
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    57
 *   'offset'
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    58
 *   'offset[99]'
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    59
 *
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    60
 *
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    61
 */
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    62
 
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    63
/* Note: 
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    64
 * Determining the declaration type of a specific variable instance (including
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    65
 * function block instances) really means determining whether the variable was declared in a
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    66
 *  VAR_INPUT
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    67
 *  VAR_OUTPUT
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    68
 *  VAR_IN_OUT
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    69
 *  VAR
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    70
 *  VAR_TEMP
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    71
 *  VAR_EXTERNAL
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    72
 *  VAR_GLOBAL
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    73
 *  VAR <var_name> AT <location>   -> Located variable!
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    74
 * 
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    75
 */
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    76
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    77
/* Note:
f8d422b98315 Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
    78
 *  The current_type_decl that this class returns may reference the
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    79
 * name of a type, or the type declaration itself!
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    80
 * For an example of the first, consider a variable declared as ...
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    81
 * x : AAA;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    82
 * where the AAA type is previously declared as whatever.
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    83
 * For an example of the second, consider a variable declared as ...
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    84
 * x : array of int [10];  ---->  is allowed
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    85
 *
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    86
 * If it is the first, we will return a reference to the name, if the second
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    87
 * we return a reference to the declaration!!
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    88
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    89
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    90
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    91
class search_var_instance_decl_c: public search_visitor_c {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    92
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    93
  public:
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    94
    search_var_instance_decl_c(symbol_c *search_scope);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    95
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    96
  public:
536
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
    97
    typedef enum {
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
    98
        input_vt   ,  // VAR_INPUT
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
    99
        output_vt  ,  // VAR_OUTPUT
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   100
        inoutput_vt,  // VAR_IN_OUT
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   101
        private_vt ,  // VAR
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   102
        temp_vt    ,  // VAR_TEMP
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   103
        external_vt,  // VAR_EXTERNAL
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   104
        global_vt  ,  // VAR_GLOBAL
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   105
        located_vt ,   // VAR <var_name> AT <location>
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   106
        none_vt
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   107
      } vt_t;
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   108
      
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   109
    typedef enum {
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   110
        constant_opt  ,
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   111
        retain_opt    ,
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   112
        non_retain_opt,
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   113
        none_opt
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   114
      } opt_t;
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   115
#if 0        
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   116
    /* the types of variables that need to be processed... */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   117
    static const unsigned int none_vt     = 0x0000;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   118
    static const unsigned int input_vt    = 0x0001;  // VAR_INPUT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   119
    static const unsigned int output_vt   = 0x0002;  // VAR_OUTPUT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   120
    static const unsigned int inoutput_vt = 0x0004;  // VAR_IN_OUT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   121
    static const unsigned int private_vt  = 0x0008;  // VAR
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   122
    static const unsigned int temp_vt     = 0x0010;  // VAR_TEMP
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   123
    static const unsigned int external_vt = 0x0020;  // VAR_EXTERNAL
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   124
    static const unsigned int global_vt   = 0x0040;  // VAR_GLOBAL
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   125
    static const unsigned int located_vt  = 0x0080;  // VAR <var_name> AT <location>
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   126
507
30b31d8f6d0f Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents: 504
diff changeset
   127
    static const unsigned int none_opt        = 0x0000;
30b31d8f6d0f Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents: 504
diff changeset
   128
    static const unsigned int constant_opt    = 0x0001;
30b31d8f6d0f Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents: 504
diff changeset
   129
    static const unsigned int retain_opt      = 0x0002;
30b31d8f6d0f Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents: 504
diff changeset
   130
    static const unsigned int non_retain_opt  = 0x0003;
536
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   131
#endif    
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   132
    
939
5074236fb3c4 fill_candidate_datatypes_c now uses search_varinstance_decl_c instead of search_varfb_instance_type_c (moving towards deprecation of search_varfb_instance_type_c)
mjsousa
parents: 854
diff changeset
   133
    symbol_c *get_decl          (symbol_c *variable_instance_name); 
5074236fb3c4 fill_candidate_datatypes_c now uses search_varinstance_decl_c instead of search_varfb_instance_type_c (moving towards deprecation of search_varfb_instance_type_c)
mjsousa
parents: 854
diff changeset
   134
    symbol_c *get_basetype_decl (symbol_c *variable_instance_name); 
5074236fb3c4 fill_candidate_datatypes_c now uses search_varinstance_decl_c instead of search_varfb_instance_type_c (moving towards deprecation of search_varfb_instance_type_c)
mjsousa
parents: 854
diff changeset
   135
    vt_t      get_vartype       (symbol_c *variable_instance_name);
5074236fb3c4 fill_candidate_datatypes_c now uses search_varinstance_decl_c instead of search_varfb_instance_type_c (moving towards deprecation of search_varfb_instance_type_c)
mjsousa
parents: 854
diff changeset
   136
    opt_t     get_option        (symbol_c *variable_instance_name);
536
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   137
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   138
  private:
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   139
    symbol_c *search_scope;
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   140
    symbol_c *search_name;
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   141
    symbol_c *current_type_decl;
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   142
    /* variable used to store the type of variable currently being processed... */
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   143
    /* Will contain a single value of generate_c_vardecl_c::XXXX_vt */
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   144
    vt_t  current_vartype;
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   145
    opt_t current_option;
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   146
563b013ec670 Change constants into enums.
Mario de Sousa <msousa@fe.up.pt>
parents: 533
diff changeset
   147
    
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   148
  private:
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   149
    /***************************/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   150
    /* B 0 - Programming Model */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   151
    /***************************/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   152
    void *visit(library_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   153
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   154
    /******************************************/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   155
    /* B 1.4.3 - Declaration & Initialisation */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   156
    /******************************************/
217
f5dfadf5de54 Adding support for declare, init, get and set macros
laurent
parents: 202
diff changeset
   157
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   158
    /* edge -> The F_EDGE or R_EDGE directive */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   159
    // SYM_REF2(edge_declaration_c, edge, var1_list)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   160
    // TODO
507
30b31d8f6d0f Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents: 504
diff changeset
   161
    void *visit(constant_option_c *symbol);
30b31d8f6d0f Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents: 504
diff changeset
   162
    void *visit(retain_option_c *symbol);
30b31d8f6d0f Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents: 504
diff changeset
   163
    void *visit(non_retain_option_c *symbol);
30b31d8f6d0f Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents: 504
diff changeset
   164
30b31d8f6d0f Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents: 504
diff changeset
   165
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   166
    void *visit(input_declarations_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   167
    /* VAR_OUTPUT [RETAIN | NON_RETAIN] var_init_decl_list END_VAR */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   168
    /* option -> may be NULL ! */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   169
    void *visit(output_declarations_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   170
    /*  VAR_IN_OUT var_declaration_list END_VAR */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   171
    void *visit(input_output_declarations_c *symbol);
202
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 181
diff changeset
   172
    /* ENO : BOOL */
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 181
diff changeset
   173
    void *visit(eno_param_declaration_c *symbol);
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   174
    /* VAR [CONSTANT] var_init_decl_list END_VAR */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   175
    /* option -> may be NULL ! */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   176
    /* helper symbol for input_declarations */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   177
    void *visit(var_declarations_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   178
    /*  VAR RETAIN var_init_decl_list END_VAR */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   179
    void *visit(retentive_var_declarations_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   180
    /*  VAR [CONSTANT|RETAIN|NON_RETAIN] located_var_decl_list END_VAR */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   181
    /* option -> may be NULL ! */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   182
    //SYM_REF2(located_var_declarations_c, option, located_var_decl_list)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   183
    void *visit(located_var_declarations_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   184
    /*| VAR_EXTERNAL [CONSTANT] external_declaration_list END_VAR */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   185
    /* option -> may be NULL ! */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   186
    //SYM_REF2(external_var_declarations_c, option, external_declaration_list)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   187
    void *visit(external_var_declarations_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   188
    /*| VAR_GLOBAL [CONSTANT|RETAIN] global_var_decl_list END_VAR */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   189
    /* option -> may be NULL ! */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   190
    //SYM_REF2(global_var_declarations_c, option, global_var_decl_list)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   191
    void *visit(global_var_declarations_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   192
    /* var1_list is one of the following...
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   193
     *    simple_spec_init_c *
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   194
     *    subrange_spec_init_c *
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   195
     *    enumerated_spec_init_c *
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   196
     */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   197
    // SYM_REF2(var1_init_decl_c, var1_list, spec_init)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   198
    void *visit(var1_init_decl_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   199
    /* var1_list ',' variable_name */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   200
    // SYM_LIST(var1_list_c)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   201
    void *visit(var1_list_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   202
    /* name_list ':' function_block_type_name ASSIGN structure_initialization */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   203
    /* structure_initialization -> may be NULL ! */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   204
    void *visit(fb_name_decl_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   205
    /* name_list ',' fb_name */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   206
    void *visit(fb_name_list_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   207
    /* var1_list ':' array_spec_init */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   208
    // SYM_REF2(array_var_init_decl_c, var1_list, array_spec_init)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   209
    void *visit(array_var_init_decl_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   210
    /*  var1_list ':' initialized_structure */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   211
    // SYM_REF2(structured_var_init_decl_c, var1_list, initialized_structure)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   212
    void *visit(structured_var_init_decl_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   213
    /*  var1_list ':' array_specification */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   214
    // SYM_REF2(array_var_declaration_c, var1_list, array_specification)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   215
    void *visit(array_var_declaration_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   216
    /*  var1_list ':' structure_type_name */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   217
    // SYM_REF2(structured_var_declaration_c, var1_list, structure_type_name)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   218
    void *visit(structured_var_declaration_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   219
    /*  [variable_name] location ':' located_var_spec_init */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   220
    /* variable_name -> may be NULL ! */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   221
    // SYM_REF4(located_var_decl_c, variable_name, location, located_var_spec_init, unused)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   222
    // TODO!!
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   223
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   224
    /*  global_var_name ':' (simple_specification|subrange_specification|enumerated_specification|array_specification|prev_declared_structure_type_name|function_block_type_name */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   225
    // SYM_REF2(external_declaration_c, global_var_name, specification)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   226
    void *visit(external_declaration_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   227
    /*| global_var_spec ':' [located_var_spec_init|function_block_type_name] */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   228
    /* type_specification ->may be NULL ! */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   229
    // SYM_REF2(global_var_decl_c, global_var_spec, type_specification)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   230
    void *visit(global_var_decl_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   231
    /*| global_var_name location */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   232
    //SYM_REF2(global_var_spec_c, global_var_name, location)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   233
    void *visit(global_var_spec_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   234
    /*| global_var_list ',' global_var_name */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   235
    //SYM_LIST(global_var_list_c)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   236
    void *visit(global_var_list_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   237
    /*  [variable_name] location ':' located_var_spec_init */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   238
    /* variable_name -> may be NULL ! */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   239
    //SYM_REF4(located_var_decl_c, variable_name, location, located_var_spec_init, unused)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   240
    void *visit(located_var_decl_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   241
    /*| global_var_spec ':' [located_var_spec_init|function_block_type_name] */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   242
    /* type_specification ->may be NULL ! */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   243
    // SYM_REF2(global_var_decl_c, global_var_spec, type_specification)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   244
    // TODO!!
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   245
    /*  AT direct_variable */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   246
    // SYM_REF2(location_c, direct_variable, unused)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   247
    void *visit(location_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   248
    /*| global_var_list ',' global_var_name */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   249
    // SYM_LIST(global_var_list_c)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   250
    // TODO!!
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   251
    /*  var1_list ':' single_byte_string_spec */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   252
    // SYM_REF2(single_byte_string_var_declaration_c, var1_list, single_byte_string_spec)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   253
    void *visit(single_byte_string_var_declaration_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   254
    /*  STRING ['[' integer ']'] [ASSIGN single_byte_character_string] */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   255
    /* integer ->may be NULL ! */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   256
    /* single_byte_character_string ->may be NULL ! */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   257
    // SYM_REF2(single_byte_string_spec_c, integer, single_byte_character_string)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   258
    // TODO!!
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   259
    
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   260
    /*  var1_list ':' double_byte_string_spec */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   261
    // SYM_REF2(double_byte_string_var_declaration_c, var1_list, double_byte_string_spec)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   262
    void *visit(double_byte_string_var_declaration_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   263
    /*  WSTRING ['[' integer ']'] [ASSIGN double_byte_character_string] */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   264
    /* integer ->may be NULL ! */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   265
    /* double_byte_character_string ->may be NULL ! */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   266
    // SYM_REF2(double_byte_string_spec_c, integer, double_byte_character_string)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   267
    // TODO!!
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   268
    
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   269
    /*  variable_name incompl_location ':' var_spec */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   270
    // SYM_REF4(incompl_located_var_decl_c, variable_name, incompl_location, var_spec, unused)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   271
    // TODO!!
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   272
    
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   273
    /*  AT incompl_location_token */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   274
    // SYM_TOKEN(incompl_location_c)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   275
    // TODO!!
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   276
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   277
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   278
    /**************************************/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   279
    /* B.1.5 - Program organization units */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   280
    /**************************************/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   281
    /***********************/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   282
    /* B 1.5.1 - Functions */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   283
    /***********************/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   284
    // SYM_REF4(function_declaration_c, derived_function_name, type_name, var_declarations_list, function_body)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   285
    void *visit(function_declaration_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   286
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   287
    /*****************************/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   288
    /* B 1.5.2 - Function Blocks */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   289
    /*****************************/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   290
    void *visit(function_block_declaration_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   291
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   292
    /**********************/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   293
    /* B 1.5.3 - Programs */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   294
    /**********************/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   295
    void *visit(program_declaration_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   296
619
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   297
    /*********************************************/
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   298
    /* B.1.6  Sequential function chart elements */
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   299
    /*********************************************/
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   300
    /* | sequential_function_chart sfc_network */
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   301
    // SYM_LIST(sequential_function_chart_c)
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   302
    /* search_var_instance_decl_c inherits from serach_visitor_c, so no need to implement the following method. */
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   303
    // void *visit(sequential_function_chart_c *symbol);
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   304
    
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   305
    /* initial_step {step | transition | action} */
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   306
    // SYM_LIST(sfc_network_c)
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   307
    /* search_var_instance_decl_c inherits from serach_visitor_c, so no need to implement the following method. */
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   308
    // void *visit(sfc_network_c *symbol);
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   309
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   310
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   311
    /* INITIAL_STEP step_name ':' action_association_list END_STEP */
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   312
    // SYM_REF2(initial_step_c, step_name, action_association_list)
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   313
    void *visit(initial_step_c *symbol);
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   314
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   315
    /* STEP step_name ':' action_association_list END_STEP */
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   316
    // SYM_REF2(step_c, step_name, action_association_list)
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   317
    void *visit(step_c *symbol);
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   318
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   319
    /********************************/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   320
    /* B 1.7 Configuration elements */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   321
    /********************************/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   322
    
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   323
    /*
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   324
    CONFIGURATION configuration_name
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   325
       optional_global_var_declarations
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   326
       (resource_declaration_list | single_resource_declaration)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   327
       optional_access_declarations
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   328
       optional_instance_specific_initializations
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   329
    END_CONFIGURATION
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   330
    */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   331
    /*
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   332
    SYM_REF6(configuration_declaration_c, configuration_name, global_var_declarations, resource_declarations, access_declarations, instance_specific_initializations, unused)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   333
    */                                                                                                            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   334
    void *visit(configuration_declaration_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   335
    /*
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   336
    RESOURCE resource_name ON resource_type_name
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   337
       optional_global_var_declarations
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   338
       single_resource_declaration
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   339
    END_RESOURCE
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   340
    */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   341
    // SYM_REF4(resource_declaration_c, resource_name, resource_type_name, global_var_declarations, resource_declaration)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   342
    void *visit(resource_declaration_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   343
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   344
    /* task_configuration_list program_configuration_list */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   345
    // SYM_REF2(single_resource_declaration_c, task_configuration_list, program_configuration_list)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   346
    void *visit(single_resource_declaration_c *symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   347
619
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   348
    
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   349
    /****************************************/
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   350
    /* B.2 - Language IL (Instruction List) */
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   351
    /****************************************/
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   352
    /***********************************/
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   353
    /* B 2.1 Instructions and Operands */
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   354
    /***********************************/
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   355
    /*| instruction_list il_instruction */
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   356
    // SYM_LIST(instruction_list_c)
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   357
    void *visit(instruction_list_c *symbol);
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   358
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   359
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   360
    /***************************************/
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   361
    /* B.3 - Language ST (Structured Text) */
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   362
    /***************************************/
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   363
    /********************/
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   364
    /* B 3.2 Statements */
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   365
    /********************/
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   366
    // SYM_LIST(statement_list_c)
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   367
    void *visit(statement_list_c *symbol);
f8c9ac5c529a Support for data types of STEP.T and STEP.X in SFCs
Mario de Sousa <msousa@fe.up.pt>
parents: 536
diff changeset
   368
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   369
}; // search_var_instance_decl_c
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   370