absyntax_utils/search_varfb_instance_type.cc
changeset 540 5993247a1c91
parent 531 e7d6f28fc882
child 616 0c7663fdc8d3
equal deleted inserted replaced
536:563b013ec670 540:5993247a1c91
    91 void search_varfb_instance_type_c::init(void) {
    91 void search_varfb_instance_type_c::init(void) {
    92   this->current_type_id        = NULL;
    92   this->current_type_id        = NULL;
    93   this->current_basetype_id    = NULL;
    93   this->current_basetype_id    = NULL;
    94   this->current_basetype_decl  = NULL;
    94   this->current_basetype_decl  = NULL;
    95   this->current_field_selector = NULL;
    95   this->current_field_selector = NULL;
    96   this->is_complex = false;
       
    97 }
    96 }
    98 
    97 
    99 
    98 
   100 search_varfb_instance_type_c::search_varfb_instance_type_c(symbol_c *search_scope): search_var_instance_decl(search_scope) {
    99 search_varfb_instance_type_c::search_varfb_instance_type_c(symbol_c *search_scope): search_var_instance_decl(search_scope) {
   101   this->init();
   100   this->init();
   296  * we must return the data type of the value _stored_ in the array.
   295  * we must return the data type of the value _stored_ in the array.
   297  * If you want to get the data type of the array itself (i.e. just the X variable, without the [42])
   296  * If you want to get the data type of the array itself (i.e. just the X variable, without the [42])
   298  * then this class must be called with the identifier_c 'X'.
   297  * then this class must be called with the identifier_c 'X'.
   299  */
   298  */
   300 void *search_varfb_instance_type_c::visit(array_variable_c *symbol) {
   299 void *search_varfb_instance_type_c::visit(array_variable_c *symbol) {
   301   this->is_complex = true;
       
   302 
       
   303   /* determine the data type of the subscripted_variable... 
   300   /* determine the data type of the subscripted_variable... 
   304    * This should be an array_specification_c
   301    * This should be an array_specification_c
   305    *    ARRAY [xx..yy] OF Stored_Data_Type
   302    *    ARRAY [xx..yy] OF Stored_Data_Type
   306    */
   303    */
   307   symbol->subscripted_variable->accept(*this);
   304   symbol->subscripted_variable->accept(*this);
   321  *           Code handling a structured_variable_c must take
   318  *           Code handling a structured_variable_c must take
   322  *           this into account!
   319  *           this into account!
   323  */
   320  */
   324 // SYM_REF2(structured_variable_c, record_variable, field_selector)
   321 // SYM_REF2(structured_variable_c, record_variable, field_selector)
   325 void *search_varfb_instance_type_c::visit(structured_variable_c *symbol) {
   322 void *search_varfb_instance_type_c::visit(structured_variable_c *symbol) {
   326   this->is_complex = true;
       
   327   symbol->record_variable->accept(*this);
   323   symbol->record_variable->accept(*this);
   328   
   324   
   329   /* Now we search for the data type of the field... But only if we were able to determine the data type of the variable */
   325   /* Now we search for the data type of the field... But only if we were able to determine the data type of the variable */
   330   if (NULL != current_basetype_decl) {
   326   if (NULL != current_basetype_decl) {
   331     current_field_selector = symbol->field_selector;
   327     current_field_selector = symbol->field_selector;