absyntax_utils/search_var_instance_decl.hh
changeset 536 563b013ec670
parent 533 dd93707c482e
child 619 f8c9ac5c529a
equal deleted inserted replaced
535:70140bd7fe67 536:563b013ec670
    88  */
    88  */
    89 
    89 
    90 
    90 
    91 class search_var_instance_decl_c: public search_visitor_c {
    91 class search_var_instance_decl_c: public search_visitor_c {
    92 
    92 
    93   private:
       
    94     symbol_c *search_scope;
       
    95     symbol_c *search_name;
       
    96     symbol_c *current_type_decl;
       
    97 
       
    98     /* variable used to store the type of variable currently being processed... */
       
    99     /* Will contain a single value of generate_c_vardecl_c::XXXX_vt */
       
   100     unsigned int current_vartype;
       
   101     unsigned int current_option;
       
   102 
       
   103   public:
    93   public:
   104     search_var_instance_decl_c(symbol_c *search_scope);
    94     search_var_instance_decl_c(symbol_c *search_scope);
   105     
       
   106     symbol_c *   get_decl   (symbol_c *variable_instance_name); 
       
   107     unsigned int get_vartype(symbol_c *variable_instance_name);
       
   108     unsigned int get_option (symbol_c *variable_instance_name);
       
   109 
       
   110     /* NOTE: The following function will be completely deleted in the (hopefully near) future. */
       
   111     /* Returns true if the variable is an ARRAY or a STRUCT, otherwise returns false.
       
   112      * Note that for FB, also returns false!
       
   113      */
       
   114     bool type_is_complex(symbol_c *variable_name);
       
   115 
    95 
   116   public:
    96   public:
       
    97     typedef enum {
       
    98         input_vt   ,  // VAR_INPUT
       
    99         output_vt  ,  // VAR_OUTPUT
       
   100         inoutput_vt,  // VAR_IN_OUT
       
   101         private_vt ,  // VAR
       
   102         temp_vt    ,  // VAR_TEMP
       
   103         external_vt,  // VAR_EXTERNAL
       
   104         global_vt  ,  // VAR_GLOBAL
       
   105         located_vt ,   // VAR <var_name> AT <location>
       
   106         none_vt
       
   107       } vt_t;
       
   108       
       
   109     typedef enum {
       
   110         constant_opt  ,
       
   111         retain_opt    ,
       
   112         non_retain_opt,
       
   113         none_opt
       
   114       } opt_t;
       
   115 #if 0        
   117     /* the types of variables that need to be processed... */
   116     /* the types of variables that need to be processed... */
   118     static const unsigned int none_vt     = 0x0000;
   117     static const unsigned int none_vt     = 0x0000;
   119     static const unsigned int input_vt    = 0x0001;  // VAR_INPUT
   118     static const unsigned int input_vt    = 0x0001;  // VAR_INPUT
   120     static const unsigned int output_vt   = 0x0002;  // VAR_OUTPUT
   119     static const unsigned int output_vt   = 0x0002;  // VAR_OUTPUT
   121     static const unsigned int inoutput_vt = 0x0004;  // VAR_IN_OUT
   120     static const unsigned int inoutput_vt = 0x0004;  // VAR_IN_OUT
   127 
   126 
   128     static const unsigned int none_opt        = 0x0000;
   127     static const unsigned int none_opt        = 0x0000;
   129     static const unsigned int constant_opt    = 0x0001;
   128     static const unsigned int constant_opt    = 0x0001;
   130     static const unsigned int retain_opt      = 0x0002;
   129     static const unsigned int retain_opt      = 0x0002;
   131     static const unsigned int non_retain_opt  = 0x0003;
   130     static const unsigned int non_retain_opt  = 0x0003;
   132 
   131 #endif    
       
   132     
       
   133     symbol_c *   get_decl   (symbol_c *variable_instance_name); 
       
   134     vt_t         get_vartype(symbol_c *variable_instance_name);
       
   135     opt_t        get_option (symbol_c *variable_instance_name);
       
   136 
       
   137     /* NOTE: The following function will be completely deleted in the (hopefully near) future. */
       
   138     /* Returns true if the variable is an ARRAY or a STRUCT, otherwise returns false.
       
   139      * Note that for FB, also returns false!
       
   140      */
       
   141     bool type_is_complex(symbol_c *variable_name);
       
   142 
       
   143     
       
   144     
       
   145   private:
       
   146     symbol_c *search_scope;
       
   147     symbol_c *search_name;
       
   148     symbol_c *current_type_decl;
       
   149     /* variable used to store the type of variable currently being processed... */
       
   150     /* Will contain a single value of generate_c_vardecl_c::XXXX_vt */
       
   151     vt_t  current_vartype;
       
   152     opt_t current_option;
       
   153 
       
   154     
   133   private:
   155   private:
   134     /***************************/
   156     /***************************/
   135     /* B 0 - Programming Model */
   157     /* B 0 - Programming Model */
   136     /***************************/
   158     /***************************/
   137     void *visit(library_c *symbol);
   159     void *visit(library_c *symbol);