stage4/generate_c/generate_c.cc
changeset 854 13d0b67de111
parent 853 818c4ac5d64d
child 856 d80971552535
child 863 06820d03a433
equal deleted inserted replaced
853:818c4ac5d64d 854:13d0b67de111
   350   public:
   350   public:
   351     analyse_variable_c(void) {};
   351     analyse_variable_c(void) {};
   352     
   352     
   353     static bool is_complex_type(symbol_c *symbol) {
   353     static bool is_complex_type(symbol_c *symbol) {
   354       if (NULL == symbol)           ERROR;
   354       if (NULL == symbol)           ERROR;
   355       if (NULL == symbol->datatype) ERROR;
   355       if (!get_datatype_info_c::is_type_valid     (symbol->datatype)) ERROR;
   356       return (   get_datatype_info_c::is_structure(symbol->datatype) 
   356       return (   get_datatype_info_c::is_structure(symbol->datatype) 
   357               || get_datatype_info_c::is_array    (symbol->datatype) 
   357               || get_datatype_info_c::is_array    (symbol->datatype) 
   358              );
   358              );
   359     }
   359     }
   360 
   360 
   390     
   390     
   391     // SYM_REF2(structured_variable_c, record_variable, field_selector)
   391     // SYM_REF2(structured_variable_c, record_variable, field_selector)
   392     void *visit(structured_variable_c *symbol) {
   392     void *visit(structured_variable_c *symbol) {
   393       symbol->record_variable->accept(*this);
   393       symbol->record_variable->accept(*this);
   394       /* do not set the contains_complex_type_res to TRUE if this structured_variable_c is accessing a FB instance! */
   394       /* do not set the contains_complex_type_res to TRUE if this structured_variable_c is accessing a FB instance! */
       
   395       if (!get_datatype_info_c::is_type_valid(symbol->datatype)) ERROR;
   395       contains_complex_type_res |= get_datatype_info_c::is_structure(symbol->datatype);
   396       contains_complex_type_res |= get_datatype_info_c::is_structure(symbol->datatype);
   396       return NULL;
   397       return NULL;
   397     }
   398     }
   398     
   399     
   399     /*  subscripted_variable '[' subscript_list ']' */
   400     /*  subscripted_variable '[' subscript_list ']' */