absyntax_utils/search_var_instance_decl.cc
changeset 812 6679b6b21214
parent 810 d9c48ad646f1
child 851 2c59c2b8fca4
equal deleted inserted replaced
811:970c582885bf 812:6679b6b21214
   103 
   103 
   104 symbol_c *search_var_instance_decl_c::get_decl(symbol_c *variable) {
   104 symbol_c *search_var_instance_decl_c::get_decl(symbol_c *variable) {
   105   this->current_vartype = none_vt;
   105   this->current_vartype = none_vt;
   106   this->current_option  = none_opt;
   106   this->current_option  = none_opt;
   107   this->search_name = get_var_name_c::get_name(variable);
   107   this->search_name = get_var_name_c::get_name(variable);
       
   108   if (NULL == search_scope) return NULL; // NOTE: This is not an ERROR! declaration_check_c, for e.g., relies on this returning NULL!
   108   return (symbol_c *)search_scope->accept(*this);
   109   return (symbol_c *)search_scope->accept(*this);
   109 }
   110 }
   110 
   111 
   111 search_var_instance_decl_c::vt_t search_var_instance_decl_c::get_vartype(symbol_c *variable) {
   112 search_var_instance_decl_c::vt_t search_var_instance_decl_c::get_vartype(symbol_c *variable) {
   112   this->current_vartype = none_vt;
   113   this->current_vartype = none_vt;
   113   this->current_option  = none_opt;
   114   this->current_option  = none_opt;
   114   this->search_name = get_var_name_c::get_name(variable);
   115   this->search_name = get_var_name_c::get_name(variable);
       
   116   if (NULL == search_scope) ERROR;
   115   search_scope->accept(*this);
   117   search_scope->accept(*this);
   116   return this->current_vartype;
   118   return this->current_vartype;
   117 }
   119 }
   118 
   120 
   119 search_var_instance_decl_c::opt_t search_var_instance_decl_c::get_option(symbol_c *variable) {
   121 search_var_instance_decl_c::opt_t search_var_instance_decl_c::get_option(symbol_c *variable) {
   120   this->current_vartype = none_vt;
   122   this->current_vartype = none_vt;
   121   this->current_option  = none_opt;
   123   this->current_option  = none_opt;
   122   this->search_name = get_var_name_c::get_name(variable);
   124   this->search_name = get_var_name_c::get_name(variable);
       
   125   if (NULL == search_scope) ERROR;
   123   search_scope->accept(*this);
   126   search_scope->accept(*this);
   124   return this->current_option;
   127   return this->current_option;
   125 }
   128 }
   126 
   129 
   127 
   130