stage4/generate_c/generate_c_st.cc
changeset 321 a96399ab57c2
parent 309 f93bcada0f51
child 336 229eb3e29216
equal deleted inserted replaced
320:4df13059b982 321:a96399ab57c2
   303       symbol->subscripted_variable->accept(*this);
   303       symbol->subscripted_variable->accept(*this);
   304       break;
   304       break;
   305     case complextype_suffix_vg:
   305     case complextype_suffix_vg:
   306       symbol->subscripted_variable->accept(*this);
   306       symbol->subscripted_variable->accept(*this);
   307 
   307 
   308       current_array_type = search_varfb_instance_type->get_rawtype(symbol->subscripted_variable);
   308       current_array_type = search_varfb_instance_type->get_type_id(symbol->subscripted_variable);
   309       if (current_array_type == NULL) ERROR;
   309       if (current_array_type == NULL) ERROR;
   310 
   310 
   311       s4o.print(".table");
   311       s4o.print(".table");
   312       wanted_variablegeneration = expression_vg;
   312       wanted_variablegeneration = expression_vg;
   313       symbol->subscript_list->accept(*this);
   313       symbol->subscript_list->accept(*this);
   317       break;
   317       break;
   318     default:
   318     default:
   319       if (this->is_variable_prefix_null()) {
   319       if (this->is_variable_prefix_null()) {
   320     	symbol->subscripted_variable->accept(*this);
   320     	symbol->subscripted_variable->accept(*this);
   321 
   321 
   322     	current_array_type = search_varfb_instance_type->get_rawtype(symbol->subscripted_variable);
   322     	current_array_type = search_varfb_instance_type->get_type_id(symbol->subscripted_variable);
   323     	if (current_array_type == NULL) ERROR;
   323     	if (current_array_type == NULL) ERROR;
   324 
   324 
   325     	s4o.print(".table");
   325     	s4o.print(".table");
   326         symbol->subscript_list->accept(*this);
   326         symbol->subscript_list->accept(*this);
   327 
   327 
   787 
   787 
   788 /*********************************/
   788 /*********************************/
   789 /* B 3.2.1 Assignment Statements */
   789 /* B 3.2.1 Assignment Statements */
   790 /*********************************/
   790 /*********************************/
   791 void *visit(assignment_statement_c *symbol) {
   791 void *visit(assignment_statement_c *symbol) {
   792   symbol_c *left_type = search_varfb_instance_type->get_rawtype(symbol->l_exp);
   792   symbol_c *left_type = search_varfb_instance_type->get_type_id(symbol->l_exp);
   793   
   793   
   794   if (this->is_variable_prefix_null()) {
   794   if (this->is_variable_prefix_null()) {
   795     symbol->l_exp->accept(*this);
   795     symbol->l_exp->accept(*this);
   796     s4o.print(" = ");
   796     s4o.print(" = ");
   797     print_check_function(left_type, symbol->r_exp);
   797     print_check_function(left_type, symbol->r_exp);
   891 
   891 
   892     /* now output the value assignment */
   892     /* now output the value assignment */
   893     if (param_value != NULL)
   893     if (param_value != NULL)
   894       if ((param_direction == function_param_iterator_c::direction_out) ||
   894       if ((param_direction == function_param_iterator_c::direction_out) ||
   895           (param_direction == function_param_iterator_c::direction_inout)) {
   895           (param_direction == function_param_iterator_c::direction_inout)) {
   896         symbol_c *param_type = search_varfb_instance_type->get_rawtype(param_value);
   896         symbol_c *param_type = search_varfb_instance_type->get_type_id(param_value);
   897         s4o.print(";\n" + s4o.indent_spaces);
   897         s4o.print(";\n" + s4o.indent_spaces);
   898         if (this->is_variable_prefix_null()) {
   898         if (this->is_variable_prefix_null()) {
   899           param_value->accept(*this);
   899           param_value->accept(*this);
   900           s4o.print(" = ");
   900           s4o.print(" = ");
   901           print_check_function(param_type, param_name, symbol->fb_name);
   901           print_check_function(param_type, param_name, symbol->fb_name);