stage4/generate_c/il_code_gen.c
changeset 279 c0453b7f99df
parent 235 ed66dc50f31a
child 314 41d4ac0b4821
equal deleted inserted replaced
278:050d31dd7c74 279:c0453b7f99df
     1 /*
     1 /*
     2  * (c) 2008 Edouard TISSERANT
     2  * Copyright (C) 2007-2011: Edouard TISSERANT and Laurent BESSARD
     3  *
     3  *
     4  * Offered to the public under the terms of the GNU General Public License
     4  * See COPYING and COPYING.LESSER files for copyright details.
     5  * as published by the Free Software Foundation; either version 2 of the
       
     6  * License, or (at your option) any later version.
       
     7  *
     5  *
     8  * This program is distributed in the hope that it will be useful, but
     6  * This program is free software: you can redistribute it and/or modify
     9  * WITHOUT ANY WARRANTY; without even the implied warranty of
     7  * it under the terms of the GNU General Public License as published by
    10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
     8  * the Free Software Foundation, either version 3 of the License, or
    11  * Public License for more details.
     9  * (at your option) any later version.
    12  *
    10  *
    13  * This code is made available on the understanding that it will not be
    11  * This program is distributed in the hope that it will be useful,
    14  * used in safety-critical situations without a full and competent review.
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  */
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 
    14  * GNU General Public License for more details.
    17 /*
       
    18  * An IEC 61131-3 IL and ST compiler.
       
    19  *
    15  *
    20  * Based on the
    16  * You should have received a copy of the GNU General Public License
    21  * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
    17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
    22  *
    18  *
    23  */
    19  */
    24 
    20 
    25 /****
    21 /****
    26  * IEC 61131-3 standard function library
    22  * IEC 61131-3 standard function library
 14370         
 14366         
 14371     }/*function_add*/
 14367     }/*function_add*/
 14372     break;
 14368     break;
 14373 
 14369 
 14374 /****
 14370 /****
       
 14371  *ADD_TIME
       
 14372  */
       
 14373     case function_add_time :
       
 14374     {
       
 14375         symbol_c *last_type_symbol = NULL;
       
 14376 
       
 14377         {
       
 14378             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
       
 14379             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14380             symbol_c *IN1_param_value = &this->default_variable_name;
       
 14381         
       
 14382             symbol_c *IN1_type_symbol = param_data_type;
       
 14383             last_type_symbol = param_data_type;
       
 14384             
       
 14385             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 14386             {
       
 14387         
       
 14388                 {
       
 14389                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
       
 14390                     /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14391                     symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name);
       
 14392                     symbol_c *IN2_type_symbol = NULL;
       
 14393                     
       
 14394                     /* Get the value from a foo(<param_value>) style call */
       
 14395                     if (IN2_param_value == NULL)
       
 14396                       IN2_param_value = function_call_param_iterator.next_nf();
       
 14397                     if (IN2_param_value != NULL) {
       
 14398                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
       
 14399                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
       
 14400                     }
       
 14401                     
       
 14402                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 14403                     {
       
 14404                 
       
 14405                         function_name = (symbol_c*)(new pragma_c("__time_add"));
       
 14406                         
       
 14407                         if (IN1_type_symbol == NULL)
       
 14408                           IN1_type_symbol = last_type_symbol;
       
 14409                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14410                         
       
 14411                         if (IN2_type_symbol == NULL)
       
 14412                           IN2_type_symbol = last_type_symbol;
       
 14413                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 14414                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 14415                         break;
       
 14416                         
       
 14417                     }
       
 14418                     
       
 14419                     
       
 14420                     ERROR;
       
 14421                 }
       
 14422                 
       
 14423             }
       
 14424             
       
 14425             
       
 14426             ERROR;
       
 14427         }
       
 14428         
       
 14429     }/*function_add_time*/
       
 14430     break;
       
 14431 
       
 14432 /****
       
 14433  *ADD_TOD_TIME
       
 14434  */
       
 14435     case function_add_tod_time :
       
 14436     {
       
 14437         symbol_c *last_type_symbol = NULL;
       
 14438 
       
 14439         {
       
 14440             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
       
 14441             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14442             symbol_c *IN1_param_value = &this->default_variable_name;
       
 14443         
       
 14444             symbol_c *IN1_type_symbol = param_data_type;
       
 14445             last_type_symbol = param_data_type;
       
 14446             
       
 14447             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
 14448             {
       
 14449         
       
 14450                 {
       
 14451                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
       
 14452                     /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14453                     symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name);
       
 14454                     symbol_c *IN2_type_symbol = NULL;
       
 14455                     
       
 14456                     /* Get the value from a foo(<param_value>) style call */
       
 14457                     if (IN2_param_value == NULL)
       
 14458                       IN2_param_value = function_call_param_iterator.next_nf();
       
 14459                     if (IN2_param_value != NULL) {
       
 14460                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
       
 14461                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
       
 14462                     }
       
 14463                     
       
 14464                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 14465                     {
       
 14466                 
       
 14467                         function_name = (symbol_c*)(new pragma_c("__time_add"));
       
 14468                         
       
 14469                         if (IN1_type_symbol == NULL)
       
 14470                           IN1_type_symbol = last_type_symbol;
       
 14471                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14472                         
       
 14473                         if (IN2_type_symbol == NULL)
       
 14474                           IN2_type_symbol = last_type_symbol;
       
 14475                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 14476                         symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 14477                         break;
       
 14478                         
       
 14479                     }
       
 14480                     
       
 14481                     
       
 14482                     ERROR;
       
 14483                 }
       
 14484                 
       
 14485             }
       
 14486             
       
 14487             
       
 14488             ERROR;
       
 14489         }
       
 14490         
       
 14491     }/*function_add_tod_time*/
       
 14492     break;
       
 14493 
       
 14494 /****
       
 14495  *ADD_DT_TIME
       
 14496  */
       
 14497     case function_add_dt_time :
       
 14498     {
       
 14499         symbol_c *last_type_symbol = NULL;
       
 14500 
       
 14501         {
       
 14502             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
       
 14503             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14504             symbol_c *IN1_param_value = &this->default_variable_name;
       
 14505         
       
 14506             symbol_c *IN1_type_symbol = param_data_type;
       
 14507             last_type_symbol = param_data_type;
       
 14508             
       
 14509             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
 14510             {
       
 14511         
       
 14512                 {
       
 14513                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
       
 14514                     /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14515                     symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name);
       
 14516                     symbol_c *IN2_type_symbol = NULL;
       
 14517                     
       
 14518                     /* Get the value from a foo(<param_value>) style call */
       
 14519                     if (IN2_param_value == NULL)
       
 14520                       IN2_param_value = function_call_param_iterator.next_nf();
       
 14521                     if (IN2_param_value != NULL) {
       
 14522                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
       
 14523                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
       
 14524                     }
       
 14525                     
       
 14526                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 14527                     {
       
 14528                 
       
 14529                         function_name = (symbol_c*)(new pragma_c("__time_add"));
       
 14530                         
       
 14531                         if (IN1_type_symbol == NULL)
       
 14532                           IN1_type_symbol = last_type_symbol;
       
 14533                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14534                         
       
 14535                         if (IN2_type_symbol == NULL)
       
 14536                           IN2_type_symbol = last_type_symbol;
       
 14537                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 14538                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 14539                         break;
       
 14540                         
       
 14541                     }
       
 14542                     
       
 14543                     
       
 14544                     ERROR;
       
 14545                 }
       
 14546                 
       
 14547             }
       
 14548             
       
 14549             
       
 14550             ERROR;
       
 14551         }
       
 14552         
       
 14553     }/*function_add_dt_time*/
       
 14554     break;
       
 14555 
       
 14556 /****
 14375  *MUL
 14557  *MUL
 14376  */
 14558  */
 14377     case function_mul :
 14559     case function_mul :
 14378     {
 14560     {
 14379         symbol_c *last_type_symbol = NULL;
 14561         symbol_c *last_type_symbol = NULL;
 14506         
 14688         
 14507     }/*function_mul*/
 14689     }/*function_mul*/
 14508     break;
 14690     break;
 14509 
 14691 
 14510 /****
 14692 /****
 14511  *SUB
 14693  *MULTIME
 14512  */
 14694  */
 14513     case function_sub :
 14695     case function_multime :
 14514     {
 14696     {
 14515         symbol_c *last_type_symbol = NULL;
 14697         symbol_c *last_type_symbol = NULL;
 14516 
 14698 
 14517         {
 14699         {
 14518             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
 14700             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
 14520             symbol_c *IN1_param_value = &this->default_variable_name;
 14702             symbol_c *IN1_param_value = &this->default_variable_name;
 14521         
 14703         
 14522             symbol_c *IN1_type_symbol = param_data_type;
 14704             symbol_c *IN1_type_symbol = param_data_type;
 14523             last_type_symbol = param_data_type;
 14705             last_type_symbol = param_data_type;
 14524             
 14706             
 14525             if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
 14707             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14526             {
 14708             {
 14527         
 14709         
 14528                 {
 14710                 {
 14529                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
 14711                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
 14530                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 14712                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 14540                     }
 14722                     }
 14541                     
 14723                     
 14542                     if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
 14724                     if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
 14543                     {
 14725                     {
 14544                 
 14726                 
 14545                         function_name = (symbol_c*)(new pragma_c("__sub_"));
 14727                         function_name = (symbol_c*)(new pragma_c("__time_mul"));
 14546                         
 14728                         
 14547                         if (IN1_type_symbol == NULL)
 14729                         if (IN1_type_symbol == NULL)
 14548                           IN1_type_symbol = last_type_symbol;
 14730                           IN1_type_symbol = last_type_symbol;
 14549                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 14731                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 14550                         
 14732                         
 14551                         if (IN2_type_symbol == NULL)
 14733                         if (IN2_type_symbol == NULL)
 14552                           IN2_type_symbol = last_type_symbol;
 14734                           IN2_type_symbol = last_type_symbol;
 14553                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14735                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14554                         symbol_c * return_type_symbol = last_type_symbol;
 14736                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14555                         function_type_suffix = return_type_symbol;
 14737                         if (search_expression_type->is_literal_integer_type(function_type_suffix))
       
 14738                             function_type_suffix = &search_constant_type_c::lint_type_name;
 14556                         break;
 14739                         break;
 14557                         
 14740                         
 14558                     }
 14741                     }
 14559                     
 14742                     
 14560                     
 14743                     
 14561                     ERROR;
 14744                     ERROR;
 14562                 }
 14745                 }
 14563                 
 14746                 
 14564             }
 14747             }
 14565             
 14748             
 14566             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
 14749             
       
 14750             ERROR;
       
 14751         }
       
 14752         
       
 14753     }/*function_multime*/
       
 14754     break;
       
 14755 
       
 14756 /****
       
 14757  *SUB
       
 14758  */
       
 14759     case function_sub :
       
 14760     {
       
 14761         symbol_c *last_type_symbol = NULL;
       
 14762 
       
 14763         {
       
 14764             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
       
 14765             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14766             symbol_c *IN1_param_value = &this->default_variable_name;
       
 14767         
       
 14768             symbol_c *IN1_type_symbol = param_data_type;
       
 14769             last_type_symbol = param_data_type;
       
 14770             
       
 14771             if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
 14567             {
 14772             {
 14568         
 14773         
 14569                 {
 14774                 {
 14570                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
 14775                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
 14571                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 14776                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 14578                     if (IN2_param_value != NULL) {
 14783                     if (IN2_param_value != NULL) {
 14579                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
 14784                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
 14580                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
 14785                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
 14581                     }
 14786                     }
 14582                     
 14787                     
 14583                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
 14788                     if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
 14584                     {
 14789                     {
 14585                 
 14790                 
 14586                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
 14791                         function_name = (symbol_c*)(new pragma_c("__sub_"));
 14587                         
 14792                         
 14588                         if (IN1_type_symbol == NULL)
 14793                         if (IN1_type_symbol == NULL)
 14589                           IN1_type_symbol = last_type_symbol;
 14794                           IN1_type_symbol = last_type_symbol;
 14590                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 14795                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 14591                         
 14796                         
 14592                         if (IN2_type_symbol == NULL)
 14797                         if (IN2_type_symbol == NULL)
 14593                           IN2_type_symbol = last_type_symbol;
 14798                           IN2_type_symbol = last_type_symbol;
 14594                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14799                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14595                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14800                         symbol_c * return_type_symbol = last_type_symbol;
       
 14801                         function_type_suffix = return_type_symbol;
 14596                         break;
 14802                         break;
 14597                         
 14803                         
 14598                     }
 14804                     }
 14599                     
 14805                     
 14600                     
 14806                     
 14601                     ERROR;
 14807                     ERROR;
 14602                 }
 14808                 }
 14603                 
 14809                 
 14604             }
 14810             }
 14605             
 14811             
 14606             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
 14812             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
 14607             {
 14813             {
 14608         
 14814         
 14609                 {
 14815                 {
 14610                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
 14816                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
 14611                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 14817                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 14618                     if (IN2_param_value != NULL) {
 14824                     if (IN2_param_value != NULL) {
 14619                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
 14825                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
 14620                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
 14826                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
 14621                     }
 14827                     }
 14622                     
 14828                     
 14623                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
 14829                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
 14624                     {
 14830                     {
 14625                 
 14831                 
 14626                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
 14832                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
 14627                         
 14833                         
 14628                         if (IN1_type_symbol == NULL)
 14834                         if (IN1_type_symbol == NULL)
 14635                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14841                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14636                         break;
 14842                         break;
 14637                         
 14843                         
 14638                     }
 14844                     }
 14639                     
 14845                     
 14640                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 14641                     {
       
 14642                 
       
 14643                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
       
 14644                         
       
 14645                         if (IN1_type_symbol == NULL)
       
 14646                           IN1_type_symbol = last_type_symbol;
       
 14647                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14648                         
       
 14649                         if (IN2_type_symbol == NULL)
       
 14650                           IN2_type_symbol = last_type_symbol;
       
 14651                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 14652                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 14653                         break;
       
 14654                         
       
 14655                     }
       
 14656                     
       
 14657                     
 14846                     
 14658                     ERROR;
 14847                     ERROR;
 14659                 }
 14848                 }
 14660                 
 14849                 
 14661             }
 14850             }
 14662             
 14851             
 14663             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
 14852             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
 14664             {
 14853             {
 14665         
 14854         
 14666                 {
 14855                 {
 14667                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
 14856                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
 14668                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 14857                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 14675                     if (IN2_param_value != NULL) {
 14864                     if (IN2_param_value != NULL) {
 14676                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
 14865                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
 14677                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
 14866                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
 14678                     }
 14867                     }
 14679                     
 14868                     
 14680                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
 14869                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
 14681                     {
 14870                     {
 14682                 
 14871                 
 14683                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
 14872                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
 14684                         
 14873                         
 14685                         if (IN1_type_symbol == NULL)
 14874                         if (IN1_type_symbol == NULL)
 14704                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 14893                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 14705                         
 14894                         
 14706                         if (IN2_type_symbol == NULL)
 14895                         if (IN2_type_symbol == NULL)
 14707                           IN2_type_symbol = last_type_symbol;
 14896                           IN2_type_symbol = last_type_symbol;
 14708                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14897                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14709                         symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
 14898                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
 14710                         break;
 14899                         break;
 14711                         
 14900                         
 14712                     }
 14901                     }
 14713                     
 14902                     
 14714                     
 14903                     
 14715                     ERROR;
 14904                     ERROR;
 14716                 }
 14905                 }
 14717                 
 14906                 
 14718             }
 14907             }
 14719             
 14908             
 14720             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14909             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
 14721             {
 14910             {
 14722         
 14911         
 14723                 {
 14912                 {
 14724                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
 14913                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
 14725                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 14914                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 14732                     if (IN2_param_value != NULL) {
 14921                     if (IN2_param_value != NULL) {
 14733                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
 14922                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
 14734                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
 14923                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
 14735                     }
 14924                     }
 14736                     
 14925                     
 14737                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14926                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
 14738                     {
 14927                     {
 14739                 
 14928                 
 14740                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
 14929                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
 14741                         
 14930                         
 14742                         if (IN1_type_symbol == NULL)
 14931                         if (IN1_type_symbol == NULL)
 14749                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14938                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14750                         break;
 14939                         break;
 14751                         
 14940                         
 14752                     }
 14941                     }
 14753                     
 14942                     
       
 14943                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 14944                     {
       
 14945                 
       
 14946                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
       
 14947                         
       
 14948                         if (IN1_type_symbol == NULL)
       
 14949                           IN1_type_symbol = last_type_symbol;
       
 14950                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14951                         
       
 14952                         if (IN2_type_symbol == NULL)
       
 14953                           IN2_type_symbol = last_type_symbol;
       
 14954                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 14955                         symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 14956                         break;
       
 14957                         
       
 14958                     }
       
 14959                     
 14754                     
 14960                     
 14755                     ERROR;
 14961                     ERROR;
 14756                 }
 14962                 }
 14757                 
 14963                 
 14758             }
 14964             }
 14759             
 14965             
 14760             
 14966             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14761             ERROR;
       
 14762         }
       
 14763         
       
 14764     }/*function_sub*/
       
 14765     break;
       
 14766 
       
 14767 /****
       
 14768  *DIV
       
 14769  */
       
 14770     case function_div :
       
 14771     {
       
 14772         symbol_c *last_type_symbol = NULL;
       
 14773 
       
 14774         {
       
 14775             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
       
 14776             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14777             symbol_c *IN1_param_value = &this->default_variable_name;
       
 14778         
       
 14779             symbol_c *IN1_type_symbol = param_data_type;
       
 14780             last_type_symbol = param_data_type;
       
 14781             
       
 14782             if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
       
 14783             {
 14967             {
 14784         
 14968         
 14785                 {
 14969                 {
 14786                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
 14970                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
 14787                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 14971                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 14794                     if (IN2_param_value != NULL) {
 14978                     if (IN2_param_value != NULL) {
 14795                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
 14979                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
 14796                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
 14980                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
 14797                     }
 14981                     }
 14798                     
 14982                     
 14799                     if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
 14983                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14800                     {
 14984                     {
 14801                 
 14985                 
 14802                         function_name = (symbol_c*)(new pragma_c("__div_"));
 14986                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
 14803                         
 14987                         
 14804                         if (IN1_type_symbol == NULL)
 14988                         if (IN1_type_symbol == NULL)
 14805                           IN1_type_symbol = last_type_symbol;
 14989                           IN1_type_symbol = last_type_symbol;
 14806                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 14990                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 14807                         
 14991                         
 14808                         if (IN2_type_symbol == NULL)
 14992                         if (IN2_type_symbol == NULL)
 14809                           IN2_type_symbol = last_type_symbol;
 14993                           IN2_type_symbol = last_type_symbol;
 14810                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14994                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14811                         symbol_c * return_type_symbol = last_type_symbol;
 14995                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14812                         function_type_suffix = return_type_symbol;
       
 14813                         break;
 14996                         break;
 14814                         
 14997                         
 14815                     }
 14998                     }
 14816                     
 14999                     
 14817                     
 15000                     
 14818                     ERROR;
 15001                     ERROR;
 14819                 }
 15002                 }
 14820                 
 15003                 
 14821             }
 15004             }
       
 15005             
       
 15006             
       
 15007             ERROR;
       
 15008         }
       
 15009         
       
 15010     }/*function_sub*/
       
 15011     break;
       
 15012 
       
 15013 /****
       
 15014  *SUB_TIME
       
 15015  */
       
 15016     case function_sub_time :
       
 15017     {
       
 15018         symbol_c *last_type_symbol = NULL;
       
 15019 
       
 15020         {
       
 15021             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
       
 15022             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15023             symbol_c *IN1_param_value = &this->default_variable_name;
       
 15024         
       
 15025             symbol_c *IN1_type_symbol = param_data_type;
       
 15026             last_type_symbol = param_data_type;
 14822             
 15027             
 14823             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 15028             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14824             {
 15029             {
 14825         
 15030         
 14826                 {
 15031                 {
 14835                     if (IN2_param_value != NULL) {
 15040                     if (IN2_param_value != NULL) {
 14836                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
 15041                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
 14837                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
 15042                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
 14838                     }
 15043                     }
 14839                     
 15044                     
       
 15045                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 15046                     {
       
 15047                 
       
 15048                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
       
 15049                         
       
 15050                         if (IN1_type_symbol == NULL)
       
 15051                           IN1_type_symbol = last_type_symbol;
       
 15052                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 15053                         
       
 15054                         if (IN2_type_symbol == NULL)
       
 15055                           IN2_type_symbol = last_type_symbol;
       
 15056                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 15057                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 15058                         break;
       
 15059                         
       
 15060                     }
       
 15061                     
       
 15062                     
       
 15063                     ERROR;
       
 15064                 }
       
 15065                 
       
 15066             }
       
 15067             
       
 15068             
       
 15069             ERROR;
       
 15070         }
       
 15071         
       
 15072     }/*function_sub_time*/
       
 15073     break;
       
 15074 
       
 15075 /****
       
 15076  *SUB_DATE_DATE
       
 15077  */
       
 15078     case function_sub_date_date :
       
 15079     {
       
 15080         symbol_c *last_type_symbol = NULL;
       
 15081 
       
 15082         {
       
 15083             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
       
 15084             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15085             symbol_c *IN1_param_value = &this->default_variable_name;
       
 15086         
       
 15087             symbol_c *IN1_type_symbol = param_data_type;
       
 15088             last_type_symbol = param_data_type;
       
 15089             
       
 15090             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
 15091             {
       
 15092         
       
 15093                 {
       
 15094                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
       
 15095                     /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15096                     symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name);
       
 15097                     symbol_c *IN2_type_symbol = NULL;
       
 15098                     
       
 15099                     /* Get the value from a foo(<param_value>) style call */
       
 15100                     if (IN2_param_value == NULL)
       
 15101                       IN2_param_value = function_call_param_iterator.next_nf();
       
 15102                     if (IN2_param_value != NULL) {
       
 15103                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
       
 15104                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
       
 15105                     }
       
 15106                     
       
 15107                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
 15108                     {
       
 15109                 
       
 15110                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
       
 15111                         
       
 15112                         if (IN1_type_symbol == NULL)
       
 15113                           IN1_type_symbol = last_type_symbol;
       
 15114                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 15115                         
       
 15116                         if (IN2_type_symbol == NULL)
       
 15117                           IN2_type_symbol = last_type_symbol;
       
 15118                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 15119                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 15120                         break;
       
 15121                         
       
 15122                     }
       
 15123                     
       
 15124                     
       
 15125                     ERROR;
       
 15126                 }
       
 15127                 
       
 15128             }
       
 15129             
       
 15130             
       
 15131             ERROR;
       
 15132         }
       
 15133         
       
 15134     }/*function_sub_date_date*/
       
 15135     break;
       
 15136 
       
 15137 /****
       
 15138  *SUB_TOD_TIME
       
 15139  */
       
 15140     case function_sub_tod_time :
       
 15141     {
       
 15142         symbol_c *last_type_symbol = NULL;
       
 15143 
       
 15144         {
       
 15145             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
       
 15146             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15147             symbol_c *IN1_param_value = &this->default_variable_name;
       
 15148         
       
 15149             symbol_c *IN1_type_symbol = param_data_type;
       
 15150             last_type_symbol = param_data_type;
       
 15151             
       
 15152             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
 15153             {
       
 15154         
       
 15155                 {
       
 15156                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
       
 15157                     /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15158                     symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name);
       
 15159                     symbol_c *IN2_type_symbol = NULL;
       
 15160                     
       
 15161                     /* Get the value from a foo(<param_value>) style call */
       
 15162                     if (IN2_param_value == NULL)
       
 15163                       IN2_param_value = function_call_param_iterator.next_nf();
       
 15164                     if (IN2_param_value != NULL) {
       
 15165                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
       
 15166                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
       
 15167                     }
       
 15168                     
       
 15169                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 15170                     {
       
 15171                 
       
 15172                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
       
 15173                         
       
 15174                         if (IN1_type_symbol == NULL)
       
 15175                           IN1_type_symbol = last_type_symbol;
       
 15176                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 15177                         
       
 15178                         if (IN2_type_symbol == NULL)
       
 15179                           IN2_type_symbol = last_type_symbol;
       
 15180                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 15181                         symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 15182                         break;
       
 15183                         
       
 15184                     }
       
 15185                     
       
 15186                     
       
 15187                     ERROR;
       
 15188                 }
       
 15189                 
       
 15190             }
       
 15191             
       
 15192             
       
 15193             ERROR;
       
 15194         }
       
 15195         
       
 15196     }/*function_sub_tod_time*/
       
 15197     break;
       
 15198 
       
 15199 /****
       
 15200  *SUB_TOD_TOD
       
 15201  */
       
 15202     case function_sub_tod_tod :
       
 15203     {
       
 15204         symbol_c *last_type_symbol = NULL;
       
 15205 
       
 15206         {
       
 15207             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
       
 15208             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15209             symbol_c *IN1_param_value = &this->default_variable_name;
       
 15210         
       
 15211             symbol_c *IN1_type_symbol = param_data_type;
       
 15212             last_type_symbol = param_data_type;
       
 15213             
       
 15214             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
 15215             {
       
 15216         
       
 15217                 {
       
 15218                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
       
 15219                     /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15220                     symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name);
       
 15221                     symbol_c *IN2_type_symbol = NULL;
       
 15222                     
       
 15223                     /* Get the value from a foo(<param_value>) style call */
       
 15224                     if (IN2_param_value == NULL)
       
 15225                       IN2_param_value = function_call_param_iterator.next_nf();
       
 15226                     if (IN2_param_value != NULL) {
       
 15227                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
       
 15228                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
       
 15229                     }
       
 15230                     
       
 15231                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
 15232                     {
       
 15233                 
       
 15234                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
       
 15235                         
       
 15236                         if (IN1_type_symbol == NULL)
       
 15237                           IN1_type_symbol = last_type_symbol;
       
 15238                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 15239                         
       
 15240                         if (IN2_type_symbol == NULL)
       
 15241                           IN2_type_symbol = last_type_symbol;
       
 15242                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 15243                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 15244                         break;
       
 15245                         
       
 15246                     }
       
 15247                     
       
 15248                     
       
 15249                     ERROR;
       
 15250                 }
       
 15251                 
       
 15252             }
       
 15253             
       
 15254             
       
 15255             ERROR;
       
 15256         }
       
 15257         
       
 15258     }/*function_sub_tod_tod*/
       
 15259     break;
       
 15260 
       
 15261 /****
       
 15262  *SUB_DT_TIME
       
 15263  */
       
 15264     case function_sub_dt_time :
       
 15265     {
       
 15266         symbol_c *last_type_symbol = NULL;
       
 15267 
       
 15268         {
       
 15269             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
       
 15270             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15271             symbol_c *IN1_param_value = &this->default_variable_name;
       
 15272         
       
 15273             symbol_c *IN1_type_symbol = param_data_type;
       
 15274             last_type_symbol = param_data_type;
       
 15275             
       
 15276             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
 15277             {
       
 15278         
       
 15279                 {
       
 15280                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
       
 15281                     /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15282                     symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name);
       
 15283                     symbol_c *IN2_type_symbol = NULL;
       
 15284                     
       
 15285                     /* Get the value from a foo(<param_value>) style call */
       
 15286                     if (IN2_param_value == NULL)
       
 15287                       IN2_param_value = function_call_param_iterator.next_nf();
       
 15288                     if (IN2_param_value != NULL) {
       
 15289                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
       
 15290                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
       
 15291                     }
       
 15292                     
       
 15293                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
 15294                     {
       
 15295                 
       
 15296                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
       
 15297                         
       
 15298                         if (IN1_type_symbol == NULL)
       
 15299                           IN1_type_symbol = last_type_symbol;
       
 15300                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 15301                         
       
 15302                         if (IN2_type_symbol == NULL)
       
 15303                           IN2_type_symbol = last_type_symbol;
       
 15304                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 15305                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 15306                         break;
       
 15307                         
       
 15308                     }
       
 15309                     
       
 15310                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 15311                     {
       
 15312                 
       
 15313                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
       
 15314                         
       
 15315                         if (IN1_type_symbol == NULL)
       
 15316                           IN1_type_symbol = last_type_symbol;
       
 15317                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 15318                         
       
 15319                         if (IN2_type_symbol == NULL)
       
 15320                           IN2_type_symbol = last_type_symbol;
       
 15321                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 15322                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 15323                         break;
       
 15324                         
       
 15325                     }
       
 15326                     
       
 15327                     
       
 15328                     ERROR;
       
 15329                 }
       
 15330                 
       
 15331             }
       
 15332             
       
 15333             
       
 15334             ERROR;
       
 15335         }
       
 15336         
       
 15337     }/*function_sub_dt_time*/
       
 15338     break;
       
 15339 
       
 15340 /****
       
 15341  *DIV
       
 15342  */
       
 15343     case function_div :
       
 15344     {
       
 15345         symbol_c *last_type_symbol = NULL;
       
 15346 
       
 15347         {
       
 15348             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
       
 15349             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15350             symbol_c *IN1_param_value = &this->default_variable_name;
       
 15351         
       
 15352             symbol_c *IN1_type_symbol = param_data_type;
       
 15353             last_type_symbol = param_data_type;
       
 15354             
       
 15355             if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
       
 15356             {
       
 15357         
       
 15358                 {
       
 15359                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
       
 15360                     /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15361                     symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name);
       
 15362                     symbol_c *IN2_type_symbol = NULL;
       
 15363                     
       
 15364                     /* Get the value from a foo(<param_value>) style call */
       
 15365                     if (IN2_param_value == NULL)
       
 15366                       IN2_param_value = function_call_param_iterator.next_nf();
       
 15367                     if (IN2_param_value != NULL) {
       
 15368                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
       
 15369                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
       
 15370                     }
       
 15371                     
       
 15372                     if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
       
 15373                     {
       
 15374                 
       
 15375                         function_name = (symbol_c*)(new pragma_c("__div_"));
       
 15376                         
       
 15377                         if (IN1_type_symbol == NULL)
       
 15378                           IN1_type_symbol = last_type_symbol;
       
 15379                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 15380                         
       
 15381                         if (IN2_type_symbol == NULL)
       
 15382                           IN2_type_symbol = last_type_symbol;
       
 15383                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 15384                         symbol_c * return_type_symbol = last_type_symbol;
       
 15385                         function_type_suffix = return_type_symbol;
       
 15386                         break;
       
 15387                         
       
 15388                     }
       
 15389                     
       
 15390                     
       
 15391                     ERROR;
       
 15392                 }
       
 15393                 
       
 15394             }
       
 15395             
       
 15396             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 15397             {
       
 15398         
       
 15399                 {
       
 15400                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
       
 15401                     /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15402                     symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name);
       
 15403                     symbol_c *IN2_type_symbol = NULL;
       
 15404                     
       
 15405                     /* Get the value from a foo(<param_value>) style call */
       
 15406                     if (IN2_param_value == NULL)
       
 15407                       IN2_param_value = function_call_param_iterator.next_nf();
       
 15408                     if (IN2_param_value != NULL) {
       
 15409                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
       
 15410                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
       
 15411                     }
       
 15412                     
 14840                     if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
 15413                     if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
 14841                     {
 15414                     {
 14842                 
 15415                 
 14843                         function_name = (symbol_c*)(new pragma_c("__time_div"));
 15416                         function_name = (symbol_c*)(new pragma_c("__time_div"));
 14844                         
 15417                         
 14865             
 15438             
 14866             ERROR;
 15439             ERROR;
 14867         }
 15440         }
 14868         
 15441         
 14869     }/*function_div*/
 15442     }/*function_div*/
       
 15443     break;
       
 15444 
       
 15445 /****
       
 15446  *DIVTIME
       
 15447  */
       
 15448     case function_divtime :
       
 15449     {
       
 15450         symbol_c *last_type_symbol = NULL;
       
 15451 
       
 15452         {
       
 15453             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
       
 15454             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15455             symbol_c *IN1_param_value = &this->default_variable_name;
       
 15456         
       
 15457             symbol_c *IN1_type_symbol = param_data_type;
       
 15458             last_type_symbol = param_data_type;
       
 15459             
       
 15460             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 15461             {
       
 15462         
       
 15463                 {
       
 15464                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
       
 15465                     /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15466                     symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name);
       
 15467                     symbol_c *IN2_type_symbol = NULL;
       
 15468                     
       
 15469                     /* Get the value from a foo(<param_value>) style call */
       
 15470                     if (IN2_param_value == NULL)
       
 15471                       IN2_param_value = function_call_param_iterator.next_nf();
       
 15472                     if (IN2_param_value != NULL) {
       
 15473                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
       
 15474                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
       
 15475                     }
       
 15476                     
       
 15477                     if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
       
 15478                     {
       
 15479                 
       
 15480                         function_name = (symbol_c*)(new pragma_c("__time_div"));
       
 15481                         
       
 15482                         if (IN1_type_symbol == NULL)
       
 15483                           IN1_type_symbol = last_type_symbol;
       
 15484                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 15485                         
       
 15486                         if (IN2_type_symbol == NULL)
       
 15487                           IN2_type_symbol = last_type_symbol;
       
 15488                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 15489                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 15490                         if (search_expression_type->is_literal_integer_type(function_type_suffix))
       
 15491                             function_type_suffix = &search_constant_type_c::lint_type_name;
       
 15492                         break;
       
 15493                         
       
 15494                     }
       
 15495                     
       
 15496                     
       
 15497                     ERROR;
       
 15498                 }
       
 15499                 
       
 15500             }
       
 15501             
       
 15502             
       
 15503             ERROR;
       
 15504         }
       
 15505         
       
 15506     }/*function_divtime*/
 14870     break;
 15507     break;
 14871 
 15508 
 14872 /****
 15509 /****
 14873  *MOD
 15510  *MOD
 14874  */
 15511  */
 16925             symbol_c *IN1_param_value = &this->default_variable_name;
 17562             symbol_c *IN1_param_value = &this->default_variable_name;
 16926         
 17563         
 16927             symbol_c *IN1_type_symbol = param_data_type;
 17564             symbol_c *IN1_type_symbol = param_data_type;
 16928             last_type_symbol = param_data_type;
 17565             last_type_symbol = param_data_type;
 16929             
 17566             
 16930             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
 16931             {
       
 16932         
       
 16933                 {
       
 16934                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
       
 16935                     /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 16936                     symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name);
       
 16937                     symbol_c *IN2_type_symbol = NULL;
       
 16938                     
       
 16939                     /* Get the value from a foo(<param_value>) style call */
       
 16940                     if (IN2_param_value == NULL)
       
 16941                       IN2_param_value = function_call_param_iterator.next_nf();
       
 16942                     if (IN2_param_value != NULL) {
       
 16943                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
       
 16944                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
       
 16945                     }
       
 16946                     
       
 16947                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
 16948                     {
       
 16949                 
       
 16950                         function_name = (symbol_c*)(new pragma_c("__time_add"));
       
 16951                         
       
 16952                         if (IN1_type_symbol == NULL)
       
 16953                           IN1_type_symbol = last_type_symbol;
       
 16954                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 16955                         
       
 16956                         if (IN2_type_symbol == NULL)
       
 16957                           IN2_type_symbol = last_type_symbol;
       
 16958                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 16959                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 16960                         break;
       
 16961                         
       
 16962                     }
       
 16963                     
       
 16964                     
       
 16965                     ERROR;
       
 16966                 }
       
 16967                 
       
 16968             }
       
 16969             
       
 16970             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
 17567             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
 16971             {
 17568             {
 16972         
 17569         
 16973                 {
 17570                 {
 16974                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
 17571                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
 17041             
 17638             
 17042             ERROR;
 17639             ERROR;
 17043         }
 17640         }
 17044         
 17641         
 17045     }/*function_concat*/
 17642     }/*function_concat*/
       
 17643     break;
       
 17644 
       
 17645 /****
       
 17646  *CONCAT_DAT_TOD
       
 17647  */
       
 17648     case function_concat_dat_tod :
       
 17649     {
       
 17650         symbol_c *last_type_symbol = NULL;
       
 17651 
       
 17652         {
       
 17653             symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1"));
       
 17654             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 17655             symbol_c *IN1_param_value = &this->default_variable_name;
       
 17656         
       
 17657             symbol_c *IN1_type_symbol = param_data_type;
       
 17658             last_type_symbol = param_data_type;
       
 17659             
       
 17660             if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
 17661             {
       
 17662         
       
 17663                 {
       
 17664                     symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2"));
       
 17665                     /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 17666                     symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name);
       
 17667                     symbol_c *IN2_type_symbol = NULL;
       
 17668                     
       
 17669                     /* Get the value from a foo(<param_value>) style call */
       
 17670                     if (IN2_param_value == NULL)
       
 17671                       IN2_param_value = function_call_param_iterator.next_nf();
       
 17672                     if (IN2_param_value != NULL) {
       
 17673                       IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
       
 17674                       last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
       
 17675                     }
       
 17676                     
       
 17677                     if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
 17678                     {
       
 17679                 
       
 17680                         function_name = (symbol_c*)(new pragma_c("__time_add"));
       
 17681                         
       
 17682                         if (IN1_type_symbol == NULL)
       
 17683                           IN1_type_symbol = last_type_symbol;
       
 17684                         ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 17685                         
       
 17686                         if (IN2_type_symbol == NULL)
       
 17687                           IN2_type_symbol = last_type_symbol;
       
 17688                         ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 17689                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 17690                         break;
       
 17691                         
       
 17692                     }
       
 17693                     
       
 17694                     
       
 17695                     ERROR;
       
 17696                 }
       
 17697                 
       
 17698             }
       
 17699             
       
 17700             
       
 17701             ERROR;
       
 17702         }
       
 17703         
       
 17704     }/*function_concat_dat_tod*/
 17046     break;
 17705     break;
 17047 
 17706 
 17048 /****
 17707 /****
 17049  *INSERT
 17708  *INSERT
 17050  */
 17709  */