stage4/generate_c/generate_c_il.cc
changeset 149 05ca171a3d57
parent 146 eef5e62048c7
child 169 bea932bc60b0
equal deleted inserted replaced
148:912bdab1eca8 149:05ca171a3d57
   411       this->default_variable_name.current_type = backup;
   411       this->default_variable_name.current_type = backup;
   412 
   412 
   413       s4o.print(" = ");
   413       s4o.print(" = ");
   414       s4o.print(operation);
   414       s4o.print(operation);
   415       this->default_variable_name.current_type->accept(*this);
   415       this->default_variable_name.current_type->accept(*this);
   416       s4o.print("(2, ");
   416       s4o.print("(__BOOL_LITERAL(TRUE), NULL, 2, ");
   417       this->default_variable_name.accept(*this);
   417       this->default_variable_name.accept(*this);
   418       s4o.print(", ");
   418       s4o.print(", ");
   419       o->accept(*this);
   419       o->accept(*this);
   420       s4o.print(")");
   420       s4o.print(")");
   421 
   421 
   600 /* | function_name [il_operand_list] */
   600 /* | function_name [il_operand_list] */
   601 // SYM_REF2(il_function_call_c, function_name, il_operand_list)
   601 // SYM_REF2(il_function_call_c, function_name, il_operand_list)
   602 void *visit(il_function_call_c *symbol) {
   602 void *visit(il_function_call_c *symbol) {
   603   function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name);
   603   function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name);
   604 
   604 
       
   605   symbol_c* function_type_prefix = NULL;
       
   606   symbol_c* function_name = NULL;
       
   607   symbol_c* function_type_suffix = NULL;
       
   608   std::list<FUNCTION_PARAM> param_list;
       
   609   FUNCTION_PARAM *param;
       
   610   
       
   611   symbol_c *param_data_type = default_variable_name.current_type;
       
   612   symbol_c *return_data_type = NULL;
       
   613   
   605   if (f_decl == function_symtable.end_value()) {
   614   if (f_decl == function_symtable.end_value()) {
   606     /* should never occur. The function being called MUST be in the symtable... */
       
   607     function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name);
   615     function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name);
   608     if (current_function_type == function_none) ERROR;
   616     if (current_function_type == function_none) ERROR;
   609     
   617     
   610     symbol_c *param_data_type = default_variable_name.current_type;
   618     return_data_type = (symbol_c *)search_expression_type->compute_standard_function_il(symbol, param_data_type);
   611     symbol_c *return_data_type = (symbol_c *)search_expression_type->compute_standard_function_il(symbol, param_data_type);
       
   612     if (NULL == return_data_type) ERROR;
   619     if (NULL == return_data_type) ERROR;
   613     
   620     
   614     default_variable_name.current_type = return_data_type;
       
   615     this->default_variable_name.accept(*this);
       
   616     default_variable_name.current_type = param_data_type;
       
   617     s4o.print(" = ");
       
   618     
       
   619     function_call_param_iterator_c function_call_param_iterator(symbol);
   621     function_call_param_iterator_c function_call_param_iterator(symbol);
       
   622     
       
   623     /* Add the value from EN param */
       
   624     ADD_PARAM_LIST((symbol_c*)(new boolean_literal_c((symbol_c*)(new bool_type_name_c()), new boolean_true_c())), 
       
   625                    (symbol_c*)(new bool_type_name_c()), 
       
   626                    function_param_iterator_c::direction_in)
       
   627     
       
   628     /* Add the value from ENO param */
       
   629     ADD_PARAM_LIST(NULL, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_out)
   620     
   630     
   621     int nb_param = 1;
   631     int nb_param = 1;
   622     if (symbol->il_operand_list != NULL)
   632     if (symbol->il_operand_list != NULL)
   623       nb_param += ((list_c *)symbol->il_operand_list)->n;
   633       nb_param += ((list_c *)symbol->il_operand_list)->n;
   624 
   634 
   625     #include "il_code_gen.c"
   635     #include "il_code_gen.c"
   626 
   636 
   627     /* the data type returned by the function, and stored in the il default variable... */
       
   628     default_variable_name.current_type = return_data_type;
       
   629   }
   637   }
   630   else {
   638   else {
   631     /* determine the base data type returned by the function being called... */
   639     /* determine the base data type returned by the function being called... */
   632     search_base_type_c search_base_type;
   640     search_base_type_c search_base_type;
   633     symbol_c *return_data_type = (symbol_c *)f_decl->type_name->accept(search_base_type);
   641     return_data_type = (symbol_c *)f_decl->type_name->accept(search_base_type);
   634     symbol_c *param_data_type = default_variable_name.current_type;
       
   635     if (NULL == return_data_type) ERROR;
   642     if (NULL == return_data_type) ERROR;
   636   
   643   
   637     default_variable_name.current_type = return_data_type;
   644     function_name = symbol->function_name;
   638     this->default_variable_name.accept(*this);
   645     
   639     default_variable_name.current_type = param_data_type;
       
   640     s4o.print(" = ");
       
   641   
       
   642     symbol->function_name->accept(*this);
       
   643     s4o.print("(");
       
   644   
       
   645     /* loop through each function parameter, find the value we should pass
   646     /* loop through each function parameter, find the value we should pass
   646      * to it, and then output the c equivalent...
   647      * to it, and then output the c equivalent...
   647      */
   648      */
   648   
   649   
   649     function_param_iterator_c fp_iterator(f_decl);
   650     function_param_iterator_c fp_iterator(f_decl);
   650     identifier_c *param_name;
   651     identifier_c *param_name;
   651     function_call_param_iterator_c function_call_param_iterator(symbol);
   652     function_call_param_iterator_c function_call_param_iterator(symbol);
   652     for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) {
   653     for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) {
   653       if (i != 1)
       
   654         s4o.print(", ");
       
   655   
       
   656       symbol_c *param_type = fp_iterator.param_type();
   654       symbol_c *param_type = fp_iterator.param_type();
   657       if (param_type == NULL) ERROR;
   655       if (param_type == NULL) ERROR;
   658   
   656       
   659       function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction();
   657       function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction();
   660   
   658       
   661   
       
   662       symbol_c *param_value = NULL;
   659       symbol_c *param_value = NULL;
   663   
   660   
   664       /* if it is the first parameter, semantics specifies that we should
   661       /* if it is the first parameter, semantics specifies that we should
   665        * get the value off the IL default variable!
   662        * get the value off the IL default variable!
   666        */
   663        */
   679         param_value = function_call_param_iterator.search(param_name);
   676         param_value = function_call_param_iterator.search(param_name);
   680   
   677   
   681       /* Get the value from a foo(<param_value>) style call */
   678       /* Get the value from a foo(<param_value>) style call */
   682       if (param_value == NULL)
   679       if (param_value == NULL)
   683         param_value = function_call_param_iterator.next();
   680         param_value = function_call_param_iterator.next();
   684   
   681       
   685       switch (param_direction) {
   682       if (param_value == NULL && param_direction == function_param_iterator_c::direction_in) {
   686         case function_param_iterator_c::direction_in:
   683         /* No value given for parameter, so we must use the default... */
   687           if (param_value == NULL) {
   684         /* First check whether default value specified in function declaration...*/
   688             /* No value given for parameter, so we must use the default... */
   685         param_value = fp_iterator.default_value();
   689             /* First check whether default value specified in function declaration...*/
   686       }
   690             param_value = fp_iterator.default_value();
   687       
   691           }
   688       ADD_PARAM_LIST(param_value, param_type, fp_iterator.param_direction())
   692           if (param_value == NULL) {
   689     } /* for(...) */
   693             /* If not, get the default value of this variable's type */
   690   }
   694             param_value = (symbol_c *)param_type->accept(*type_initial_value_c::instance());
   691   
   695           }
   692   default_variable_name.current_type = return_data_type;
   696           if (param_value == NULL) ERROR;
   693   this->default_variable_name.accept(*this);
       
   694   default_variable_name.current_type = param_data_type;
       
   695   s4o.print(" = ");
       
   696     
       
   697   if (function_type_prefix != NULL) {
       
   698     s4o.print("(");
       
   699     function_type_prefix->accept(*this);
       
   700     s4o.print(")");
       
   701   }
       
   702   if (function_name != NULL)
       
   703     function_name->accept(*this);
       
   704   if (function_type_suffix != NULL)
       
   705     function_type_suffix->accept(*this);
       
   706   s4o.print("(");
       
   707   s4o.indent_right();
       
   708   
       
   709   std::list<FUNCTION_PARAM>::iterator pt;
       
   710   for(pt = param_list.begin(); pt != param_list.end(); pt++) {
       
   711     if (pt != param_list.begin())
       
   712       s4o.print(",\n"+s4o.indent_spaces);
       
   713     symbol_c *param_value = pt->param_value;
       
   714     symbol_c *param_type = pt->param_type;
       
   715     
       
   716     switch (pt->param_direction) {
       
   717       case function_param_iterator_c::direction_in:
       
   718         if (param_value == NULL) {
       
   719           /* If not, get the default value of this variable's type */
       
   720           param_value = (symbol_c *)param_type->accept(*type_initial_value_c::instance());
       
   721         }
       
   722         if (param_value == NULL) ERROR;
       
   723         if (search_base_type.type_is_subrange(param_type)) {
       
   724           s4o.print("__CHECK_");
       
   725           param_type->accept(*this);
       
   726           s4o.print("(");
       
   727         }
       
   728         param_value->accept(*this);
       
   729         if (search_base_type.type_is_subrange(param_type))
       
   730           s4o.print(")");
       
   731         break;
       
   732       case function_param_iterator_c::direction_out:
       
   733       case function_param_iterator_c::direction_inout:
       
   734         current_param_is_pointer = true;
       
   735         if (param_value == NULL) {
       
   736           s4o.print("NULL");
       
   737         } else {
   697           param_value->accept(*this);
   738           param_value->accept(*this);
   698           break;
   739         }
   699         case function_param_iterator_c::direction_out:
   740         current_param_is_pointer = false;
   700         case function_param_iterator_c::direction_inout:
   741         break;
   701           current_param_is_pointer = true;
   742       case function_param_iterator_c::direction_extref:
   702           if (param_value == NULL) {
   743         /* TODO! */
   703             s4o.print("NULL");
   744         ERROR;
   704           } else {
   745         break;
   705             param_value->accept(*this);
   746     } /* switch */
   706           }
   747   }
   707           current_param_is_pointer = false;
   748   
   708           break;
   749   s4o.print(")");
   709         case function_param_iterator_c::direction_extref:
   750   /* the data type returned by the function, and stored in the il default variable... */
   710           /* TODO! */
   751   default_variable_name.current_type = return_data_type;
   711           ERROR;
       
   712           break;
       
   713       } /* switch */
       
   714     } /* for(...) */
       
   715   
       
   716     s4o.print(")");
       
   717     /* the data type returned by the function, and stored in the il default variable... */
       
   718     default_variable_name.current_type = return_data_type;
       
   719   }
       
   720   
       
   721   return NULL;
   752   return NULL;
   722 }
   753 }
   723 
   754 
   724 
   755 
   725 /* | il_expr_operator '(' [il_operand] eol_list [simple_instr_list] ')' */
   756 /* | il_expr_operator '(' [il_operand] eol_list [simple_instr_list] ')' */
   899 /* | function_name '(' eol_list [il_param_list] ')' */
   930 /* | function_name '(' eol_list [il_param_list] ')' */
   900 // SYM_REF2(il_formal_funct_call_c, function_name, il_param_list)
   931 // SYM_REF2(il_formal_funct_call_c, function_name, il_param_list)
   901 void *visit(il_formal_funct_call_c *symbol) {
   932 void *visit(il_formal_funct_call_c *symbol) {
   902   function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name);
   933   function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name);
   903 
   934 
   904   if (f_decl == function_symtable.end_value())
   935   symbol_c* function_type_prefix = NULL;
   905     /* should never occur. The function being called MUST be in the symtable... */
   936   symbol_c* function_name = NULL;
   906     ERROR;
   937   symbol_c* function_type_suffix = NULL;
   907 
   938   std::list<FUNCTION_PARAM> param_list;
   908   symbol->function_name->accept(*this);
   939   FUNCTION_PARAM *param;
       
   940 
       
   941   symbol_c *return_data_type = NULL;
       
   942 
       
   943   if (f_decl == function_symtable.end_value()) {
       
   944     function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name);
       
   945     if (current_function_type == function_none) ERROR;
       
   946     
       
   947     return_data_type = (symbol_c *)search_expression_type->compute_standard_function_default(NULL, symbol);
       
   948     if (NULL == return_data_type) ERROR;
       
   949     
       
   950     function_call_param_iterator_c function_call_param_iterator(symbol);
       
   951     
       
   952     identifier_c en_param_name("EN");
       
   953     /* Get the value from EN param */
       
   954     symbol_c *EN_param_value = function_call_param_iterator.search(&en_param_name);
       
   955     if (EN_param_value == NULL)
       
   956       EN_param_value = (symbol_c*)(new boolean_literal_c((symbol_c*)(new bool_type_name_c()), new boolean_true_c()));
       
   957     ADD_PARAM_LIST(EN_param_value, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_in)
       
   958     
       
   959     identifier_c eno_param_name("EN0");
       
   960     /* Get the value from ENO param */
       
   961     symbol_c *ENO_param_value = function_call_param_iterator.search(&eno_param_name);
       
   962     ADD_PARAM_LIST(ENO_param_value, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_out)
       
   963     
       
   964     int nb_param = 0;
       
   965     if (symbol->il_param_list != NULL)
       
   966       nb_param += ((list_c *)symbol->il_param_list)->n;
       
   967 
       
   968     #include "st_code_gen.c"
       
   969     
       
   970   }
       
   971   else {
       
   972     /* determine the base data type returned by the function being called... */
       
   973     search_base_type_c search_base_type;
       
   974     return_data_type = (symbol_c *)f_decl->type_name->accept(search_base_type);
       
   975     if (NULL == return_data_type) ERROR;
       
   976     
       
   977     function_name = symbol->function_name;
       
   978   
       
   979     /* loop through each function parameter, find the value we should pass
       
   980      * to it, and then output the c equivalent...
       
   981      */
       
   982   
       
   983     function_param_iterator_c fp_iterator(f_decl);
       
   984     identifier_c *param_name;
       
   985     function_call_param_iterator_c function_call_param_iterator(symbol);
       
   986     for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) {
       
   987       symbol_c *param_type = fp_iterator.param_type();
       
   988       if (param_type == NULL) ERROR;
       
   989   
       
   990       function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction();
       
   991   
       
   992   
       
   993       symbol_c *param_value = NULL;
       
   994   
       
   995       /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   996       if (param_value == NULL)
       
   997         param_value = function_call_param_iterator.search(param_name);
       
   998   
       
   999       /* Get the value from a foo(<param_value>) style call */
       
  1000       /* NOTE: the following line of code is not required in this case, but it doesn't
       
  1001        * harm to leave it in, as in the case of a formal syntax function call,
       
  1002        * it will always return NULL.
       
  1003        * We leave it in in case we later decide to merge this part of the code together
       
  1004        * with the function calling code in generate_c_st_c, which does require
       
  1005        * the following line...
       
  1006        */
       
  1007       if (param_value == NULL)
       
  1008         param_value = function_call_param_iterator.next();
       
  1009       
       
  1010       if (param_value == NULL) {
       
  1011         /* No value given for parameter, so we must use the default... */
       
  1012         /* First check whether default value specified in function declaration...*/
       
  1013         param_value = fp_iterator.default_value();
       
  1014       }
       
  1015       
       
  1016       ADD_PARAM_LIST(param_value, param_type, fp_iterator.param_direction())
       
  1017     }
       
  1018   }
       
  1019   
       
  1020   default_variable_name.current_type = return_data_type;
       
  1021   this->default_variable_name.accept(*this);
       
  1022   s4o.print(" = ");
       
  1023   
       
  1024   if (function_type_prefix != NULL) {
       
  1025     s4o.print("(");
       
  1026     function_type_prefix->accept(*this);
       
  1027     s4o.print(")");
       
  1028   }
       
  1029   if (function_name != NULL)
       
  1030     function_name->accept(*this);
       
  1031   if (function_type_suffix != NULL)
       
  1032     function_type_suffix->accept(*this);
   909   s4o.print("(");
  1033   s4o.print("(");
   910 
  1034   s4o.indent_right();
   911   /* loop through each function parameter, find the value we should pass
  1035   
   912    * to it, and then output the c equivalent...
  1036   std::list<FUNCTION_PARAM>::iterator pt;
   913    */
  1037   for(pt = param_list.begin(); pt != param_list.end(); pt++) {
   914 
  1038     if (pt != param_list.begin())
   915   function_param_iterator_c fp_iterator(f_decl);
  1039       s4o.print(",\n"+s4o.indent_spaces);
   916   identifier_c *param_name;
  1040     symbol_c *param_value = pt->param_value;
   917   function_call_param_iterator_c function_call_param_iterator(symbol);
  1041     symbol_c *param_type = pt->param_type;
   918   for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) {
  1042     
   919     if (i != 1)
  1043     switch (pt->param_direction) {
   920       s4o.print(", ");
       
   921 
       
   922     symbol_c *param_type = fp_iterator.param_type();
       
   923     if (param_type == NULL) ERROR;
       
   924 
       
   925     function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction();
       
   926 
       
   927 
       
   928     symbol_c *param_value = NULL;
       
   929 
       
   930     /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   931     if (param_value == NULL)
       
   932       param_value = function_call_param_iterator.search(param_name);
       
   933 
       
   934     /* Get the value from a foo(<param_value>) style call */
       
   935     /* NOTE: the following line of code is not required in this case, but it doesn't
       
   936      * harm to leave it in, as in the case of a formal syntax function call,
       
   937      * it will always return NULL.
       
   938      * We leave it in in case we later decide to merge this part of the code together
       
   939      * with the function calling code in generate_c_st_c, which does require
       
   940      * the following line...
       
   941      */
       
   942     if (param_value == NULL)
       
   943       param_value = function_call_param_iterator.next();
       
   944 
       
   945     switch (param_direction) {
       
   946       case function_param_iterator_c::direction_in:
  1044       case function_param_iterator_c::direction_in:
   947         if (param_value == NULL) {
       
   948           /* No value given for parameter, so we must use the default... */
       
   949           /* First check whether default value specified in function declaration...*/
       
   950           param_value = fp_iterator.default_value();
       
   951         }
       
   952         if (param_value == NULL) {
  1045         if (param_value == NULL) {
   953           /* If not, get the default value of this variable's type */
  1046           /* If not, get the default value of this variable's type */
   954           param_value = (symbol_c *)param_type->accept(*type_initial_value_c::instance());
  1047           param_value = (symbol_c *)param_type->accept(*type_initial_value_c::instance());
   955         }
  1048         }
   956         if (param_value == NULL) ERROR;
  1049         if (param_value == NULL) ERROR;
   960           s4o.print("(");
  1053           s4o.print("(");
   961         }
  1054         }
   962         param_value->accept(*this);
  1055         param_value->accept(*this);
   963         if (search_base_type.type_is_subrange(param_type))
  1056         if (search_base_type.type_is_subrange(param_type))
   964           s4o.print(")");
  1057           s4o.print(")");
   965 	break;
  1058 	      break;
   966       case function_param_iterator_c::direction_out:
  1059       case function_param_iterator_c::direction_out:
   967       case function_param_iterator_c::direction_inout:
  1060       case function_param_iterator_c::direction_inout:
       
  1061         current_param_is_pointer = true;
   968         if (param_value == NULL) {
  1062         if (param_value == NULL) {
   969 	  /* no parameter value given, so we pass a previously declared temporary variable. */
  1063           s4o.print("NULL");
   970           std::string *temp_var_name = temp_var_name_factory.new_name();
  1064         } else {
   971           s4o.print(*temp_var_name);
       
   972           delete temp_var_name;
       
   973 	} else {
       
   974           param_value->accept(*this);
  1065           param_value->accept(*this);
   975 	}
  1066         }
   976 	break;
  1067         current_param_is_pointer = false;
       
  1068 	      break;
   977       case function_param_iterator_c::direction_extref:
  1069       case function_param_iterator_c::direction_extref:
   978         /* TODO! */
  1070         /* TODO! */
   979         ERROR;
  1071         ERROR;
   980 	break;
  1072 	      break;
   981     } /* switch */
  1073     } /* switch */
   982   } /* for(...) */
  1074   } /* for(...) */
   983 
  1075 
   984   // symbol->parameter_assignment->accept(*this);
  1076   // symbol->parameter_assignment->accept(*this);
   985   s4o.print(")");
  1077   s4o.print(")");
       
  1078   /* the data type returned by the function, and stored in the il default variable... */
   986   return NULL;
  1079   return NULL;
   987 }
  1080 }
   988 
  1081 
   989 
  1082 
   990 /* | il_operand_list ',' il_operand */
  1083 /* | il_operand_list ',' il_operand */
  1277 }
  1370 }
  1278 
  1371 
  1279 void *visit(ADD_operator_c *symbol)	{
  1372 void *visit(ADD_operator_c *symbol)	{
  1280   if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
  1373   if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
  1281       search_expression_type->is_time_type(this->current_operand_type)) {
  1374       search_expression_type->is_time_type(this->current_operand_type)) {
  1282     XXX_function("__time_add", &(this->default_variable_name), this->current_operand);
  1375     XXX_function("__TIME_ADD", &(this->default_variable_name), this->current_operand);
  1283     /* the data type resulting from this operation... */
  1376     /* the data type resulting from this operation... */
  1284     this->default_variable_name.current_type = this->current_operand_type;
  1377     this->default_variable_name.current_type = this->current_operand_type;
  1285     return NULL;
  1378     return NULL;
  1286   }
  1379   }
  1287   if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
  1380   if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
  1296 }
  1389 }
  1297 
  1390 
  1298 void *visit(SUB_operator_c *symbol)	{
  1391 void *visit(SUB_operator_c *symbol)	{
  1299   if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
  1392   if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
  1300       search_expression_type->is_time_type(this->current_operand_type)) {
  1393       search_expression_type->is_time_type(this->current_operand_type)) {
  1301     XXX_function("__time_sub", &(this->default_variable_name), this->current_operand);
  1394     XXX_function("__TIME_SUB", &(this->default_variable_name), this->current_operand);
  1302     /* the data type resulting from this operation... */
  1395     /* the data type resulting from this operation... */
  1303     this->default_variable_name.current_type = this->current_operand_type;
  1396     this->default_variable_name.current_type = this->current_operand_type;
  1304     return NULL;
  1397     return NULL;
  1305   }
  1398   }
  1306   if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
  1399   if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
  1315 }
  1408 }
  1316 
  1409 
  1317 void *visit(MUL_operator_c *symbol)	{
  1410 void *visit(MUL_operator_c *symbol)	{
  1318   if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
  1411   if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
  1319       search_expression_type->is_integer_type(this->current_operand_type)) {
  1412       search_expression_type->is_integer_type(this->current_operand_type)) {
  1320     XXX_function("__time_mul", &(this->default_variable_name), this->current_operand);
  1413     XXX_function("__TIME_MUL", &(this->default_variable_name), this->current_operand);
  1321     /* the data type resulting from this operation... */
  1414     /* the data type resulting from this operation... */
  1322     this->default_variable_name.current_type = this->current_operand_type;
       
  1323     return NULL;
  1415     return NULL;
  1324   }
  1416   }
  1325   if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
  1417   if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
  1326       search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
  1418       search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
  1327     XXX_operator(&(this->default_variable_name), " *= ", this->current_operand);
  1419     XXX_operator(&(this->default_variable_name), " *= ", this->current_operand);
  1332   ERROR;
  1424   ERROR;
  1333   return NULL;
  1425   return NULL;
  1334 }
  1426 }
  1335 
  1427 
  1336 void *visit(DIV_operator_c *symbol)	{
  1428 void *visit(DIV_operator_c *symbol)	{
       
  1429   if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
       
  1430       search_expression_type->is_integer_type(this->current_operand_type)) {
       
  1431     XXX_function("__TIME_DIV", &(this->default_variable_name), this->current_operand);
       
  1432     /* the data type resulting from this operation... */
       
  1433     return NULL;
       
  1434   }
  1337   if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
  1435   if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
  1338       search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
  1436       search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
  1339     XXX_operator(&(this->default_variable_name), " /= ", this->current_operand);
  1437     XXX_operator(&(this->default_variable_name), " /= ", this->current_operand);
  1340     /* the data type resulting from this operation... */
  1438     /* the data type resulting from this operation... */
  1341     this->default_variable_name.current_type = this->current_operand_type;
  1439     this->default_variable_name.current_type = this->current_operand_type;
  1342   }
  1440   }
  1343   else {ERROR;}
  1441   ERROR;
  1344   return NULL;
  1442   return NULL;
  1345 }
  1443 }
  1346 
  1444 
  1347 void *visit(MOD_operator_c *symbol)	{
  1445 void *visit(MOD_operator_c *symbol)	{
  1348   if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
  1446   if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
  1349       search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
  1447       search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
  1350     XXX_operator(&(this->default_variable_name), " %= ", this->current_operand);
  1448     XXX_operator(&(this->default_variable_name), " %= ", this->current_operand);
  1351     /* the data type resulting from this operation... */
  1449     /* the data type resulting from this operation... */
  1352     this->default_variable_name.current_type = this->current_operand_type;
  1450     this->default_variable_name.current_type = this->current_operand_type;
  1353   }
  1451   }
  1354   else {ERROR;}
  1452   ERROR;
  1355   return NULL;
  1453   return NULL;
  1356 }
  1454 }
  1357 
  1455 
  1358 void *visit(GT_operator_c *symbol)	{
  1456 void *visit(GT_operator_c *symbol)	{
  1359   if (!search_base_type.type_is_enumerated(this->default_variable_name.current_type) &&
  1457   if (!search_base_type.type_is_enumerated(this->default_variable_name.current_type) &&