stage4/generate_c/generate_c_st.cc
changeset 693 51a2fa6441b9
parent 668 90b6eb7f1775
child 694 a010763dd4cb
equal deleted inserted replaced
692:c3287ffaee8c 693:51a2fa6441b9
   757           param_value = (symbol_c *)current_param_type->accept(*type_initial_value_c::instance());
   757           param_value = (symbol_c *)current_param_type->accept(*type_initial_value_c::instance());
   758         }
   758         }
   759         if (param_value == NULL) ERROR;
   759         if (param_value == NULL) ERROR;
   760         s4o.print("(");
   760         s4o.print("(");
   761         if      (get_datatype_info_c::is_ANY_INT_literal(current_param_type))
   761         if      (get_datatype_info_c::is_ANY_INT_literal(current_param_type))
   762           search_constant_type_c::lint_type_name.accept(*this);
   762           get_datatype_info_c::lint_type_name.accept(*this);
   763         else if (get_datatype_info_c::is_ANY_REAL_literal(current_param_type))
   763         else if (get_datatype_info_c::is_ANY_REAL_literal(current_param_type))
   764           search_constant_type_c::lreal_type_name.accept(*this);
   764           get_datatype_info_c::lreal_type_name.accept(*this);
   765         else
   765         else
   766           current_param_type->accept(*this);
   766           current_param_type->accept(*this);
   767         s4o.print(")");
   767         s4o.print(")");
   768         print_check_function(current_param_type, param_value);
   768         print_check_function(current_param_type, param_value);
   769         nb_param++;
   769         nb_param++;
  1035   symbol_c *expression_type = symbol->expression->datatype;
  1035   symbol_c *expression_type = symbol->expression->datatype;
  1036   s4o.print("{\n");
  1036   s4o.print("{\n");
  1037   s4o.indent_right();
  1037   s4o.indent_right();
  1038   s4o.print(s4o.indent_spaces);
  1038   s4o.print(s4o.indent_spaces);
  1039   if      (get_datatype_info_c::is_ANY_INT_literal(expression_type))
  1039   if      (get_datatype_info_c::is_ANY_INT_literal(expression_type))
  1040         search_constant_type_c::lint_type_name.accept(*this);
  1040            get_datatype_info_c::lint_type_name.accept(*this);
  1041   else if (get_datatype_info_c::is_ANY_REAL_literal(expression_type))
  1041   else if (get_datatype_info_c::is_ANY_REAL_literal(expression_type))
  1042         search_constant_type_c::lreal_type_name.accept(*this);
  1042            get_datatype_info_c::lreal_type_name.accept(*this);
  1043   else
  1043   else
  1044     expression_type->accept(*this);
  1044     expression_type->accept(*this);
  1045   s4o.print(" __case_expression = ");
  1045   s4o.print(" __case_expression = ");
  1046   symbol->expression->accept(*this);
  1046   symbol->expression->accept(*this);
  1047   s4o.print(";\n" + s4o.indent_spaces + "switch (__case_expression) {\n");
  1047   s4o.print(";\n" + s4o.indent_spaces + "switch (__case_expression) {\n");