stage4/generate_c/generate_c_il.cc
changeset 321 a96399ab57c2
parent 311 8fcea60029de
child 336 229eb3e29216
equal deleted inserted replaced
320:4df13059b982 321:a96399ab57c2
   645       symbol->subscripted_variable->accept(*this);
   645       symbol->subscripted_variable->accept(*this);
   646       break;
   646       break;
   647     case complextype_suffix_vg:
   647     case complextype_suffix_vg:
   648       symbol->subscripted_variable->accept(*this);
   648       symbol->subscripted_variable->accept(*this);
   649 
   649 
   650       current_array_type = search_varfb_instance_type->get_rawtype(symbol->subscripted_variable);
   650       current_array_type = search_varfb_instance_type->get_type_id(symbol->subscripted_variable);
   651       if (current_array_type == NULL) ERROR;
   651       if (current_array_type == NULL) ERROR;
   652 
   652 
   653       s4o.print(".table");
   653       s4o.print(".table");
   654       symbol->subscript_list->accept(*this);
   654       symbol->subscript_list->accept(*this);
   655 
   655 
   657       break;
   657       break;
   658     default:
   658     default:
   659       if (this->is_variable_prefix_null()) {
   659       if (this->is_variable_prefix_null()) {
   660         symbol->subscripted_variable->accept(*this);
   660         symbol->subscripted_variable->accept(*this);
   661 
   661 
   662         current_array_type = search_varfb_instance_type->get_rawtype(symbol->subscripted_variable);
   662         current_array_type = search_varfb_instance_type->get_type_id(symbol->subscripted_variable);
   663         if (current_array_type == NULL) ERROR;
   663         if (current_array_type == NULL) ERROR;
   664 
   664 
   665         s4o.print(".table");
   665         s4o.print(".table");
   666         symbol->subscript_list->accept(*this);
   666         symbol->subscript_list->accept(*this);
   667 
   667 
  1118 
  1118 
  1119     /* now output the value assignment */
  1119     /* now output the value assignment */
  1120     if (param_value != NULL)
  1120     if (param_value != NULL)
  1121       if ((param_direction == function_param_iterator_c::direction_out) ||
  1121       if ((param_direction == function_param_iterator_c::direction_out) ||
  1122           (param_direction == function_param_iterator_c::direction_inout)) {
  1122           (param_direction == function_param_iterator_c::direction_inout)) {
  1123         symbol_c *param_type = search_varfb_instance_type->get_rawtype(param_value);
  1123         symbol_c *param_type = search_varfb_instance_type->get_type_id(param_value);
  1124         s4o.print(";\n" + s4o.indent_spaces);
  1124         s4o.print(";\n" + s4o.indent_spaces);
  1125         if (this->is_variable_prefix_null()) {
  1125         if (this->is_variable_prefix_null()) {
  1126           param_value->accept(*this);
  1126           param_value->accept(*this);
  1127 		  s4o.print(" = ");
  1127 		  s4o.print(" = ");
  1128 		  print_check_function(param_type, param_name, symbol->fb_name);
  1128 		  print_check_function(param_type, param_name, symbol->fb_name);
  1477                this->current_operand);
  1477                this->current_operand);
  1478   return NULL;
  1478   return NULL;
  1479 }
  1479 }
  1480 
  1480 
  1481 void *visit(ST_operator_c *symbol)	{
  1481 void *visit(ST_operator_c *symbol)	{
  1482   symbol_c *operand_type = search_varfb_instance_type->get_rawtype(this->current_operand);
  1482   symbol_c *operand_type = search_varfb_instance_type->get_type_id(this->current_operand);
  1483   if (search_expression_type->is_literal_integer_type(this->default_variable_name.current_type) ||
  1483   if (search_expression_type->is_literal_integer_type(this->default_variable_name.current_type) ||
  1484   	  search_expression_type->is_literal_real_type(this->default_variable_name.current_type))
  1484   	  search_expression_type->is_literal_real_type(this->default_variable_name.current_type))
  1485       this->default_variable_name.current_type = this->current_operand_type;
  1485       this->default_variable_name.current_type = this->current_operand_type;
  1486   if (this->is_variable_prefix_null()) {
  1486   if (this->is_variable_prefix_null()) {
  1487     this->current_operand->accept(*this);
  1487     this->current_operand->accept(*this);
  1494   /* the data type resulting from this operation is unchanged. */
  1494   /* the data type resulting from this operation is unchanged. */
  1495   return NULL;
  1495   return NULL;
  1496 }
  1496 }
  1497 
  1497 
  1498 void *visit(STN_operator_c *symbol)	{
  1498 void *visit(STN_operator_c *symbol)	{
  1499   symbol_c *operand_type = search_varfb_instance_type->get_rawtype(this->current_operand);
  1499   symbol_c *operand_type = search_varfb_instance_type->get_type_id(this->current_operand);
  1500   if (search_expression_type->is_literal_integer_type(this->default_variable_name.current_type))
  1500   if (search_expression_type->is_literal_integer_type(this->default_variable_name.current_type))
  1501 	this->default_variable_name.current_type = this->current_operand_type;
  1501 	this->default_variable_name.current_type = this->current_operand_type;
  1502   
  1502   
  1503   if (this->is_variable_prefix_null()) {
  1503   if (this->is_variable_prefix_null()) {
  1504     this->current_operand->accept(*this);
  1504     this->current_operand->accept(*this);