stage4/generate_c/generate_c_st.cc
changeset 667 bd1360f29f15
parent 653 ea78924a1f60
parent 625 c0bda77b37a0
child 668 90b6eb7f1775
equal deleted inserted replaced
666:8ba9ec4bae50 667:bd1360f29f15
   317 /*************************************/
   317 /*************************************/
   318 
   318 
   319 // SYM_REF2(structured_variable_c, record_variable, field_selector)
   319 // SYM_REF2(structured_variable_c, record_variable, field_selector)
   320 void *visit(structured_variable_c *symbol) {
   320 void *visit(structured_variable_c *symbol) {
   321   TRACE("structured_variable_c");
   321   TRACE("structured_variable_c");
       
   322   bool type_is_complex = search_var_instance_decl->type_is_complex(symbol->record_variable);
   322   switch (wanted_variablegeneration) {
   323   switch (wanted_variablegeneration) {
   323     case complextype_base_vg:
   324     case complextype_base_vg:
   324     case complextype_base_assignment_vg:
   325     case complextype_base_assignment_vg:
   325       symbol->record_variable->accept(*this);
   326       symbol->record_variable->accept(*this);
       
   327       if (!type_is_complex) {
       
   328     	s4o.print(".");
       
   329     	symbol->field_selector->accept(*this);
       
   330       }
   326       break;
   331       break;
   327     case complextype_suffix_vg:
   332     case complextype_suffix_vg:
       
   333       symbol->record_variable->accept(*this);
       
   334       if (type_is_complex) {
       
   335         s4o.print(".");
       
   336         symbol->field_selector->accept(*this);
       
   337       }
       
   338       break;
   328     case assignment_vg:
   339     case assignment_vg:
   329       symbol->record_variable->accept(*this);
   340       symbol->record_variable->accept(*this);
   330       s4o.print(".");
   341       s4o.print(".");
   331       symbol->field_selector->accept(*this);
   342       symbol->field_selector->accept(*this);
   332       break;
   343       break;