stage4/generate_c/st_code_gen.c
changeset 149 05ca171a3d57
parent 70 e1f0ebd2d9ec
child 153 6aed920024f9
equal deleted inserted replaced
148:912bdab1eca8 149:05ca171a3d57
     1 /*
     1 /*
     2  * (c) 2003 Mario de Sousa
     2  * (c) 2008 Edouard TISSERANT
     3  *
     3  *
     4  * Offered to the public under the terms of the GNU General Public License
     4  * Offered to the public under the terms of the GNU General Public License
     5  * as published by the Free Software Foundation; either version 2 of the
     5  * as published by the Free Software Foundation; either version 2 of the
     6  * License, or (at your option) any later version.
     6  * License, or (at your option) any later version.
     7  *
     7  *
    19  *
    19  *
    20  * Based on the
    20  * Based on the
    21  * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
    21  * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
    22  *
    22  *
    23  */
    23  */
       
    24 
       
    25 /****
       
    26  * IEC 61131-3 standard function library
       
    27  * generated code, do not edit by hand
       
    28  */
    24  
    29  
    25  
    30  
    26 /****
       
    27  * IEC 61131-3 standard function lib
       
    28  * generated code, do not edit by hand
       
    29  */
       
    30 switch(current_function_type){
    31 switch(current_function_type){
    31 
    32 
    32 /****
    33 /****
       
    34  *REAL_TO_SINT
       
    35  */
       
    36     case function_real_to_sint :
       
    37     {
       
    38         symbol_c *last_type_symbol = NULL;
       
    39 
       
    40         {
       
    41             identifier_c param_name("IN");
       
    42             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
    43             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
    44             
       
    45             /* Get the value from a foo(<param_value>) style call */
       
    46             if (IN_param_value == NULL)
       
    47               IN_param_value = function_call_param_iterator.next();
       
    48             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
    49             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
    50             
       
    51             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
    52             {
       
    53         
       
    54                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
    55                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
    56                 function_type_prefix = return_type_symbol;
       
    57                 break;
       
    58                 
       
    59             }
       
    60             
       
    61             
       
    62             ERROR;
       
    63         }
       
    64         
       
    65     }/*function_real_to_sint*/
       
    66     break;
       
    67 
       
    68 /****
       
    69  *REAL_TO_LINT
       
    70  */
       
    71     case function_real_to_lint :
       
    72     {
       
    73         symbol_c *last_type_symbol = NULL;
       
    74 
       
    75         {
       
    76             identifier_c param_name("IN");
       
    77             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
    78             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
    79             
       
    80             /* Get the value from a foo(<param_value>) style call */
       
    81             if (IN_param_value == NULL)
       
    82               IN_param_value = function_call_param_iterator.next();
       
    83             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
    84             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
    85             
       
    86             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
    87             {
       
    88         
       
    89                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
    90                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
    91                 function_type_prefix = return_type_symbol;
       
    92                 break;
       
    93                 
       
    94             }
       
    95             
       
    96             
       
    97             ERROR;
       
    98         }
       
    99         
       
   100     }/*function_real_to_lint*/
       
   101     break;
       
   102 
       
   103 /****
       
   104  *REAL_TO_DINT
       
   105  */
       
   106     case function_real_to_dint :
       
   107     {
       
   108         symbol_c *last_type_symbol = NULL;
       
   109 
       
   110         {
       
   111             identifier_c param_name("IN");
       
   112             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   113             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   114             
       
   115             /* Get the value from a foo(<param_value>) style call */
       
   116             if (IN_param_value == NULL)
       
   117               IN_param_value = function_call_param_iterator.next();
       
   118             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   119             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   120             
       
   121             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   122             {
       
   123         
       
   124                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   125                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
   126                 function_type_prefix = return_type_symbol;
       
   127                 break;
       
   128                 
       
   129             }
       
   130             
       
   131             
       
   132             ERROR;
       
   133         }
       
   134         
       
   135     }/*function_real_to_dint*/
       
   136     break;
       
   137 
       
   138 /****
       
   139  *REAL_TO_DATE
       
   140  */
       
   141     case function_real_to_date :
       
   142     {
       
   143         symbol_c *last_type_symbol = NULL;
       
   144 
       
   145         {
       
   146             identifier_c param_name("IN");
       
   147             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   148             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   149             
       
   150             /* Get the value from a foo(<param_value>) style call */
       
   151             if (IN_param_value == NULL)
       
   152               IN_param_value = function_call_param_iterator.next();
       
   153             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   154             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   155             
       
   156             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   157             {
       
   158         
       
   159                 function_name = (symbol_c*)(new pragma_c("__real_to_time"));
       
   160                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   161                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
   162                 function_type_prefix = return_type_symbol;
       
   163                 break;
       
   164                 
       
   165             }
       
   166             
       
   167             
       
   168             ERROR;
       
   169         }
       
   170         
       
   171     }/*function_real_to_date*/
       
   172     break;
       
   173 
       
   174 /****
       
   175  *REAL_TO_DWORD
       
   176  */
       
   177     case function_real_to_dword :
       
   178     {
       
   179         symbol_c *last_type_symbol = NULL;
       
   180 
       
   181         {
       
   182             identifier_c param_name("IN");
       
   183             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   184             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   185             
       
   186             /* Get the value from a foo(<param_value>) style call */
       
   187             if (IN_param_value == NULL)
       
   188               IN_param_value = function_call_param_iterator.next();
       
   189             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   190             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   191             
       
   192             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   193             {
       
   194         
       
   195                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   196                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
   197                 function_type_prefix = return_type_symbol;
       
   198                 break;
       
   199                 
       
   200             }
       
   201             
       
   202             
       
   203             ERROR;
       
   204         }
       
   205         
       
   206     }/*function_real_to_dword*/
       
   207     break;
       
   208 
       
   209 /****
       
   210  *REAL_TO_DT
       
   211  */
       
   212     case function_real_to_dt :
       
   213     {
       
   214         symbol_c *last_type_symbol = NULL;
       
   215 
       
   216         {
       
   217             identifier_c param_name("IN");
       
   218             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   219             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   220             
       
   221             /* Get the value from a foo(<param_value>) style call */
       
   222             if (IN_param_value == NULL)
       
   223               IN_param_value = function_call_param_iterator.next();
       
   224             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   225             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   226             
       
   227             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   228             {
       
   229         
       
   230                 function_name = (symbol_c*)(new pragma_c("__real_to_time"));
       
   231                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   232                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
   233                 function_type_prefix = return_type_symbol;
       
   234                 break;
       
   235                 
       
   236             }
       
   237             
       
   238             
       
   239             ERROR;
       
   240         }
       
   241         
       
   242     }/*function_real_to_dt*/
       
   243     break;
       
   244 
       
   245 /****
       
   246  *REAL_TO_TOD
       
   247  */
       
   248     case function_real_to_tod :
       
   249     {
       
   250         symbol_c *last_type_symbol = NULL;
       
   251 
       
   252         {
       
   253             identifier_c param_name("IN");
       
   254             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   255             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   256             
       
   257             /* Get the value from a foo(<param_value>) style call */
       
   258             if (IN_param_value == NULL)
       
   259               IN_param_value = function_call_param_iterator.next();
       
   260             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   261             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   262             
       
   263             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   264             {
       
   265         
       
   266                 function_name = (symbol_c*)(new pragma_c("__real_to_time"));
       
   267                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   268                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
   269                 function_type_prefix = return_type_symbol;
       
   270                 break;
       
   271                 
       
   272             }
       
   273             
       
   274             
       
   275             ERROR;
       
   276         }
       
   277         
       
   278     }/*function_real_to_tod*/
       
   279     break;
       
   280 
       
   281 /****
       
   282  *REAL_TO_UDINT
       
   283  */
       
   284     case function_real_to_udint :
       
   285     {
       
   286         symbol_c *last_type_symbol = NULL;
       
   287 
       
   288         {
       
   289             identifier_c param_name("IN");
       
   290             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   291             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   292             
       
   293             /* Get the value from a foo(<param_value>) style call */
       
   294             if (IN_param_value == NULL)
       
   295               IN_param_value = function_call_param_iterator.next();
       
   296             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   297             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   298             
       
   299             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   300             {
       
   301         
       
   302                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   303                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
   304                 function_type_prefix = return_type_symbol;
       
   305                 break;
       
   306                 
       
   307             }
       
   308             
       
   309             
       
   310             ERROR;
       
   311         }
       
   312         
       
   313     }/*function_real_to_udint*/
       
   314     break;
       
   315 
       
   316 /****
       
   317  *REAL_TO_WORD
       
   318  */
       
   319     case function_real_to_word :
       
   320     {
       
   321         symbol_c *last_type_symbol = NULL;
       
   322 
       
   323         {
       
   324             identifier_c param_name("IN");
       
   325             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   326             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   327             
       
   328             /* Get the value from a foo(<param_value>) style call */
       
   329             if (IN_param_value == NULL)
       
   330               IN_param_value = function_call_param_iterator.next();
       
   331             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   332             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   333             
       
   334             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   335             {
       
   336         
       
   337                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   338                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
   339                 function_type_prefix = return_type_symbol;
       
   340                 break;
       
   341                 
       
   342             }
       
   343             
       
   344             
       
   345             ERROR;
       
   346         }
       
   347         
       
   348     }/*function_real_to_word*/
       
   349     break;
       
   350 
       
   351 /****
       
   352  *REAL_TO_STRING
       
   353  */
       
   354     case function_real_to_string :
       
   355     {
       
   356         symbol_c *last_type_symbol = NULL;
       
   357 
       
   358         {
       
   359             identifier_c param_name("IN");
       
   360             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   361             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   362             
       
   363             /* Get the value from a foo(<param_value>) style call */
       
   364             if (IN_param_value == NULL)
       
   365               IN_param_value = function_call_param_iterator.next();
       
   366             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   367             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   368             
       
   369             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   370             {
       
   371         
       
   372                 function_name = (symbol_c*)(new pragma_c("__real_to_string"));
       
   373                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   374                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
   375                 function_type_prefix = return_type_symbol;
       
   376                 break;
       
   377                 
       
   378             }
       
   379             
       
   380             
       
   381             ERROR;
       
   382         }
       
   383         
       
   384     }/*function_real_to_string*/
       
   385     break;
       
   386 
       
   387 /****
       
   388  *REAL_TO_LWORD
       
   389  */
       
   390     case function_real_to_lword :
       
   391     {
       
   392         symbol_c *last_type_symbol = NULL;
       
   393 
       
   394         {
       
   395             identifier_c param_name("IN");
       
   396             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   397             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   398             
       
   399             /* Get the value from a foo(<param_value>) style call */
       
   400             if (IN_param_value == NULL)
       
   401               IN_param_value = function_call_param_iterator.next();
       
   402             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   403             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   404             
       
   405             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   406             {
       
   407         
       
   408                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   409                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
   410                 function_type_prefix = return_type_symbol;
       
   411                 break;
       
   412                 
       
   413             }
       
   414             
       
   415             
       
   416             ERROR;
       
   417         }
       
   418         
       
   419     }/*function_real_to_lword*/
       
   420     break;
       
   421 
       
   422 /****
       
   423  *REAL_TO_UINT
       
   424  */
       
   425     case function_real_to_uint :
       
   426     {
       
   427         symbol_c *last_type_symbol = NULL;
       
   428 
       
   429         {
       
   430             identifier_c param_name("IN");
       
   431             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   432             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   433             
       
   434             /* Get the value from a foo(<param_value>) style call */
       
   435             if (IN_param_value == NULL)
       
   436               IN_param_value = function_call_param_iterator.next();
       
   437             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   438             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   439             
       
   440             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   441             {
       
   442         
       
   443                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   444                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
   445                 function_type_prefix = return_type_symbol;
       
   446                 break;
       
   447                 
       
   448             }
       
   449             
       
   450             
       
   451             ERROR;
       
   452         }
       
   453         
       
   454     }/*function_real_to_uint*/
       
   455     break;
       
   456 
       
   457 /****
       
   458  *REAL_TO_LREAL
       
   459  */
       
   460     case function_real_to_lreal :
       
   461     {
       
   462         symbol_c *last_type_symbol = NULL;
       
   463 
       
   464         {
       
   465             identifier_c param_name("IN");
       
   466             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   467             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   468             
       
   469             /* Get the value from a foo(<param_value>) style call */
       
   470             if (IN_param_value == NULL)
       
   471               IN_param_value = function_call_param_iterator.next();
       
   472             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   473             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   474             
       
   475             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   476             {
       
   477         
       
   478                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   479                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
   480                 function_type_prefix = return_type_symbol;
       
   481                 break;
       
   482                 
       
   483             }
       
   484             
       
   485             
       
   486             ERROR;
       
   487         }
       
   488         
       
   489     }/*function_real_to_lreal*/
       
   490     break;
       
   491 
       
   492 /****
       
   493  *REAL_TO_BYTE
       
   494  */
       
   495     case function_real_to_byte :
       
   496     {
       
   497         symbol_c *last_type_symbol = NULL;
       
   498 
       
   499         {
       
   500             identifier_c param_name("IN");
       
   501             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   502             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   503             
       
   504             /* Get the value from a foo(<param_value>) style call */
       
   505             if (IN_param_value == NULL)
       
   506               IN_param_value = function_call_param_iterator.next();
       
   507             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   508             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   509             
       
   510             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   511             {
       
   512         
       
   513                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   514                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
   515                 function_type_prefix = return_type_symbol;
       
   516                 break;
       
   517                 
       
   518             }
       
   519             
       
   520             
       
   521             ERROR;
       
   522         }
       
   523         
       
   524     }/*function_real_to_byte*/
       
   525     break;
       
   526 
       
   527 /****
       
   528  *REAL_TO_USINT
       
   529  */
       
   530     case function_real_to_usint :
       
   531     {
       
   532         symbol_c *last_type_symbol = NULL;
       
   533 
       
   534         {
       
   535             identifier_c param_name("IN");
       
   536             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   537             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   538             
       
   539             /* Get the value from a foo(<param_value>) style call */
       
   540             if (IN_param_value == NULL)
       
   541               IN_param_value = function_call_param_iterator.next();
       
   542             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   543             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   544             
       
   545             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   546             {
       
   547         
       
   548                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   549                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
   550                 function_type_prefix = return_type_symbol;
       
   551                 break;
       
   552                 
       
   553             }
       
   554             
       
   555             
       
   556             ERROR;
       
   557         }
       
   558         
       
   559     }/*function_real_to_usint*/
       
   560     break;
       
   561 
       
   562 /****
       
   563  *REAL_TO_ULINT
       
   564  */
       
   565     case function_real_to_ulint :
       
   566     {
       
   567         symbol_c *last_type_symbol = NULL;
       
   568 
       
   569         {
       
   570             identifier_c param_name("IN");
       
   571             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   572             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   573             
       
   574             /* Get the value from a foo(<param_value>) style call */
       
   575             if (IN_param_value == NULL)
       
   576               IN_param_value = function_call_param_iterator.next();
       
   577             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   578             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   579             
       
   580             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   581             {
       
   582         
       
   583                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   584                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
   585                 function_type_prefix = return_type_symbol;
       
   586                 break;
       
   587                 
       
   588             }
       
   589             
       
   590             
       
   591             ERROR;
       
   592         }
       
   593         
       
   594     }/*function_real_to_ulint*/
       
   595     break;
       
   596 
       
   597 /****
       
   598  *REAL_TO_BOOL
       
   599  */
       
   600     case function_real_to_bool :
       
   601     {
       
   602         symbol_c *last_type_symbol = NULL;
       
   603 
       
   604         {
       
   605             identifier_c param_name("IN");
       
   606             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   607             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   608             
       
   609             /* Get the value from a foo(<param_value>) style call */
       
   610             if (IN_param_value == NULL)
       
   611               IN_param_value = function_call_param_iterator.next();
       
   612             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   613             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   614             
       
   615             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   616             {
       
   617         
       
   618                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   619                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
   620                 function_type_prefix = return_type_symbol;
       
   621                 break;
       
   622                 
       
   623             }
       
   624             
       
   625             
       
   626             ERROR;
       
   627         }
       
   628         
       
   629     }/*function_real_to_bool*/
       
   630     break;
       
   631 
       
   632 /****
       
   633  *REAL_TO_TIME
       
   634  */
       
   635     case function_real_to_time :
       
   636     {
       
   637         symbol_c *last_type_symbol = NULL;
       
   638 
       
   639         {
       
   640             identifier_c param_name("IN");
       
   641             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   642             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   643             
       
   644             /* Get the value from a foo(<param_value>) style call */
       
   645             if (IN_param_value == NULL)
       
   646               IN_param_value = function_call_param_iterator.next();
       
   647             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   648             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   649             
       
   650             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   651             {
       
   652         
       
   653                 function_name = (symbol_c*)(new pragma_c("__real_to_time"));
       
   654                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   655                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
   656                 function_type_prefix = return_type_symbol;
       
   657                 break;
       
   658                 
       
   659             }
       
   660             
       
   661             
       
   662             ERROR;
       
   663         }
       
   664         
       
   665     }/*function_real_to_time*/
       
   666     break;
       
   667 
       
   668 /****
       
   669  *REAL_TO_INT
       
   670  */
       
   671     case function_real_to_int :
       
   672     {
       
   673         symbol_c *last_type_symbol = NULL;
       
   674 
       
   675         {
       
   676             identifier_c param_name("IN");
       
   677             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   678             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   679             
       
   680             /* Get the value from a foo(<param_value>) style call */
       
   681             if (IN_param_value == NULL)
       
   682               IN_param_value = function_call_param_iterator.next();
       
   683             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   684             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   685             
       
   686             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
   687             {
       
   688         
       
   689                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   690                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
   691                 function_type_prefix = return_type_symbol;
       
   692                 break;
       
   693                 
       
   694             }
       
   695             
       
   696             
       
   697             ERROR;
       
   698         }
       
   699         
       
   700     }/*function_real_to_int*/
       
   701     break;
       
   702 
       
   703 /****
       
   704  *SINT_TO_REAL
       
   705  */
       
   706     case function_sint_to_real :
       
   707     {
       
   708         symbol_c *last_type_symbol = NULL;
       
   709 
       
   710         {
       
   711             identifier_c param_name("IN");
       
   712             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   713             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   714             
       
   715             /* Get the value from a foo(<param_value>) style call */
       
   716             if (IN_param_value == NULL)
       
   717               IN_param_value = function_call_param_iterator.next();
       
   718             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   719             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   720             
       
   721             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   722             {
       
   723         
       
   724                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   725                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
   726                 function_type_prefix = return_type_symbol;
       
   727                 break;
       
   728                 
       
   729             }
       
   730             
       
   731             
       
   732             ERROR;
       
   733         }
       
   734         
       
   735     }/*function_sint_to_real*/
       
   736     break;
       
   737 
       
   738 /****
       
   739  *SINT_TO_LINT
       
   740  */
       
   741     case function_sint_to_lint :
       
   742     {
       
   743         symbol_c *last_type_symbol = NULL;
       
   744 
       
   745         {
       
   746             identifier_c param_name("IN");
       
   747             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   748             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   749             
       
   750             /* Get the value from a foo(<param_value>) style call */
       
   751             if (IN_param_value == NULL)
       
   752               IN_param_value = function_call_param_iterator.next();
       
   753             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   754             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   755             
       
   756             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   757             {
       
   758         
       
   759                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   760                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
   761                 function_type_prefix = return_type_symbol;
       
   762                 break;
       
   763                 
       
   764             }
       
   765             
       
   766             
       
   767             ERROR;
       
   768         }
       
   769         
       
   770     }/*function_sint_to_lint*/
       
   771     break;
       
   772 
       
   773 /****
       
   774  *SINT_TO_DINT
       
   775  */
       
   776     case function_sint_to_dint :
       
   777     {
       
   778         symbol_c *last_type_symbol = NULL;
       
   779 
       
   780         {
       
   781             identifier_c param_name("IN");
       
   782             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   783             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   784             
       
   785             /* Get the value from a foo(<param_value>) style call */
       
   786             if (IN_param_value == NULL)
       
   787               IN_param_value = function_call_param_iterator.next();
       
   788             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   789             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   790             
       
   791             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   792             {
       
   793         
       
   794                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   795                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
   796                 function_type_prefix = return_type_symbol;
       
   797                 break;
       
   798                 
       
   799             }
       
   800             
       
   801             
       
   802             ERROR;
       
   803         }
       
   804         
       
   805     }/*function_sint_to_dint*/
       
   806     break;
       
   807 
       
   808 /****
       
   809  *SINT_TO_DATE
       
   810  */
       
   811     case function_sint_to_date :
       
   812     {
       
   813         symbol_c *last_type_symbol = NULL;
       
   814 
       
   815         {
       
   816             identifier_c param_name("IN");
       
   817             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   818             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   819             
       
   820             /* Get the value from a foo(<param_value>) style call */
       
   821             if (IN_param_value == NULL)
       
   822               IN_param_value = function_call_param_iterator.next();
       
   823             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   824             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   825             
       
   826             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   827             {
       
   828         
       
   829                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
   830                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   831                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
   832                 function_type_prefix = return_type_symbol;
       
   833                 break;
       
   834                 
       
   835             }
       
   836             
       
   837             
       
   838             ERROR;
       
   839         }
       
   840         
       
   841     }/*function_sint_to_date*/
       
   842     break;
       
   843 
       
   844 /****
       
   845  *SINT_TO_DWORD
       
   846  */
       
   847     case function_sint_to_dword :
       
   848     {
       
   849         symbol_c *last_type_symbol = NULL;
       
   850 
       
   851         {
       
   852             identifier_c param_name("IN");
       
   853             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   854             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   855             
       
   856             /* Get the value from a foo(<param_value>) style call */
       
   857             if (IN_param_value == NULL)
       
   858               IN_param_value = function_call_param_iterator.next();
       
   859             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   860             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   861             
       
   862             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   863             {
       
   864         
       
   865                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   866                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
   867                 function_type_prefix = return_type_symbol;
       
   868                 break;
       
   869                 
       
   870             }
       
   871             
       
   872             
       
   873             ERROR;
       
   874         }
       
   875         
       
   876     }/*function_sint_to_dword*/
       
   877     break;
       
   878 
       
   879 /****
       
   880  *SINT_TO_DT
       
   881  */
       
   882     case function_sint_to_dt :
       
   883     {
       
   884         symbol_c *last_type_symbol = NULL;
       
   885 
       
   886         {
       
   887             identifier_c param_name("IN");
       
   888             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   889             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   890             
       
   891             /* Get the value from a foo(<param_value>) style call */
       
   892             if (IN_param_value == NULL)
       
   893               IN_param_value = function_call_param_iterator.next();
       
   894             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   895             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   896             
       
   897             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   898             {
       
   899         
       
   900                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
   901                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   902                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
   903                 function_type_prefix = return_type_symbol;
       
   904                 break;
       
   905                 
       
   906             }
       
   907             
       
   908             
       
   909             ERROR;
       
   910         }
       
   911         
       
   912     }/*function_sint_to_dt*/
       
   913     break;
       
   914 
       
   915 /****
       
   916  *SINT_TO_TOD
       
   917  */
       
   918     case function_sint_to_tod :
       
   919     {
       
   920         symbol_c *last_type_symbol = NULL;
       
   921 
       
   922         {
       
   923             identifier_c param_name("IN");
       
   924             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   925             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   926             
       
   927             /* Get the value from a foo(<param_value>) style call */
       
   928             if (IN_param_value == NULL)
       
   929               IN_param_value = function_call_param_iterator.next();
       
   930             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   931             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   932             
       
   933             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   934             {
       
   935         
       
   936                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
   937                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   938                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
   939                 function_type_prefix = return_type_symbol;
       
   940                 break;
       
   941                 
       
   942             }
       
   943             
       
   944             
       
   945             ERROR;
       
   946         }
       
   947         
       
   948     }/*function_sint_to_tod*/
       
   949     break;
       
   950 
       
   951 /****
       
   952  *SINT_TO_UDINT
       
   953  */
       
   954     case function_sint_to_udint :
       
   955     {
       
   956         symbol_c *last_type_symbol = NULL;
       
   957 
       
   958         {
       
   959             identifier_c param_name("IN");
       
   960             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   961             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   962             
       
   963             /* Get the value from a foo(<param_value>) style call */
       
   964             if (IN_param_value == NULL)
       
   965               IN_param_value = function_call_param_iterator.next();
       
   966             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   967             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   968             
       
   969             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   970             {
       
   971         
       
   972                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
   973                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
   974                 function_type_prefix = return_type_symbol;
       
   975                 break;
       
   976                 
       
   977             }
       
   978             
       
   979             
       
   980             ERROR;
       
   981         }
       
   982         
       
   983     }/*function_sint_to_udint*/
       
   984     break;
       
   985 
       
   986 /****
       
   987  *SINT_TO_WORD
       
   988  */
       
   989     case function_sint_to_word :
       
   990     {
       
   991         symbol_c *last_type_symbol = NULL;
       
   992 
       
   993         {
       
   994             identifier_c param_name("IN");
       
   995             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   996             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   997             
       
   998             /* Get the value from a foo(<param_value>) style call */
       
   999             if (IN_param_value == NULL)
       
  1000               IN_param_value = function_call_param_iterator.next();
       
  1001             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1002             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1003             
       
  1004             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1005             {
       
  1006         
       
  1007                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1008                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  1009                 function_type_prefix = return_type_symbol;
       
  1010                 break;
       
  1011                 
       
  1012             }
       
  1013             
       
  1014             
       
  1015             ERROR;
       
  1016         }
       
  1017         
       
  1018     }/*function_sint_to_word*/
       
  1019     break;
       
  1020 
       
  1021 /****
       
  1022  *SINT_TO_STRING
       
  1023  */
       
  1024     case function_sint_to_string :
       
  1025     {
       
  1026         symbol_c *last_type_symbol = NULL;
       
  1027 
       
  1028         {
       
  1029             identifier_c param_name("IN");
       
  1030             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1031             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1032             
       
  1033             /* Get the value from a foo(<param_value>) style call */
       
  1034             if (IN_param_value == NULL)
       
  1035               IN_param_value = function_call_param_iterator.next();
       
  1036             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1037             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1038             
       
  1039             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1040             {
       
  1041         
       
  1042                 function_name = (symbol_c*)(new pragma_c("__sint_to_string"));
       
  1043                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1044                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  1045                 function_type_prefix = return_type_symbol;
       
  1046                 break;
       
  1047                 
       
  1048             }
       
  1049             
       
  1050             
       
  1051             ERROR;
       
  1052         }
       
  1053         
       
  1054     }/*function_sint_to_string*/
       
  1055     break;
       
  1056 
       
  1057 /****
       
  1058  *SINT_TO_LWORD
       
  1059  */
       
  1060     case function_sint_to_lword :
       
  1061     {
       
  1062         symbol_c *last_type_symbol = NULL;
       
  1063 
       
  1064         {
       
  1065             identifier_c param_name("IN");
       
  1066             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1067             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1068             
       
  1069             /* Get the value from a foo(<param_value>) style call */
       
  1070             if (IN_param_value == NULL)
       
  1071               IN_param_value = function_call_param_iterator.next();
       
  1072             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1073             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1074             
       
  1075             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1076             {
       
  1077         
       
  1078                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1079                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  1080                 function_type_prefix = return_type_symbol;
       
  1081                 break;
       
  1082                 
       
  1083             }
       
  1084             
       
  1085             
       
  1086             ERROR;
       
  1087         }
       
  1088         
       
  1089     }/*function_sint_to_lword*/
       
  1090     break;
       
  1091 
       
  1092 /****
       
  1093  *SINT_TO_UINT
       
  1094  */
       
  1095     case function_sint_to_uint :
       
  1096     {
       
  1097         symbol_c *last_type_symbol = NULL;
       
  1098 
       
  1099         {
       
  1100             identifier_c param_name("IN");
       
  1101             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1102             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1103             
       
  1104             /* Get the value from a foo(<param_value>) style call */
       
  1105             if (IN_param_value == NULL)
       
  1106               IN_param_value = function_call_param_iterator.next();
       
  1107             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1108             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1109             
       
  1110             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1111             {
       
  1112         
       
  1113                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1114                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  1115                 function_type_prefix = return_type_symbol;
       
  1116                 break;
       
  1117                 
       
  1118             }
       
  1119             
       
  1120             
       
  1121             ERROR;
       
  1122         }
       
  1123         
       
  1124     }/*function_sint_to_uint*/
       
  1125     break;
       
  1126 
       
  1127 /****
       
  1128  *SINT_TO_LREAL
       
  1129  */
       
  1130     case function_sint_to_lreal :
       
  1131     {
       
  1132         symbol_c *last_type_symbol = NULL;
       
  1133 
       
  1134         {
       
  1135             identifier_c param_name("IN");
       
  1136             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1137             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1138             
       
  1139             /* Get the value from a foo(<param_value>) style call */
       
  1140             if (IN_param_value == NULL)
       
  1141               IN_param_value = function_call_param_iterator.next();
       
  1142             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1143             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1144             
       
  1145             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1146             {
       
  1147         
       
  1148                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1149                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  1150                 function_type_prefix = return_type_symbol;
       
  1151                 break;
       
  1152                 
       
  1153             }
       
  1154             
       
  1155             
       
  1156             ERROR;
       
  1157         }
       
  1158         
       
  1159     }/*function_sint_to_lreal*/
       
  1160     break;
       
  1161 
       
  1162 /****
       
  1163  *SINT_TO_BYTE
       
  1164  */
       
  1165     case function_sint_to_byte :
       
  1166     {
       
  1167         symbol_c *last_type_symbol = NULL;
       
  1168 
       
  1169         {
       
  1170             identifier_c param_name("IN");
       
  1171             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1172             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1173             
       
  1174             /* Get the value from a foo(<param_value>) style call */
       
  1175             if (IN_param_value == NULL)
       
  1176               IN_param_value = function_call_param_iterator.next();
       
  1177             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1178             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1179             
       
  1180             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1181             {
       
  1182         
       
  1183                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1184                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  1185                 function_type_prefix = return_type_symbol;
       
  1186                 break;
       
  1187                 
       
  1188             }
       
  1189             
       
  1190             
       
  1191             ERROR;
       
  1192         }
       
  1193         
       
  1194     }/*function_sint_to_byte*/
       
  1195     break;
       
  1196 
       
  1197 /****
       
  1198  *SINT_TO_USINT
       
  1199  */
       
  1200     case function_sint_to_usint :
       
  1201     {
       
  1202         symbol_c *last_type_symbol = NULL;
       
  1203 
       
  1204         {
       
  1205             identifier_c param_name("IN");
       
  1206             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1207             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1208             
       
  1209             /* Get the value from a foo(<param_value>) style call */
       
  1210             if (IN_param_value == NULL)
       
  1211               IN_param_value = function_call_param_iterator.next();
       
  1212             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1213             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1214             
       
  1215             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1216             {
       
  1217         
       
  1218                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1219                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  1220                 function_type_prefix = return_type_symbol;
       
  1221                 break;
       
  1222                 
       
  1223             }
       
  1224             
       
  1225             
       
  1226             ERROR;
       
  1227         }
       
  1228         
       
  1229     }/*function_sint_to_usint*/
       
  1230     break;
       
  1231 
       
  1232 /****
       
  1233  *SINT_TO_ULINT
       
  1234  */
       
  1235     case function_sint_to_ulint :
       
  1236     {
       
  1237         symbol_c *last_type_symbol = NULL;
       
  1238 
       
  1239         {
       
  1240             identifier_c param_name("IN");
       
  1241             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1242             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1243             
       
  1244             /* Get the value from a foo(<param_value>) style call */
       
  1245             if (IN_param_value == NULL)
       
  1246               IN_param_value = function_call_param_iterator.next();
       
  1247             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1248             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1249             
       
  1250             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1251             {
       
  1252         
       
  1253                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1254                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  1255                 function_type_prefix = return_type_symbol;
       
  1256                 break;
       
  1257                 
       
  1258             }
       
  1259             
       
  1260             
       
  1261             ERROR;
       
  1262         }
       
  1263         
       
  1264     }/*function_sint_to_ulint*/
       
  1265     break;
       
  1266 
       
  1267 /****
       
  1268  *SINT_TO_BOOL
       
  1269  */
       
  1270     case function_sint_to_bool :
       
  1271     {
       
  1272         symbol_c *last_type_symbol = NULL;
       
  1273 
       
  1274         {
       
  1275             identifier_c param_name("IN");
       
  1276             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1277             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1278             
       
  1279             /* Get the value from a foo(<param_value>) style call */
       
  1280             if (IN_param_value == NULL)
       
  1281               IN_param_value = function_call_param_iterator.next();
       
  1282             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1283             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1284             
       
  1285             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1286             {
       
  1287         
       
  1288                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1289                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  1290                 function_type_prefix = return_type_symbol;
       
  1291                 break;
       
  1292                 
       
  1293             }
       
  1294             
       
  1295             
       
  1296             ERROR;
       
  1297         }
       
  1298         
       
  1299     }/*function_sint_to_bool*/
       
  1300     break;
       
  1301 
       
  1302 /****
       
  1303  *SINT_TO_TIME
       
  1304  */
       
  1305     case function_sint_to_time :
       
  1306     {
       
  1307         symbol_c *last_type_symbol = NULL;
       
  1308 
       
  1309         {
       
  1310             identifier_c param_name("IN");
       
  1311             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1312             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1313             
       
  1314             /* Get the value from a foo(<param_value>) style call */
       
  1315             if (IN_param_value == NULL)
       
  1316               IN_param_value = function_call_param_iterator.next();
       
  1317             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1318             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1319             
       
  1320             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1321             {
       
  1322         
       
  1323                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  1324                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1325                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  1326                 function_type_prefix = return_type_symbol;
       
  1327                 break;
       
  1328                 
       
  1329             }
       
  1330             
       
  1331             
       
  1332             ERROR;
       
  1333         }
       
  1334         
       
  1335     }/*function_sint_to_time*/
       
  1336     break;
       
  1337 
       
  1338 /****
       
  1339  *SINT_TO_INT
       
  1340  */
       
  1341     case function_sint_to_int :
       
  1342     {
       
  1343         symbol_c *last_type_symbol = NULL;
       
  1344 
       
  1345         {
       
  1346             identifier_c param_name("IN");
       
  1347             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1348             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1349             
       
  1350             /* Get the value from a foo(<param_value>) style call */
       
  1351             if (IN_param_value == NULL)
       
  1352               IN_param_value = function_call_param_iterator.next();
       
  1353             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1354             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1355             
       
  1356             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1357             {
       
  1358         
       
  1359                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1360                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  1361                 function_type_prefix = return_type_symbol;
       
  1362                 break;
       
  1363                 
       
  1364             }
       
  1365             
       
  1366             
       
  1367             ERROR;
       
  1368         }
       
  1369         
       
  1370     }/*function_sint_to_int*/
       
  1371     break;
       
  1372 
       
  1373 /****
       
  1374  *LINT_TO_REAL
       
  1375  */
       
  1376     case function_lint_to_real :
       
  1377     {
       
  1378         symbol_c *last_type_symbol = NULL;
       
  1379 
       
  1380         {
       
  1381             identifier_c param_name("IN");
       
  1382             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1383             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1384             
       
  1385             /* Get the value from a foo(<param_value>) style call */
       
  1386             if (IN_param_value == NULL)
       
  1387               IN_param_value = function_call_param_iterator.next();
       
  1388             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1389             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1390             
       
  1391             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1392             {
       
  1393         
       
  1394                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1395                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  1396                 function_type_prefix = return_type_symbol;
       
  1397                 break;
       
  1398                 
       
  1399             }
       
  1400             
       
  1401             
       
  1402             ERROR;
       
  1403         }
       
  1404         
       
  1405     }/*function_lint_to_real*/
       
  1406     break;
       
  1407 
       
  1408 /****
       
  1409  *LINT_TO_SINT
       
  1410  */
       
  1411     case function_lint_to_sint :
       
  1412     {
       
  1413         symbol_c *last_type_symbol = NULL;
       
  1414 
       
  1415         {
       
  1416             identifier_c param_name("IN");
       
  1417             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1418             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1419             
       
  1420             /* Get the value from a foo(<param_value>) style call */
       
  1421             if (IN_param_value == NULL)
       
  1422               IN_param_value = function_call_param_iterator.next();
       
  1423             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1424             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1425             
       
  1426             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1427             {
       
  1428         
       
  1429                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1430                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  1431                 function_type_prefix = return_type_symbol;
       
  1432                 break;
       
  1433                 
       
  1434             }
       
  1435             
       
  1436             
       
  1437             ERROR;
       
  1438         }
       
  1439         
       
  1440     }/*function_lint_to_sint*/
       
  1441     break;
       
  1442 
       
  1443 /****
       
  1444  *LINT_TO_DINT
       
  1445  */
       
  1446     case function_lint_to_dint :
       
  1447     {
       
  1448         symbol_c *last_type_symbol = NULL;
       
  1449 
       
  1450         {
       
  1451             identifier_c param_name("IN");
       
  1452             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1453             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1454             
       
  1455             /* Get the value from a foo(<param_value>) style call */
       
  1456             if (IN_param_value == NULL)
       
  1457               IN_param_value = function_call_param_iterator.next();
       
  1458             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1459             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1460             
       
  1461             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1462             {
       
  1463         
       
  1464                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1465                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  1466                 function_type_prefix = return_type_symbol;
       
  1467                 break;
       
  1468                 
       
  1469             }
       
  1470             
       
  1471             
       
  1472             ERROR;
       
  1473         }
       
  1474         
       
  1475     }/*function_lint_to_dint*/
       
  1476     break;
       
  1477 
       
  1478 /****
       
  1479  *LINT_TO_DATE
       
  1480  */
       
  1481     case function_lint_to_date :
       
  1482     {
       
  1483         symbol_c *last_type_symbol = NULL;
       
  1484 
       
  1485         {
       
  1486             identifier_c param_name("IN");
       
  1487             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1488             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1489             
       
  1490             /* Get the value from a foo(<param_value>) style call */
       
  1491             if (IN_param_value == NULL)
       
  1492               IN_param_value = function_call_param_iterator.next();
       
  1493             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1494             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1495             
       
  1496             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1497             {
       
  1498         
       
  1499                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  1500                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1501                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  1502                 function_type_prefix = return_type_symbol;
       
  1503                 break;
       
  1504                 
       
  1505             }
       
  1506             
       
  1507             
       
  1508             ERROR;
       
  1509         }
       
  1510         
       
  1511     }/*function_lint_to_date*/
       
  1512     break;
       
  1513 
       
  1514 /****
       
  1515  *LINT_TO_DWORD
       
  1516  */
       
  1517     case function_lint_to_dword :
       
  1518     {
       
  1519         symbol_c *last_type_symbol = NULL;
       
  1520 
       
  1521         {
       
  1522             identifier_c param_name("IN");
       
  1523             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1524             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1525             
       
  1526             /* Get the value from a foo(<param_value>) style call */
       
  1527             if (IN_param_value == NULL)
       
  1528               IN_param_value = function_call_param_iterator.next();
       
  1529             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1530             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1531             
       
  1532             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1533             {
       
  1534         
       
  1535                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1536                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  1537                 function_type_prefix = return_type_symbol;
       
  1538                 break;
       
  1539                 
       
  1540             }
       
  1541             
       
  1542             
       
  1543             ERROR;
       
  1544         }
       
  1545         
       
  1546     }/*function_lint_to_dword*/
       
  1547     break;
       
  1548 
       
  1549 /****
       
  1550  *LINT_TO_DT
       
  1551  */
       
  1552     case function_lint_to_dt :
       
  1553     {
       
  1554         symbol_c *last_type_symbol = NULL;
       
  1555 
       
  1556         {
       
  1557             identifier_c param_name("IN");
       
  1558             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1559             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1560             
       
  1561             /* Get the value from a foo(<param_value>) style call */
       
  1562             if (IN_param_value == NULL)
       
  1563               IN_param_value = function_call_param_iterator.next();
       
  1564             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1565             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1566             
       
  1567             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1568             {
       
  1569         
       
  1570                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  1571                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1572                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  1573                 function_type_prefix = return_type_symbol;
       
  1574                 break;
       
  1575                 
       
  1576             }
       
  1577             
       
  1578             
       
  1579             ERROR;
       
  1580         }
       
  1581         
       
  1582     }/*function_lint_to_dt*/
       
  1583     break;
       
  1584 
       
  1585 /****
       
  1586  *LINT_TO_TOD
       
  1587  */
       
  1588     case function_lint_to_tod :
       
  1589     {
       
  1590         symbol_c *last_type_symbol = NULL;
       
  1591 
       
  1592         {
       
  1593             identifier_c param_name("IN");
       
  1594             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1595             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1596             
       
  1597             /* Get the value from a foo(<param_value>) style call */
       
  1598             if (IN_param_value == NULL)
       
  1599               IN_param_value = function_call_param_iterator.next();
       
  1600             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1601             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1602             
       
  1603             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1604             {
       
  1605         
       
  1606                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  1607                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1608                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  1609                 function_type_prefix = return_type_symbol;
       
  1610                 break;
       
  1611                 
       
  1612             }
       
  1613             
       
  1614             
       
  1615             ERROR;
       
  1616         }
       
  1617         
       
  1618     }/*function_lint_to_tod*/
       
  1619     break;
       
  1620 
       
  1621 /****
       
  1622  *LINT_TO_UDINT
       
  1623  */
       
  1624     case function_lint_to_udint :
       
  1625     {
       
  1626         symbol_c *last_type_symbol = NULL;
       
  1627 
       
  1628         {
       
  1629             identifier_c param_name("IN");
       
  1630             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1631             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1632             
       
  1633             /* Get the value from a foo(<param_value>) style call */
       
  1634             if (IN_param_value == NULL)
       
  1635               IN_param_value = function_call_param_iterator.next();
       
  1636             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1637             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1638             
       
  1639             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1640             {
       
  1641         
       
  1642                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1643                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  1644                 function_type_prefix = return_type_symbol;
       
  1645                 break;
       
  1646                 
       
  1647             }
       
  1648             
       
  1649             
       
  1650             ERROR;
       
  1651         }
       
  1652         
       
  1653     }/*function_lint_to_udint*/
       
  1654     break;
       
  1655 
       
  1656 /****
       
  1657  *LINT_TO_WORD
       
  1658  */
       
  1659     case function_lint_to_word :
       
  1660     {
       
  1661         symbol_c *last_type_symbol = NULL;
       
  1662 
       
  1663         {
       
  1664             identifier_c param_name("IN");
       
  1665             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1666             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1667             
       
  1668             /* Get the value from a foo(<param_value>) style call */
       
  1669             if (IN_param_value == NULL)
       
  1670               IN_param_value = function_call_param_iterator.next();
       
  1671             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1672             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1673             
       
  1674             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1675             {
       
  1676         
       
  1677                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1678                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  1679                 function_type_prefix = return_type_symbol;
       
  1680                 break;
       
  1681                 
       
  1682             }
       
  1683             
       
  1684             
       
  1685             ERROR;
       
  1686         }
       
  1687         
       
  1688     }/*function_lint_to_word*/
       
  1689     break;
       
  1690 
       
  1691 /****
       
  1692  *LINT_TO_STRING
       
  1693  */
       
  1694     case function_lint_to_string :
       
  1695     {
       
  1696         symbol_c *last_type_symbol = NULL;
       
  1697 
       
  1698         {
       
  1699             identifier_c param_name("IN");
       
  1700             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1701             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1702             
       
  1703             /* Get the value from a foo(<param_value>) style call */
       
  1704             if (IN_param_value == NULL)
       
  1705               IN_param_value = function_call_param_iterator.next();
       
  1706             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1707             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1708             
       
  1709             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1710             {
       
  1711         
       
  1712                 function_name = (symbol_c*)(new pragma_c("__sint_to_string"));
       
  1713                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1714                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  1715                 function_type_prefix = return_type_symbol;
       
  1716                 break;
       
  1717                 
       
  1718             }
       
  1719             
       
  1720             
       
  1721             ERROR;
       
  1722         }
       
  1723         
       
  1724     }/*function_lint_to_string*/
       
  1725     break;
       
  1726 
       
  1727 /****
       
  1728  *LINT_TO_LWORD
       
  1729  */
       
  1730     case function_lint_to_lword :
       
  1731     {
       
  1732         symbol_c *last_type_symbol = NULL;
       
  1733 
       
  1734         {
       
  1735             identifier_c param_name("IN");
       
  1736             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1737             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1738             
       
  1739             /* Get the value from a foo(<param_value>) style call */
       
  1740             if (IN_param_value == NULL)
       
  1741               IN_param_value = function_call_param_iterator.next();
       
  1742             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1743             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1744             
       
  1745             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1746             {
       
  1747         
       
  1748                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1749                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  1750                 function_type_prefix = return_type_symbol;
       
  1751                 break;
       
  1752                 
       
  1753             }
       
  1754             
       
  1755             
       
  1756             ERROR;
       
  1757         }
       
  1758         
       
  1759     }/*function_lint_to_lword*/
       
  1760     break;
       
  1761 
       
  1762 /****
       
  1763  *LINT_TO_UINT
       
  1764  */
       
  1765     case function_lint_to_uint :
       
  1766     {
       
  1767         symbol_c *last_type_symbol = NULL;
       
  1768 
       
  1769         {
       
  1770             identifier_c param_name("IN");
       
  1771             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1772             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1773             
       
  1774             /* Get the value from a foo(<param_value>) style call */
       
  1775             if (IN_param_value == NULL)
       
  1776               IN_param_value = function_call_param_iterator.next();
       
  1777             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1778             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1779             
       
  1780             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1781             {
       
  1782         
       
  1783                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1784                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  1785                 function_type_prefix = return_type_symbol;
       
  1786                 break;
       
  1787                 
       
  1788             }
       
  1789             
       
  1790             
       
  1791             ERROR;
       
  1792         }
       
  1793         
       
  1794     }/*function_lint_to_uint*/
       
  1795     break;
       
  1796 
       
  1797 /****
       
  1798  *LINT_TO_LREAL
       
  1799  */
       
  1800     case function_lint_to_lreal :
       
  1801     {
       
  1802         symbol_c *last_type_symbol = NULL;
       
  1803 
       
  1804         {
       
  1805             identifier_c param_name("IN");
       
  1806             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1807             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1808             
       
  1809             /* Get the value from a foo(<param_value>) style call */
       
  1810             if (IN_param_value == NULL)
       
  1811               IN_param_value = function_call_param_iterator.next();
       
  1812             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1813             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1814             
       
  1815             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1816             {
       
  1817         
       
  1818                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1819                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  1820                 function_type_prefix = return_type_symbol;
       
  1821                 break;
       
  1822                 
       
  1823             }
       
  1824             
       
  1825             
       
  1826             ERROR;
       
  1827         }
       
  1828         
       
  1829     }/*function_lint_to_lreal*/
       
  1830     break;
       
  1831 
       
  1832 /****
       
  1833  *LINT_TO_BYTE
       
  1834  */
       
  1835     case function_lint_to_byte :
       
  1836     {
       
  1837         symbol_c *last_type_symbol = NULL;
       
  1838 
       
  1839         {
       
  1840             identifier_c param_name("IN");
       
  1841             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1842             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1843             
       
  1844             /* Get the value from a foo(<param_value>) style call */
       
  1845             if (IN_param_value == NULL)
       
  1846               IN_param_value = function_call_param_iterator.next();
       
  1847             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1848             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1849             
       
  1850             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1851             {
       
  1852         
       
  1853                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1854                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  1855                 function_type_prefix = return_type_symbol;
       
  1856                 break;
       
  1857                 
       
  1858             }
       
  1859             
       
  1860             
       
  1861             ERROR;
       
  1862         }
       
  1863         
       
  1864     }/*function_lint_to_byte*/
       
  1865     break;
       
  1866 
       
  1867 /****
       
  1868  *LINT_TO_USINT
       
  1869  */
       
  1870     case function_lint_to_usint :
       
  1871     {
       
  1872         symbol_c *last_type_symbol = NULL;
       
  1873 
       
  1874         {
       
  1875             identifier_c param_name("IN");
       
  1876             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1877             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1878             
       
  1879             /* Get the value from a foo(<param_value>) style call */
       
  1880             if (IN_param_value == NULL)
       
  1881               IN_param_value = function_call_param_iterator.next();
       
  1882             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1883             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1884             
       
  1885             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1886             {
       
  1887         
       
  1888                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1889                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  1890                 function_type_prefix = return_type_symbol;
       
  1891                 break;
       
  1892                 
       
  1893             }
       
  1894             
       
  1895             
       
  1896             ERROR;
       
  1897         }
       
  1898         
       
  1899     }/*function_lint_to_usint*/
       
  1900     break;
       
  1901 
       
  1902 /****
       
  1903  *LINT_TO_ULINT
       
  1904  */
       
  1905     case function_lint_to_ulint :
       
  1906     {
       
  1907         symbol_c *last_type_symbol = NULL;
       
  1908 
       
  1909         {
       
  1910             identifier_c param_name("IN");
       
  1911             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1912             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1913             
       
  1914             /* Get the value from a foo(<param_value>) style call */
       
  1915             if (IN_param_value == NULL)
       
  1916               IN_param_value = function_call_param_iterator.next();
       
  1917             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1918             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1919             
       
  1920             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1921             {
       
  1922         
       
  1923                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1924                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  1925                 function_type_prefix = return_type_symbol;
       
  1926                 break;
       
  1927                 
       
  1928             }
       
  1929             
       
  1930             
       
  1931             ERROR;
       
  1932         }
       
  1933         
       
  1934     }/*function_lint_to_ulint*/
       
  1935     break;
       
  1936 
       
  1937 /****
       
  1938  *LINT_TO_BOOL
       
  1939  */
       
  1940     case function_lint_to_bool :
       
  1941     {
       
  1942         symbol_c *last_type_symbol = NULL;
       
  1943 
       
  1944         {
       
  1945             identifier_c param_name("IN");
       
  1946             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1947             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1948             
       
  1949             /* Get the value from a foo(<param_value>) style call */
       
  1950             if (IN_param_value == NULL)
       
  1951               IN_param_value = function_call_param_iterator.next();
       
  1952             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1953             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1954             
       
  1955             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1956             {
       
  1957         
       
  1958                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1959                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  1960                 function_type_prefix = return_type_symbol;
       
  1961                 break;
       
  1962                 
       
  1963             }
       
  1964             
       
  1965             
       
  1966             ERROR;
       
  1967         }
       
  1968         
       
  1969     }/*function_lint_to_bool*/
       
  1970     break;
       
  1971 
       
  1972 /****
       
  1973  *LINT_TO_TIME
       
  1974  */
       
  1975     case function_lint_to_time :
       
  1976     {
       
  1977         symbol_c *last_type_symbol = NULL;
       
  1978 
       
  1979         {
       
  1980             identifier_c param_name("IN");
       
  1981             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1982             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1983             
       
  1984             /* Get the value from a foo(<param_value>) style call */
       
  1985             if (IN_param_value == NULL)
       
  1986               IN_param_value = function_call_param_iterator.next();
       
  1987             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1988             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1989             
       
  1990             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  1991             {
       
  1992         
       
  1993                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  1994                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  1995                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  1996                 function_type_prefix = return_type_symbol;
       
  1997                 break;
       
  1998                 
       
  1999             }
       
  2000             
       
  2001             
       
  2002             ERROR;
       
  2003         }
       
  2004         
       
  2005     }/*function_lint_to_time*/
       
  2006     break;
       
  2007 
       
  2008 /****
       
  2009  *LINT_TO_INT
       
  2010  */
       
  2011     case function_lint_to_int :
       
  2012     {
       
  2013         symbol_c *last_type_symbol = NULL;
       
  2014 
       
  2015         {
       
  2016             identifier_c param_name("IN");
       
  2017             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2018             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2019             
       
  2020             /* Get the value from a foo(<param_value>) style call */
       
  2021             if (IN_param_value == NULL)
       
  2022               IN_param_value = function_call_param_iterator.next();
       
  2023             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2024             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2025             
       
  2026             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  2027             {
       
  2028         
       
  2029                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2030                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  2031                 function_type_prefix = return_type_symbol;
       
  2032                 break;
       
  2033                 
       
  2034             }
       
  2035             
       
  2036             
       
  2037             ERROR;
       
  2038         }
       
  2039         
       
  2040     }/*function_lint_to_int*/
       
  2041     break;
       
  2042 
       
  2043 /****
       
  2044  *DINT_TO_REAL
       
  2045  */
       
  2046     case function_dint_to_real :
       
  2047     {
       
  2048         symbol_c *last_type_symbol = NULL;
       
  2049 
       
  2050         {
       
  2051             identifier_c param_name("IN");
       
  2052             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2053             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2054             
       
  2055             /* Get the value from a foo(<param_value>) style call */
       
  2056             if (IN_param_value == NULL)
       
  2057               IN_param_value = function_call_param_iterator.next();
       
  2058             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2059             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2060             
       
  2061             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2062             {
       
  2063         
       
  2064                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2065                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  2066                 function_type_prefix = return_type_symbol;
       
  2067                 break;
       
  2068                 
       
  2069             }
       
  2070             
       
  2071             
       
  2072             ERROR;
       
  2073         }
       
  2074         
       
  2075     }/*function_dint_to_real*/
       
  2076     break;
       
  2077 
       
  2078 /****
       
  2079  *DINT_TO_SINT
       
  2080  */
       
  2081     case function_dint_to_sint :
       
  2082     {
       
  2083         symbol_c *last_type_symbol = NULL;
       
  2084 
       
  2085         {
       
  2086             identifier_c param_name("IN");
       
  2087             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2088             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2089             
       
  2090             /* Get the value from a foo(<param_value>) style call */
       
  2091             if (IN_param_value == NULL)
       
  2092               IN_param_value = function_call_param_iterator.next();
       
  2093             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2094             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2095             
       
  2096             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2097             {
       
  2098         
       
  2099                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2100                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  2101                 function_type_prefix = return_type_symbol;
       
  2102                 break;
       
  2103                 
       
  2104             }
       
  2105             
       
  2106             
       
  2107             ERROR;
       
  2108         }
       
  2109         
       
  2110     }/*function_dint_to_sint*/
       
  2111     break;
       
  2112 
       
  2113 /****
       
  2114  *DINT_TO_LINT
       
  2115  */
       
  2116     case function_dint_to_lint :
       
  2117     {
       
  2118         symbol_c *last_type_symbol = NULL;
       
  2119 
       
  2120         {
       
  2121             identifier_c param_name("IN");
       
  2122             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2123             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2124             
       
  2125             /* Get the value from a foo(<param_value>) style call */
       
  2126             if (IN_param_value == NULL)
       
  2127               IN_param_value = function_call_param_iterator.next();
       
  2128             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2129             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2130             
       
  2131             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2132             {
       
  2133         
       
  2134                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2135                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  2136                 function_type_prefix = return_type_symbol;
       
  2137                 break;
       
  2138                 
       
  2139             }
       
  2140             
       
  2141             
       
  2142             ERROR;
       
  2143         }
       
  2144         
       
  2145     }/*function_dint_to_lint*/
       
  2146     break;
       
  2147 
       
  2148 /****
       
  2149  *DINT_TO_DATE
       
  2150  */
       
  2151     case function_dint_to_date :
       
  2152     {
       
  2153         symbol_c *last_type_symbol = NULL;
       
  2154 
       
  2155         {
       
  2156             identifier_c param_name("IN");
       
  2157             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2158             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2159             
       
  2160             /* Get the value from a foo(<param_value>) style call */
       
  2161             if (IN_param_value == NULL)
       
  2162               IN_param_value = function_call_param_iterator.next();
       
  2163             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2164             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2165             
       
  2166             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2167             {
       
  2168         
       
  2169                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  2170                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2171                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  2172                 function_type_prefix = return_type_symbol;
       
  2173                 break;
       
  2174                 
       
  2175             }
       
  2176             
       
  2177             
       
  2178             ERROR;
       
  2179         }
       
  2180         
       
  2181     }/*function_dint_to_date*/
       
  2182     break;
       
  2183 
       
  2184 /****
       
  2185  *DINT_TO_DWORD
       
  2186  */
       
  2187     case function_dint_to_dword :
       
  2188     {
       
  2189         symbol_c *last_type_symbol = NULL;
       
  2190 
       
  2191         {
       
  2192             identifier_c param_name("IN");
       
  2193             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2194             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2195             
       
  2196             /* Get the value from a foo(<param_value>) style call */
       
  2197             if (IN_param_value == NULL)
       
  2198               IN_param_value = function_call_param_iterator.next();
       
  2199             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2200             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2201             
       
  2202             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2203             {
       
  2204         
       
  2205                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2206                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  2207                 function_type_prefix = return_type_symbol;
       
  2208                 break;
       
  2209                 
       
  2210             }
       
  2211             
       
  2212             
       
  2213             ERROR;
       
  2214         }
       
  2215         
       
  2216     }/*function_dint_to_dword*/
       
  2217     break;
       
  2218 
       
  2219 /****
       
  2220  *DINT_TO_DT
       
  2221  */
       
  2222     case function_dint_to_dt :
       
  2223     {
       
  2224         symbol_c *last_type_symbol = NULL;
       
  2225 
       
  2226         {
       
  2227             identifier_c param_name("IN");
       
  2228             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2229             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2230             
       
  2231             /* Get the value from a foo(<param_value>) style call */
       
  2232             if (IN_param_value == NULL)
       
  2233               IN_param_value = function_call_param_iterator.next();
       
  2234             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2235             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2236             
       
  2237             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2238             {
       
  2239         
       
  2240                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  2241                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2242                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  2243                 function_type_prefix = return_type_symbol;
       
  2244                 break;
       
  2245                 
       
  2246             }
       
  2247             
       
  2248             
       
  2249             ERROR;
       
  2250         }
       
  2251         
       
  2252     }/*function_dint_to_dt*/
       
  2253     break;
       
  2254 
       
  2255 /****
       
  2256  *DINT_TO_TOD
       
  2257  */
       
  2258     case function_dint_to_tod :
       
  2259     {
       
  2260         symbol_c *last_type_symbol = NULL;
       
  2261 
       
  2262         {
       
  2263             identifier_c param_name("IN");
       
  2264             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2265             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2266             
       
  2267             /* Get the value from a foo(<param_value>) style call */
       
  2268             if (IN_param_value == NULL)
       
  2269               IN_param_value = function_call_param_iterator.next();
       
  2270             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2271             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2272             
       
  2273             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2274             {
       
  2275         
       
  2276                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  2277                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2278                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  2279                 function_type_prefix = return_type_symbol;
       
  2280                 break;
       
  2281                 
       
  2282             }
       
  2283             
       
  2284             
       
  2285             ERROR;
       
  2286         }
       
  2287         
       
  2288     }/*function_dint_to_tod*/
       
  2289     break;
       
  2290 
       
  2291 /****
       
  2292  *DINT_TO_UDINT
       
  2293  */
       
  2294     case function_dint_to_udint :
       
  2295     {
       
  2296         symbol_c *last_type_symbol = NULL;
       
  2297 
       
  2298         {
       
  2299             identifier_c param_name("IN");
       
  2300             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2301             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2302             
       
  2303             /* Get the value from a foo(<param_value>) style call */
       
  2304             if (IN_param_value == NULL)
       
  2305               IN_param_value = function_call_param_iterator.next();
       
  2306             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2307             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2308             
       
  2309             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2310             {
       
  2311         
       
  2312                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2313                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  2314                 function_type_prefix = return_type_symbol;
       
  2315                 break;
       
  2316                 
       
  2317             }
       
  2318             
       
  2319             
       
  2320             ERROR;
       
  2321         }
       
  2322         
       
  2323     }/*function_dint_to_udint*/
       
  2324     break;
       
  2325 
       
  2326 /****
       
  2327  *DINT_TO_WORD
       
  2328  */
       
  2329     case function_dint_to_word :
       
  2330     {
       
  2331         symbol_c *last_type_symbol = NULL;
       
  2332 
       
  2333         {
       
  2334             identifier_c param_name("IN");
       
  2335             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2336             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2337             
       
  2338             /* Get the value from a foo(<param_value>) style call */
       
  2339             if (IN_param_value == NULL)
       
  2340               IN_param_value = function_call_param_iterator.next();
       
  2341             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2342             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2343             
       
  2344             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2345             {
       
  2346         
       
  2347                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2348                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  2349                 function_type_prefix = return_type_symbol;
       
  2350                 break;
       
  2351                 
       
  2352             }
       
  2353             
       
  2354             
       
  2355             ERROR;
       
  2356         }
       
  2357         
       
  2358     }/*function_dint_to_word*/
       
  2359     break;
       
  2360 
       
  2361 /****
       
  2362  *DINT_TO_STRING
       
  2363  */
       
  2364     case function_dint_to_string :
       
  2365     {
       
  2366         symbol_c *last_type_symbol = NULL;
       
  2367 
       
  2368         {
       
  2369             identifier_c param_name("IN");
       
  2370             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2371             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2372             
       
  2373             /* Get the value from a foo(<param_value>) style call */
       
  2374             if (IN_param_value == NULL)
       
  2375               IN_param_value = function_call_param_iterator.next();
       
  2376             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2377             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2378             
       
  2379             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2380             {
       
  2381         
       
  2382                 function_name = (symbol_c*)(new pragma_c("__sint_to_string"));
       
  2383                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2384                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  2385                 function_type_prefix = return_type_symbol;
       
  2386                 break;
       
  2387                 
       
  2388             }
       
  2389             
       
  2390             
       
  2391             ERROR;
       
  2392         }
       
  2393         
       
  2394     }/*function_dint_to_string*/
       
  2395     break;
       
  2396 
       
  2397 /****
       
  2398  *DINT_TO_LWORD
       
  2399  */
       
  2400     case function_dint_to_lword :
       
  2401     {
       
  2402         symbol_c *last_type_symbol = NULL;
       
  2403 
       
  2404         {
       
  2405             identifier_c param_name("IN");
       
  2406             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2407             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2408             
       
  2409             /* Get the value from a foo(<param_value>) style call */
       
  2410             if (IN_param_value == NULL)
       
  2411               IN_param_value = function_call_param_iterator.next();
       
  2412             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2413             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2414             
       
  2415             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2416             {
       
  2417         
       
  2418                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2419                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  2420                 function_type_prefix = return_type_symbol;
       
  2421                 break;
       
  2422                 
       
  2423             }
       
  2424             
       
  2425             
       
  2426             ERROR;
       
  2427         }
       
  2428         
       
  2429     }/*function_dint_to_lword*/
       
  2430     break;
       
  2431 
       
  2432 /****
       
  2433  *DINT_TO_UINT
       
  2434  */
       
  2435     case function_dint_to_uint :
       
  2436     {
       
  2437         symbol_c *last_type_symbol = NULL;
       
  2438 
       
  2439         {
       
  2440             identifier_c param_name("IN");
       
  2441             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2442             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2443             
       
  2444             /* Get the value from a foo(<param_value>) style call */
       
  2445             if (IN_param_value == NULL)
       
  2446               IN_param_value = function_call_param_iterator.next();
       
  2447             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2448             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2449             
       
  2450             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2451             {
       
  2452         
       
  2453                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2454                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  2455                 function_type_prefix = return_type_symbol;
       
  2456                 break;
       
  2457                 
       
  2458             }
       
  2459             
       
  2460             
       
  2461             ERROR;
       
  2462         }
       
  2463         
       
  2464     }/*function_dint_to_uint*/
       
  2465     break;
       
  2466 
       
  2467 /****
       
  2468  *DINT_TO_LREAL
       
  2469  */
       
  2470     case function_dint_to_lreal :
       
  2471     {
       
  2472         symbol_c *last_type_symbol = NULL;
       
  2473 
       
  2474         {
       
  2475             identifier_c param_name("IN");
       
  2476             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2477             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2478             
       
  2479             /* Get the value from a foo(<param_value>) style call */
       
  2480             if (IN_param_value == NULL)
       
  2481               IN_param_value = function_call_param_iterator.next();
       
  2482             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2483             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2484             
       
  2485             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2486             {
       
  2487         
       
  2488                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2489                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  2490                 function_type_prefix = return_type_symbol;
       
  2491                 break;
       
  2492                 
       
  2493             }
       
  2494             
       
  2495             
       
  2496             ERROR;
       
  2497         }
       
  2498         
       
  2499     }/*function_dint_to_lreal*/
       
  2500     break;
       
  2501 
       
  2502 /****
       
  2503  *DINT_TO_BYTE
       
  2504  */
       
  2505     case function_dint_to_byte :
       
  2506     {
       
  2507         symbol_c *last_type_symbol = NULL;
       
  2508 
       
  2509         {
       
  2510             identifier_c param_name("IN");
       
  2511             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2512             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2513             
       
  2514             /* Get the value from a foo(<param_value>) style call */
       
  2515             if (IN_param_value == NULL)
       
  2516               IN_param_value = function_call_param_iterator.next();
       
  2517             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2518             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2519             
       
  2520             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2521             {
       
  2522         
       
  2523                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2524                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  2525                 function_type_prefix = return_type_symbol;
       
  2526                 break;
       
  2527                 
       
  2528             }
       
  2529             
       
  2530             
       
  2531             ERROR;
       
  2532         }
       
  2533         
       
  2534     }/*function_dint_to_byte*/
       
  2535     break;
       
  2536 
       
  2537 /****
       
  2538  *DINT_TO_USINT
       
  2539  */
       
  2540     case function_dint_to_usint :
       
  2541     {
       
  2542         symbol_c *last_type_symbol = NULL;
       
  2543 
       
  2544         {
       
  2545             identifier_c param_name("IN");
       
  2546             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2547             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2548             
       
  2549             /* Get the value from a foo(<param_value>) style call */
       
  2550             if (IN_param_value == NULL)
       
  2551               IN_param_value = function_call_param_iterator.next();
       
  2552             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2553             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2554             
       
  2555             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2556             {
       
  2557         
       
  2558                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2559                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  2560                 function_type_prefix = return_type_symbol;
       
  2561                 break;
       
  2562                 
       
  2563             }
       
  2564             
       
  2565             
       
  2566             ERROR;
       
  2567         }
       
  2568         
       
  2569     }/*function_dint_to_usint*/
       
  2570     break;
       
  2571 
       
  2572 /****
       
  2573  *DINT_TO_ULINT
       
  2574  */
       
  2575     case function_dint_to_ulint :
       
  2576     {
       
  2577         symbol_c *last_type_symbol = NULL;
       
  2578 
       
  2579         {
       
  2580             identifier_c param_name("IN");
       
  2581             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2582             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2583             
       
  2584             /* Get the value from a foo(<param_value>) style call */
       
  2585             if (IN_param_value == NULL)
       
  2586               IN_param_value = function_call_param_iterator.next();
       
  2587             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2588             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2589             
       
  2590             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2591             {
       
  2592         
       
  2593                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2594                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  2595                 function_type_prefix = return_type_symbol;
       
  2596                 break;
       
  2597                 
       
  2598             }
       
  2599             
       
  2600             
       
  2601             ERROR;
       
  2602         }
       
  2603         
       
  2604     }/*function_dint_to_ulint*/
       
  2605     break;
       
  2606 
       
  2607 /****
       
  2608  *DINT_TO_BOOL
       
  2609  */
       
  2610     case function_dint_to_bool :
       
  2611     {
       
  2612         symbol_c *last_type_symbol = NULL;
       
  2613 
       
  2614         {
       
  2615             identifier_c param_name("IN");
       
  2616             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2617             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2618             
       
  2619             /* Get the value from a foo(<param_value>) style call */
       
  2620             if (IN_param_value == NULL)
       
  2621               IN_param_value = function_call_param_iterator.next();
       
  2622             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2623             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2624             
       
  2625             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2626             {
       
  2627         
       
  2628                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2629                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  2630                 function_type_prefix = return_type_symbol;
       
  2631                 break;
       
  2632                 
       
  2633             }
       
  2634             
       
  2635             
       
  2636             ERROR;
       
  2637         }
       
  2638         
       
  2639     }/*function_dint_to_bool*/
       
  2640     break;
       
  2641 
       
  2642 /****
       
  2643  *DINT_TO_TIME
       
  2644  */
       
  2645     case function_dint_to_time :
       
  2646     {
       
  2647         symbol_c *last_type_symbol = NULL;
       
  2648 
       
  2649         {
       
  2650             identifier_c param_name("IN");
       
  2651             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2652             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2653             
       
  2654             /* Get the value from a foo(<param_value>) style call */
       
  2655             if (IN_param_value == NULL)
       
  2656               IN_param_value = function_call_param_iterator.next();
       
  2657             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2658             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2659             
       
  2660             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2661             {
       
  2662         
       
  2663                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  2664                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2665                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  2666                 function_type_prefix = return_type_symbol;
       
  2667                 break;
       
  2668                 
       
  2669             }
       
  2670             
       
  2671             
       
  2672             ERROR;
       
  2673         }
       
  2674         
       
  2675     }/*function_dint_to_time*/
       
  2676     break;
       
  2677 
       
  2678 /****
       
  2679  *DINT_TO_INT
       
  2680  */
       
  2681     case function_dint_to_int :
       
  2682     {
       
  2683         symbol_c *last_type_symbol = NULL;
       
  2684 
       
  2685         {
       
  2686             identifier_c param_name("IN");
       
  2687             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2688             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2689             
       
  2690             /* Get the value from a foo(<param_value>) style call */
       
  2691             if (IN_param_value == NULL)
       
  2692               IN_param_value = function_call_param_iterator.next();
       
  2693             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2694             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2695             
       
  2696             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2697             {
       
  2698         
       
  2699                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2700                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  2701                 function_type_prefix = return_type_symbol;
       
  2702                 break;
       
  2703                 
       
  2704             }
       
  2705             
       
  2706             
       
  2707             ERROR;
       
  2708         }
       
  2709         
       
  2710     }/*function_dint_to_int*/
       
  2711     break;
       
  2712 
       
  2713 /****
       
  2714  *DATE_TO_REAL
       
  2715  */
       
  2716     case function_date_to_real :
       
  2717     {
       
  2718         symbol_c *last_type_symbol = NULL;
       
  2719 
       
  2720         {
       
  2721             identifier_c param_name("IN");
       
  2722             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2723             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2724             
       
  2725             /* Get the value from a foo(<param_value>) style call */
       
  2726             if (IN_param_value == NULL)
       
  2727               IN_param_value = function_call_param_iterator.next();
       
  2728             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2729             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2730             
       
  2731             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  2732             {
       
  2733         
       
  2734                 function_name = (symbol_c*)(new pragma_c("__time_to_real"));
       
  2735                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2736                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  2737                 function_type_prefix = return_type_symbol;
       
  2738                 break;
       
  2739                 
       
  2740             }
       
  2741             
       
  2742             
       
  2743             ERROR;
       
  2744         }
       
  2745         
       
  2746     }/*function_date_to_real*/
       
  2747     break;
       
  2748 
       
  2749 /****
       
  2750  *DATE_TO_SINT
       
  2751  */
       
  2752     case function_date_to_sint :
       
  2753     {
       
  2754         symbol_c *last_type_symbol = NULL;
       
  2755 
       
  2756         {
       
  2757             identifier_c param_name("IN");
       
  2758             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2759             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2760             
       
  2761             /* Get the value from a foo(<param_value>) style call */
       
  2762             if (IN_param_value == NULL)
       
  2763               IN_param_value = function_call_param_iterator.next();
       
  2764             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2765             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2766             
       
  2767             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  2768             {
       
  2769         
       
  2770                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  2771                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2772                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  2773                 function_type_prefix = return_type_symbol;
       
  2774                 break;
       
  2775                 
       
  2776             }
       
  2777             
       
  2778             
       
  2779             ERROR;
       
  2780         }
       
  2781         
       
  2782     }/*function_date_to_sint*/
       
  2783     break;
       
  2784 
       
  2785 /****
       
  2786  *DATE_TO_LINT
       
  2787  */
       
  2788     case function_date_to_lint :
       
  2789     {
       
  2790         symbol_c *last_type_symbol = NULL;
       
  2791 
       
  2792         {
       
  2793             identifier_c param_name("IN");
       
  2794             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2795             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2796             
       
  2797             /* Get the value from a foo(<param_value>) style call */
       
  2798             if (IN_param_value == NULL)
       
  2799               IN_param_value = function_call_param_iterator.next();
       
  2800             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2801             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2802             
       
  2803             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  2804             {
       
  2805         
       
  2806                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  2807                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2808                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  2809                 function_type_prefix = return_type_symbol;
       
  2810                 break;
       
  2811                 
       
  2812             }
       
  2813             
       
  2814             
       
  2815             ERROR;
       
  2816         }
       
  2817         
       
  2818     }/*function_date_to_lint*/
       
  2819     break;
       
  2820 
       
  2821 /****
       
  2822  *DATE_TO_DINT
       
  2823  */
       
  2824     case function_date_to_dint :
       
  2825     {
       
  2826         symbol_c *last_type_symbol = NULL;
       
  2827 
       
  2828         {
       
  2829             identifier_c param_name("IN");
       
  2830             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2831             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2832             
       
  2833             /* Get the value from a foo(<param_value>) style call */
       
  2834             if (IN_param_value == NULL)
       
  2835               IN_param_value = function_call_param_iterator.next();
       
  2836             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2837             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2838             
       
  2839             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  2840             {
       
  2841         
       
  2842                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  2843                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2844                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  2845                 function_type_prefix = return_type_symbol;
       
  2846                 break;
       
  2847                 
       
  2848             }
       
  2849             
       
  2850             
       
  2851             ERROR;
       
  2852         }
       
  2853         
       
  2854     }/*function_date_to_dint*/
       
  2855     break;
       
  2856 
       
  2857 /****
       
  2858  *DATE_TO_DWORD
       
  2859  */
       
  2860     case function_date_to_dword :
       
  2861     {
       
  2862         symbol_c *last_type_symbol = NULL;
       
  2863 
       
  2864         {
       
  2865             identifier_c param_name("IN");
       
  2866             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2867             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2868             
       
  2869             /* Get the value from a foo(<param_value>) style call */
       
  2870             if (IN_param_value == NULL)
       
  2871               IN_param_value = function_call_param_iterator.next();
       
  2872             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2873             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2874             
       
  2875             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  2876             {
       
  2877         
       
  2878                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  2879                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2880                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  2881                 function_type_prefix = return_type_symbol;
       
  2882                 break;
       
  2883                 
       
  2884             }
       
  2885             
       
  2886             
       
  2887             ERROR;
       
  2888         }
       
  2889         
       
  2890     }/*function_date_to_dword*/
       
  2891     break;
       
  2892 
       
  2893 /****
       
  2894  *DATE_TO_UDINT
       
  2895  */
       
  2896     case function_date_to_udint :
       
  2897     {
       
  2898         symbol_c *last_type_symbol = NULL;
       
  2899 
       
  2900         {
       
  2901             identifier_c param_name("IN");
       
  2902             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2903             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2904             
       
  2905             /* Get the value from a foo(<param_value>) style call */
       
  2906             if (IN_param_value == NULL)
       
  2907               IN_param_value = function_call_param_iterator.next();
       
  2908             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2909             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2910             
       
  2911             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  2912             {
       
  2913         
       
  2914                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  2915                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2916                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  2917                 function_type_prefix = return_type_symbol;
       
  2918                 break;
       
  2919                 
       
  2920             }
       
  2921             
       
  2922             
       
  2923             ERROR;
       
  2924         }
       
  2925         
       
  2926     }/*function_date_to_udint*/
       
  2927     break;
       
  2928 
       
  2929 /****
       
  2930  *DATE_TO_WORD
       
  2931  */
       
  2932     case function_date_to_word :
       
  2933     {
       
  2934         symbol_c *last_type_symbol = NULL;
       
  2935 
       
  2936         {
       
  2937             identifier_c param_name("IN");
       
  2938             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2939             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2940             
       
  2941             /* Get the value from a foo(<param_value>) style call */
       
  2942             if (IN_param_value == NULL)
       
  2943               IN_param_value = function_call_param_iterator.next();
       
  2944             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2945             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2946             
       
  2947             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  2948             {
       
  2949         
       
  2950                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  2951                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2952                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  2953                 function_type_prefix = return_type_symbol;
       
  2954                 break;
       
  2955                 
       
  2956             }
       
  2957             
       
  2958             
       
  2959             ERROR;
       
  2960         }
       
  2961         
       
  2962     }/*function_date_to_word*/
       
  2963     break;
       
  2964 
       
  2965 /****
       
  2966  *DATE_TO_STRING
       
  2967  */
       
  2968     case function_date_to_string :
       
  2969     {
       
  2970         symbol_c *last_type_symbol = NULL;
       
  2971 
       
  2972         {
       
  2973             identifier_c param_name("IN");
       
  2974             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2975             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2976             
       
  2977             /* Get the value from a foo(<param_value>) style call */
       
  2978             if (IN_param_value == NULL)
       
  2979               IN_param_value = function_call_param_iterator.next();
       
  2980             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2981             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2982             
       
  2983             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  2984             {
       
  2985         
       
  2986                 function_name = (symbol_c*)(new pragma_c("__date_to_string"));
       
  2987                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  2988                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  2989                 function_type_prefix = return_type_symbol;
       
  2990                 break;
       
  2991                 
       
  2992             }
       
  2993             
       
  2994             
       
  2995             ERROR;
       
  2996         }
       
  2997         
       
  2998     }/*function_date_to_string*/
       
  2999     break;
       
  3000 
       
  3001 /****
       
  3002  *DATE_TO_LWORD
       
  3003  */
       
  3004     case function_date_to_lword :
       
  3005     {
       
  3006         symbol_c *last_type_symbol = NULL;
       
  3007 
       
  3008         {
       
  3009             identifier_c param_name("IN");
       
  3010             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3011             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3012             
       
  3013             /* Get the value from a foo(<param_value>) style call */
       
  3014             if (IN_param_value == NULL)
       
  3015               IN_param_value = function_call_param_iterator.next();
       
  3016             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3017             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3018             
       
  3019             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  3020             {
       
  3021         
       
  3022                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  3023                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3024                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  3025                 function_type_prefix = return_type_symbol;
       
  3026                 break;
       
  3027                 
       
  3028             }
       
  3029             
       
  3030             
       
  3031             ERROR;
       
  3032         }
       
  3033         
       
  3034     }/*function_date_to_lword*/
       
  3035     break;
       
  3036 
       
  3037 /****
       
  3038  *DATE_TO_UINT
       
  3039  */
       
  3040     case function_date_to_uint :
       
  3041     {
       
  3042         symbol_c *last_type_symbol = NULL;
       
  3043 
       
  3044         {
       
  3045             identifier_c param_name("IN");
       
  3046             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3047             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3048             
       
  3049             /* Get the value from a foo(<param_value>) style call */
       
  3050             if (IN_param_value == NULL)
       
  3051               IN_param_value = function_call_param_iterator.next();
       
  3052             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3053             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3054             
       
  3055             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  3056             {
       
  3057         
       
  3058                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  3059                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3060                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  3061                 function_type_prefix = return_type_symbol;
       
  3062                 break;
       
  3063                 
       
  3064             }
       
  3065             
       
  3066             
       
  3067             ERROR;
       
  3068         }
       
  3069         
       
  3070     }/*function_date_to_uint*/
       
  3071     break;
       
  3072 
       
  3073 /****
       
  3074  *DATE_TO_LREAL
       
  3075  */
       
  3076     case function_date_to_lreal :
       
  3077     {
       
  3078         symbol_c *last_type_symbol = NULL;
       
  3079 
       
  3080         {
       
  3081             identifier_c param_name("IN");
       
  3082             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3083             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3084             
       
  3085             /* Get the value from a foo(<param_value>) style call */
       
  3086             if (IN_param_value == NULL)
       
  3087               IN_param_value = function_call_param_iterator.next();
       
  3088             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3089             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3090             
       
  3091             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  3092             {
       
  3093         
       
  3094                 function_name = (symbol_c*)(new pragma_c("__time_to_real"));
       
  3095                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3096                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  3097                 function_type_prefix = return_type_symbol;
       
  3098                 break;
       
  3099                 
       
  3100             }
       
  3101             
       
  3102             
       
  3103             ERROR;
       
  3104         }
       
  3105         
       
  3106     }/*function_date_to_lreal*/
       
  3107     break;
       
  3108 
       
  3109 /****
       
  3110  *DATE_TO_BYTE
       
  3111  */
       
  3112     case function_date_to_byte :
       
  3113     {
       
  3114         symbol_c *last_type_symbol = NULL;
       
  3115 
       
  3116         {
       
  3117             identifier_c param_name("IN");
       
  3118             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3119             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3120             
       
  3121             /* Get the value from a foo(<param_value>) style call */
       
  3122             if (IN_param_value == NULL)
       
  3123               IN_param_value = function_call_param_iterator.next();
       
  3124             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3125             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3126             
       
  3127             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  3128             {
       
  3129         
       
  3130                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  3131                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3132                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  3133                 function_type_prefix = return_type_symbol;
       
  3134                 break;
       
  3135                 
       
  3136             }
       
  3137             
       
  3138             
       
  3139             ERROR;
       
  3140         }
       
  3141         
       
  3142     }/*function_date_to_byte*/
       
  3143     break;
       
  3144 
       
  3145 /****
       
  3146  *DATE_TO_USINT
       
  3147  */
       
  3148     case function_date_to_usint :
       
  3149     {
       
  3150         symbol_c *last_type_symbol = NULL;
       
  3151 
       
  3152         {
       
  3153             identifier_c param_name("IN");
       
  3154             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3155             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3156             
       
  3157             /* Get the value from a foo(<param_value>) style call */
       
  3158             if (IN_param_value == NULL)
       
  3159               IN_param_value = function_call_param_iterator.next();
       
  3160             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3161             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3162             
       
  3163             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  3164             {
       
  3165         
       
  3166                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  3167                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3168                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  3169                 function_type_prefix = return_type_symbol;
       
  3170                 break;
       
  3171                 
       
  3172             }
       
  3173             
       
  3174             
       
  3175             ERROR;
       
  3176         }
       
  3177         
       
  3178     }/*function_date_to_usint*/
       
  3179     break;
       
  3180 
       
  3181 /****
       
  3182  *DATE_TO_ULINT
       
  3183  */
       
  3184     case function_date_to_ulint :
       
  3185     {
       
  3186         symbol_c *last_type_symbol = NULL;
       
  3187 
       
  3188         {
       
  3189             identifier_c param_name("IN");
       
  3190             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3191             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3192             
       
  3193             /* Get the value from a foo(<param_value>) style call */
       
  3194             if (IN_param_value == NULL)
       
  3195               IN_param_value = function_call_param_iterator.next();
       
  3196             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3197             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3198             
       
  3199             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  3200             {
       
  3201         
       
  3202                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  3203                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3204                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  3205                 function_type_prefix = return_type_symbol;
       
  3206                 break;
       
  3207                 
       
  3208             }
       
  3209             
       
  3210             
       
  3211             ERROR;
       
  3212         }
       
  3213         
       
  3214     }/*function_date_to_ulint*/
       
  3215     break;
       
  3216 
       
  3217 /****
       
  3218  *DATE_TO_INT
       
  3219  */
       
  3220     case function_date_to_int :
       
  3221     {
       
  3222         symbol_c *last_type_symbol = NULL;
       
  3223 
       
  3224         {
       
  3225             identifier_c param_name("IN");
       
  3226             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3227             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3228             
       
  3229             /* Get the value from a foo(<param_value>) style call */
       
  3230             if (IN_param_value == NULL)
       
  3231               IN_param_value = function_call_param_iterator.next();
       
  3232             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3233             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3234             
       
  3235             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  3236             {
       
  3237         
       
  3238                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  3239                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3240                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  3241                 function_type_prefix = return_type_symbol;
       
  3242                 break;
       
  3243                 
       
  3244             }
       
  3245             
       
  3246             
       
  3247             ERROR;
       
  3248         }
       
  3249         
       
  3250     }/*function_date_to_int*/
       
  3251     break;
       
  3252 
       
  3253 /****
       
  3254  *DWORD_TO_REAL
       
  3255  */
       
  3256     case function_dword_to_real :
       
  3257     {
       
  3258         symbol_c *last_type_symbol = NULL;
       
  3259 
       
  3260         {
       
  3261             identifier_c param_name("IN");
       
  3262             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3263             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3264             
       
  3265             /* Get the value from a foo(<param_value>) style call */
       
  3266             if (IN_param_value == NULL)
       
  3267               IN_param_value = function_call_param_iterator.next();
       
  3268             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3269             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3270             
       
  3271             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3272             {
       
  3273         
       
  3274                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3275                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  3276                 function_type_prefix = return_type_symbol;
       
  3277                 break;
       
  3278                 
       
  3279             }
       
  3280             
       
  3281             
       
  3282             ERROR;
       
  3283         }
       
  3284         
       
  3285     }/*function_dword_to_real*/
       
  3286     break;
       
  3287 
       
  3288 /****
       
  3289  *DWORD_TO_SINT
       
  3290  */
       
  3291     case function_dword_to_sint :
       
  3292     {
       
  3293         symbol_c *last_type_symbol = NULL;
       
  3294 
       
  3295         {
       
  3296             identifier_c param_name("IN");
       
  3297             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3298             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3299             
       
  3300             /* Get the value from a foo(<param_value>) style call */
       
  3301             if (IN_param_value == NULL)
       
  3302               IN_param_value = function_call_param_iterator.next();
       
  3303             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3304             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3305             
       
  3306             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3307             {
       
  3308         
       
  3309                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3310                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  3311                 function_type_prefix = return_type_symbol;
       
  3312                 break;
       
  3313                 
       
  3314             }
       
  3315             
       
  3316             
       
  3317             ERROR;
       
  3318         }
       
  3319         
       
  3320     }/*function_dword_to_sint*/
       
  3321     break;
       
  3322 
       
  3323 /****
       
  3324  *DWORD_TO_LINT
       
  3325  */
       
  3326     case function_dword_to_lint :
       
  3327     {
       
  3328         symbol_c *last_type_symbol = NULL;
       
  3329 
       
  3330         {
       
  3331             identifier_c param_name("IN");
       
  3332             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3333             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3334             
       
  3335             /* Get the value from a foo(<param_value>) style call */
       
  3336             if (IN_param_value == NULL)
       
  3337               IN_param_value = function_call_param_iterator.next();
       
  3338             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3339             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3340             
       
  3341             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3342             {
       
  3343         
       
  3344                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3345                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  3346                 function_type_prefix = return_type_symbol;
       
  3347                 break;
       
  3348                 
       
  3349             }
       
  3350             
       
  3351             
       
  3352             ERROR;
       
  3353         }
       
  3354         
       
  3355     }/*function_dword_to_lint*/
       
  3356     break;
       
  3357 
       
  3358 /****
       
  3359  *DWORD_TO_DINT
       
  3360  */
       
  3361     case function_dword_to_dint :
       
  3362     {
       
  3363         symbol_c *last_type_symbol = NULL;
       
  3364 
       
  3365         {
       
  3366             identifier_c param_name("IN");
       
  3367             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3368             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3369             
       
  3370             /* Get the value from a foo(<param_value>) style call */
       
  3371             if (IN_param_value == NULL)
       
  3372               IN_param_value = function_call_param_iterator.next();
       
  3373             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3374             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3375             
       
  3376             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3377             {
       
  3378         
       
  3379                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3380                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  3381                 function_type_prefix = return_type_symbol;
       
  3382                 break;
       
  3383                 
       
  3384             }
       
  3385             
       
  3386             
       
  3387             ERROR;
       
  3388         }
       
  3389         
       
  3390     }/*function_dword_to_dint*/
       
  3391     break;
       
  3392 
       
  3393 /****
       
  3394  *DWORD_TO_DATE
       
  3395  */
       
  3396     case function_dword_to_date :
       
  3397     {
       
  3398         symbol_c *last_type_symbol = NULL;
       
  3399 
       
  3400         {
       
  3401             identifier_c param_name("IN");
       
  3402             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3403             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3404             
       
  3405             /* Get the value from a foo(<param_value>) style call */
       
  3406             if (IN_param_value == NULL)
       
  3407               IN_param_value = function_call_param_iterator.next();
       
  3408             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3409             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3410             
       
  3411             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3412             {
       
  3413         
       
  3414                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  3415                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3416                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  3417                 function_type_prefix = return_type_symbol;
       
  3418                 break;
       
  3419                 
       
  3420             }
       
  3421             
       
  3422             
       
  3423             ERROR;
       
  3424         }
       
  3425         
       
  3426     }/*function_dword_to_date*/
       
  3427     break;
       
  3428 
       
  3429 /****
       
  3430  *DWORD_TO_DT
       
  3431  */
       
  3432     case function_dword_to_dt :
       
  3433     {
       
  3434         symbol_c *last_type_symbol = NULL;
       
  3435 
       
  3436         {
       
  3437             identifier_c param_name("IN");
       
  3438             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3439             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3440             
       
  3441             /* Get the value from a foo(<param_value>) style call */
       
  3442             if (IN_param_value == NULL)
       
  3443               IN_param_value = function_call_param_iterator.next();
       
  3444             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3445             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3446             
       
  3447             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3448             {
       
  3449         
       
  3450                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  3451                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3452                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  3453                 function_type_prefix = return_type_symbol;
       
  3454                 break;
       
  3455                 
       
  3456             }
       
  3457             
       
  3458             
       
  3459             ERROR;
       
  3460         }
       
  3461         
       
  3462     }/*function_dword_to_dt*/
       
  3463     break;
       
  3464 
       
  3465 /****
       
  3466  *DWORD_TO_TOD
       
  3467  */
       
  3468     case function_dword_to_tod :
       
  3469     {
       
  3470         symbol_c *last_type_symbol = NULL;
       
  3471 
       
  3472         {
       
  3473             identifier_c param_name("IN");
       
  3474             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3475             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3476             
       
  3477             /* Get the value from a foo(<param_value>) style call */
       
  3478             if (IN_param_value == NULL)
       
  3479               IN_param_value = function_call_param_iterator.next();
       
  3480             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3481             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3482             
       
  3483             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3484             {
       
  3485         
       
  3486                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  3487                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3488                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  3489                 function_type_prefix = return_type_symbol;
       
  3490                 break;
       
  3491                 
       
  3492             }
       
  3493             
       
  3494             
       
  3495             ERROR;
       
  3496         }
       
  3497         
       
  3498     }/*function_dword_to_tod*/
       
  3499     break;
       
  3500 
       
  3501 /****
       
  3502  *DWORD_TO_UDINT
       
  3503  */
       
  3504     case function_dword_to_udint :
       
  3505     {
       
  3506         symbol_c *last_type_symbol = NULL;
       
  3507 
       
  3508         {
       
  3509             identifier_c param_name("IN");
       
  3510             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3511             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3512             
       
  3513             /* Get the value from a foo(<param_value>) style call */
       
  3514             if (IN_param_value == NULL)
       
  3515               IN_param_value = function_call_param_iterator.next();
       
  3516             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3517             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3518             
       
  3519             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3520             {
       
  3521         
       
  3522                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3523                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  3524                 function_type_prefix = return_type_symbol;
       
  3525                 break;
       
  3526                 
       
  3527             }
       
  3528             
       
  3529             
       
  3530             ERROR;
       
  3531         }
       
  3532         
       
  3533     }/*function_dword_to_udint*/
       
  3534     break;
       
  3535 
       
  3536 /****
       
  3537  *DWORD_TO_WORD
       
  3538  */
       
  3539     case function_dword_to_word :
       
  3540     {
       
  3541         symbol_c *last_type_symbol = NULL;
       
  3542 
       
  3543         {
       
  3544             identifier_c param_name("IN");
       
  3545             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3546             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3547             
       
  3548             /* Get the value from a foo(<param_value>) style call */
       
  3549             if (IN_param_value == NULL)
       
  3550               IN_param_value = function_call_param_iterator.next();
       
  3551             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3552             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3553             
       
  3554             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3555             {
       
  3556         
       
  3557                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3558                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  3559                 function_type_prefix = return_type_symbol;
       
  3560                 break;
       
  3561                 
       
  3562             }
       
  3563             
       
  3564             
       
  3565             ERROR;
       
  3566         }
       
  3567         
       
  3568     }/*function_dword_to_word*/
       
  3569     break;
       
  3570 
       
  3571 /****
       
  3572  *DWORD_TO_STRING
       
  3573  */
       
  3574     case function_dword_to_string :
       
  3575     {
       
  3576         symbol_c *last_type_symbol = NULL;
       
  3577 
       
  3578         {
       
  3579             identifier_c param_name("IN");
       
  3580             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3581             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3582             
       
  3583             /* Get the value from a foo(<param_value>) style call */
       
  3584             if (IN_param_value == NULL)
       
  3585               IN_param_value = function_call_param_iterator.next();
       
  3586             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3587             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3588             
       
  3589             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3590             {
       
  3591         
       
  3592                 function_name = (symbol_c*)(new pragma_c("__bit_to_string"));
       
  3593                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3594                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  3595                 function_type_prefix = return_type_symbol;
       
  3596                 break;
       
  3597                 
       
  3598             }
       
  3599             
       
  3600             
       
  3601             ERROR;
       
  3602         }
       
  3603         
       
  3604     }/*function_dword_to_string*/
       
  3605     break;
       
  3606 
       
  3607 /****
       
  3608  *DWORD_TO_LWORD
       
  3609  */
       
  3610     case function_dword_to_lword :
       
  3611     {
       
  3612         symbol_c *last_type_symbol = NULL;
       
  3613 
       
  3614         {
       
  3615             identifier_c param_name("IN");
       
  3616             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3617             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3618             
       
  3619             /* Get the value from a foo(<param_value>) style call */
       
  3620             if (IN_param_value == NULL)
       
  3621               IN_param_value = function_call_param_iterator.next();
       
  3622             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3623             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3624             
       
  3625             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3626             {
       
  3627         
       
  3628                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3629                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  3630                 function_type_prefix = return_type_symbol;
       
  3631                 break;
       
  3632                 
       
  3633             }
       
  3634             
       
  3635             
       
  3636             ERROR;
       
  3637         }
       
  3638         
       
  3639     }/*function_dword_to_lword*/
       
  3640     break;
       
  3641 
       
  3642 /****
       
  3643  *DWORD_TO_UINT
       
  3644  */
       
  3645     case function_dword_to_uint :
       
  3646     {
       
  3647         symbol_c *last_type_symbol = NULL;
       
  3648 
       
  3649         {
       
  3650             identifier_c param_name("IN");
       
  3651             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3652             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3653             
       
  3654             /* Get the value from a foo(<param_value>) style call */
       
  3655             if (IN_param_value == NULL)
       
  3656               IN_param_value = function_call_param_iterator.next();
       
  3657             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3658             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3659             
       
  3660             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3661             {
       
  3662         
       
  3663                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3664                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  3665                 function_type_prefix = return_type_symbol;
       
  3666                 break;
       
  3667                 
       
  3668             }
       
  3669             
       
  3670             
       
  3671             ERROR;
       
  3672         }
       
  3673         
       
  3674     }/*function_dword_to_uint*/
       
  3675     break;
       
  3676 
       
  3677 /****
       
  3678  *DWORD_TO_LREAL
       
  3679  */
       
  3680     case function_dword_to_lreal :
       
  3681     {
       
  3682         symbol_c *last_type_symbol = NULL;
       
  3683 
       
  3684         {
       
  3685             identifier_c param_name("IN");
       
  3686             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3687             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3688             
       
  3689             /* Get the value from a foo(<param_value>) style call */
       
  3690             if (IN_param_value == NULL)
       
  3691               IN_param_value = function_call_param_iterator.next();
       
  3692             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3693             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3694             
       
  3695             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3696             {
       
  3697         
       
  3698                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3699                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  3700                 function_type_prefix = return_type_symbol;
       
  3701                 break;
       
  3702                 
       
  3703             }
       
  3704             
       
  3705             
       
  3706             ERROR;
       
  3707         }
       
  3708         
       
  3709     }/*function_dword_to_lreal*/
       
  3710     break;
       
  3711 
       
  3712 /****
       
  3713  *DWORD_TO_BYTE
       
  3714  */
       
  3715     case function_dword_to_byte :
       
  3716     {
       
  3717         symbol_c *last_type_symbol = NULL;
       
  3718 
       
  3719         {
       
  3720             identifier_c param_name("IN");
       
  3721             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3722             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3723             
       
  3724             /* Get the value from a foo(<param_value>) style call */
       
  3725             if (IN_param_value == NULL)
       
  3726               IN_param_value = function_call_param_iterator.next();
       
  3727             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3728             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3729             
       
  3730             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3731             {
       
  3732         
       
  3733                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3734                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  3735                 function_type_prefix = return_type_symbol;
       
  3736                 break;
       
  3737                 
       
  3738             }
       
  3739             
       
  3740             
       
  3741             ERROR;
       
  3742         }
       
  3743         
       
  3744     }/*function_dword_to_byte*/
       
  3745     break;
       
  3746 
       
  3747 /****
       
  3748  *DWORD_TO_USINT
       
  3749  */
       
  3750     case function_dword_to_usint :
       
  3751     {
       
  3752         symbol_c *last_type_symbol = NULL;
       
  3753 
       
  3754         {
       
  3755             identifier_c param_name("IN");
       
  3756             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3757             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3758             
       
  3759             /* Get the value from a foo(<param_value>) style call */
       
  3760             if (IN_param_value == NULL)
       
  3761               IN_param_value = function_call_param_iterator.next();
       
  3762             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3763             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3764             
       
  3765             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3766             {
       
  3767         
       
  3768                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3769                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  3770                 function_type_prefix = return_type_symbol;
       
  3771                 break;
       
  3772                 
       
  3773             }
       
  3774             
       
  3775             
       
  3776             ERROR;
       
  3777         }
       
  3778         
       
  3779     }/*function_dword_to_usint*/
       
  3780     break;
       
  3781 
       
  3782 /****
       
  3783  *DWORD_TO_ULINT
       
  3784  */
       
  3785     case function_dword_to_ulint :
       
  3786     {
       
  3787         symbol_c *last_type_symbol = NULL;
       
  3788 
       
  3789         {
       
  3790             identifier_c param_name("IN");
       
  3791             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3792             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3793             
       
  3794             /* Get the value from a foo(<param_value>) style call */
       
  3795             if (IN_param_value == NULL)
       
  3796               IN_param_value = function_call_param_iterator.next();
       
  3797             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3798             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3799             
       
  3800             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3801             {
       
  3802         
       
  3803                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3804                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  3805                 function_type_prefix = return_type_symbol;
       
  3806                 break;
       
  3807                 
       
  3808             }
       
  3809             
       
  3810             
       
  3811             ERROR;
       
  3812         }
       
  3813         
       
  3814     }/*function_dword_to_ulint*/
       
  3815     break;
       
  3816 
       
  3817 /****
       
  3818  *DWORD_TO_BOOL
       
  3819  */
       
  3820     case function_dword_to_bool :
       
  3821     {
       
  3822         symbol_c *last_type_symbol = NULL;
       
  3823 
       
  3824         {
       
  3825             identifier_c param_name("IN");
       
  3826             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3827             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3828             
       
  3829             /* Get the value from a foo(<param_value>) style call */
       
  3830             if (IN_param_value == NULL)
       
  3831               IN_param_value = function_call_param_iterator.next();
       
  3832             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3833             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3834             
       
  3835             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3836             {
       
  3837         
       
  3838                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3839                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  3840                 function_type_prefix = return_type_symbol;
       
  3841                 break;
       
  3842                 
       
  3843             }
       
  3844             
       
  3845             
       
  3846             ERROR;
       
  3847         }
       
  3848         
       
  3849     }/*function_dword_to_bool*/
       
  3850     break;
       
  3851 
       
  3852 /****
       
  3853  *DWORD_TO_TIME
       
  3854  */
       
  3855     case function_dword_to_time :
       
  3856     {
       
  3857         symbol_c *last_type_symbol = NULL;
       
  3858 
       
  3859         {
       
  3860             identifier_c param_name("IN");
       
  3861             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3862             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3863             
       
  3864             /* Get the value from a foo(<param_value>) style call */
       
  3865             if (IN_param_value == NULL)
       
  3866               IN_param_value = function_call_param_iterator.next();
       
  3867             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3868             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3869             
       
  3870             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3871             {
       
  3872         
       
  3873                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  3874                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3875                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  3876                 function_type_prefix = return_type_symbol;
       
  3877                 break;
       
  3878                 
       
  3879             }
       
  3880             
       
  3881             
       
  3882             ERROR;
       
  3883         }
       
  3884         
       
  3885     }/*function_dword_to_time*/
       
  3886     break;
       
  3887 
       
  3888 /****
       
  3889  *DWORD_TO_INT
       
  3890  */
       
  3891     case function_dword_to_int :
       
  3892     {
       
  3893         symbol_c *last_type_symbol = NULL;
       
  3894 
       
  3895         {
       
  3896             identifier_c param_name("IN");
       
  3897             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3898             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3899             
       
  3900             /* Get the value from a foo(<param_value>) style call */
       
  3901             if (IN_param_value == NULL)
       
  3902               IN_param_value = function_call_param_iterator.next();
       
  3903             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3904             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3905             
       
  3906             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
  3907             {
       
  3908         
       
  3909                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3910                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  3911                 function_type_prefix = return_type_symbol;
       
  3912                 break;
       
  3913                 
       
  3914             }
       
  3915             
       
  3916             
       
  3917             ERROR;
       
  3918         }
       
  3919         
       
  3920     }/*function_dword_to_int*/
       
  3921     break;
       
  3922 
       
  3923 /****
       
  3924  *DT_TO_REAL
       
  3925  */
       
  3926     case function_dt_to_real :
       
  3927     {
       
  3928         symbol_c *last_type_symbol = NULL;
       
  3929 
       
  3930         {
       
  3931             identifier_c param_name("IN");
       
  3932             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3933             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3934             
       
  3935             /* Get the value from a foo(<param_value>) style call */
       
  3936             if (IN_param_value == NULL)
       
  3937               IN_param_value = function_call_param_iterator.next();
       
  3938             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3939             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3940             
       
  3941             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  3942             {
       
  3943         
       
  3944                 function_name = (symbol_c*)(new pragma_c("__time_to_real"));
       
  3945                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3946                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  3947                 function_type_prefix = return_type_symbol;
       
  3948                 break;
       
  3949                 
       
  3950             }
       
  3951             
       
  3952             
       
  3953             ERROR;
       
  3954         }
       
  3955         
       
  3956     }/*function_dt_to_real*/
       
  3957     break;
       
  3958 
       
  3959 /****
       
  3960  *DT_TO_SINT
       
  3961  */
       
  3962     case function_dt_to_sint :
       
  3963     {
       
  3964         symbol_c *last_type_symbol = NULL;
       
  3965 
       
  3966         {
       
  3967             identifier_c param_name("IN");
       
  3968             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3969             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3970             
       
  3971             /* Get the value from a foo(<param_value>) style call */
       
  3972             if (IN_param_value == NULL)
       
  3973               IN_param_value = function_call_param_iterator.next();
       
  3974             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3975             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3976             
       
  3977             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  3978             {
       
  3979         
       
  3980                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  3981                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  3982                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  3983                 function_type_prefix = return_type_symbol;
       
  3984                 break;
       
  3985                 
       
  3986             }
       
  3987             
       
  3988             
       
  3989             ERROR;
       
  3990         }
       
  3991         
       
  3992     }/*function_dt_to_sint*/
       
  3993     break;
       
  3994 
       
  3995 /****
       
  3996  *DT_TO_LINT
       
  3997  */
       
  3998     case function_dt_to_lint :
       
  3999     {
       
  4000         symbol_c *last_type_symbol = NULL;
       
  4001 
       
  4002         {
       
  4003             identifier_c param_name("IN");
       
  4004             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4005             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4006             
       
  4007             /* Get the value from a foo(<param_value>) style call */
       
  4008             if (IN_param_value == NULL)
       
  4009               IN_param_value = function_call_param_iterator.next();
       
  4010             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4011             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4012             
       
  4013             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  4014             {
       
  4015         
       
  4016                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4017                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4018                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  4019                 function_type_prefix = return_type_symbol;
       
  4020                 break;
       
  4021                 
       
  4022             }
       
  4023             
       
  4024             
       
  4025             ERROR;
       
  4026         }
       
  4027         
       
  4028     }/*function_dt_to_lint*/
       
  4029     break;
       
  4030 
       
  4031 /****
       
  4032  *DT_TO_DINT
       
  4033  */
       
  4034     case function_dt_to_dint :
       
  4035     {
       
  4036         symbol_c *last_type_symbol = NULL;
       
  4037 
       
  4038         {
       
  4039             identifier_c param_name("IN");
       
  4040             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4041             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4042             
       
  4043             /* Get the value from a foo(<param_value>) style call */
       
  4044             if (IN_param_value == NULL)
       
  4045               IN_param_value = function_call_param_iterator.next();
       
  4046             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4047             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4048             
       
  4049             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  4050             {
       
  4051         
       
  4052                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4053                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4054                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  4055                 function_type_prefix = return_type_symbol;
       
  4056                 break;
       
  4057                 
       
  4058             }
       
  4059             
       
  4060             
       
  4061             ERROR;
       
  4062         }
       
  4063         
       
  4064     }/*function_dt_to_dint*/
       
  4065     break;
       
  4066 
       
  4067 /****
       
  4068  *DT_TO_DWORD
       
  4069  */
       
  4070     case function_dt_to_dword :
       
  4071     {
       
  4072         symbol_c *last_type_symbol = NULL;
       
  4073 
       
  4074         {
       
  4075             identifier_c param_name("IN");
       
  4076             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4077             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4078             
       
  4079             /* Get the value from a foo(<param_value>) style call */
       
  4080             if (IN_param_value == NULL)
       
  4081               IN_param_value = function_call_param_iterator.next();
       
  4082             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4083             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4084             
       
  4085             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  4086             {
       
  4087         
       
  4088                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4089                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4090                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  4091                 function_type_prefix = return_type_symbol;
       
  4092                 break;
       
  4093                 
       
  4094             }
       
  4095             
       
  4096             
       
  4097             ERROR;
       
  4098         }
       
  4099         
       
  4100     }/*function_dt_to_dword*/
       
  4101     break;
       
  4102 
       
  4103 /****
       
  4104  *DT_TO_UDINT
       
  4105  */
       
  4106     case function_dt_to_udint :
       
  4107     {
       
  4108         symbol_c *last_type_symbol = NULL;
       
  4109 
       
  4110         {
       
  4111             identifier_c param_name("IN");
       
  4112             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4113             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4114             
       
  4115             /* Get the value from a foo(<param_value>) style call */
       
  4116             if (IN_param_value == NULL)
       
  4117               IN_param_value = function_call_param_iterator.next();
       
  4118             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4119             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4120             
       
  4121             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  4122             {
       
  4123         
       
  4124                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4125                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4126                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  4127                 function_type_prefix = return_type_symbol;
       
  4128                 break;
       
  4129                 
       
  4130             }
       
  4131             
       
  4132             
       
  4133             ERROR;
       
  4134         }
       
  4135         
       
  4136     }/*function_dt_to_udint*/
       
  4137     break;
       
  4138 
       
  4139 /****
       
  4140  *DT_TO_WORD
       
  4141  */
       
  4142     case function_dt_to_word :
       
  4143     {
       
  4144         symbol_c *last_type_symbol = NULL;
       
  4145 
       
  4146         {
       
  4147             identifier_c param_name("IN");
       
  4148             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4149             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4150             
       
  4151             /* Get the value from a foo(<param_value>) style call */
       
  4152             if (IN_param_value == NULL)
       
  4153               IN_param_value = function_call_param_iterator.next();
       
  4154             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4155             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4156             
       
  4157             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  4158             {
       
  4159         
       
  4160                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4161                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4162                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  4163                 function_type_prefix = return_type_symbol;
       
  4164                 break;
       
  4165                 
       
  4166             }
       
  4167             
       
  4168             
       
  4169             ERROR;
       
  4170         }
       
  4171         
       
  4172     }/*function_dt_to_word*/
       
  4173     break;
       
  4174 
       
  4175 /****
       
  4176  *DT_TO_STRING
       
  4177  */
       
  4178     case function_dt_to_string :
       
  4179     {
       
  4180         symbol_c *last_type_symbol = NULL;
       
  4181 
       
  4182         {
       
  4183             identifier_c param_name("IN");
       
  4184             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4185             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4186             
       
  4187             /* Get the value from a foo(<param_value>) style call */
       
  4188             if (IN_param_value == NULL)
       
  4189               IN_param_value = function_call_param_iterator.next();
       
  4190             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4191             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4192             
       
  4193             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  4194             {
       
  4195         
       
  4196                 function_name = (symbol_c*)(new pragma_c("__dt_to_string"));
       
  4197                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4198                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  4199                 function_type_prefix = return_type_symbol;
       
  4200                 break;
       
  4201                 
       
  4202             }
       
  4203             
       
  4204             
       
  4205             ERROR;
       
  4206         }
       
  4207         
       
  4208     }/*function_dt_to_string*/
       
  4209     break;
       
  4210 
       
  4211 /****
       
  4212  *DT_TO_LWORD
       
  4213  */
       
  4214     case function_dt_to_lword :
       
  4215     {
       
  4216         symbol_c *last_type_symbol = NULL;
       
  4217 
       
  4218         {
       
  4219             identifier_c param_name("IN");
       
  4220             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4221             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4222             
       
  4223             /* Get the value from a foo(<param_value>) style call */
       
  4224             if (IN_param_value == NULL)
       
  4225               IN_param_value = function_call_param_iterator.next();
       
  4226             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4227             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4228             
       
  4229             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  4230             {
       
  4231         
       
  4232                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4233                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4234                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  4235                 function_type_prefix = return_type_symbol;
       
  4236                 break;
       
  4237                 
       
  4238             }
       
  4239             
       
  4240             
       
  4241             ERROR;
       
  4242         }
       
  4243         
       
  4244     }/*function_dt_to_lword*/
       
  4245     break;
       
  4246 
       
  4247 /****
       
  4248  *DT_TO_UINT
       
  4249  */
       
  4250     case function_dt_to_uint :
       
  4251     {
       
  4252         symbol_c *last_type_symbol = NULL;
       
  4253 
       
  4254         {
       
  4255             identifier_c param_name("IN");
       
  4256             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4257             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4258             
       
  4259             /* Get the value from a foo(<param_value>) style call */
       
  4260             if (IN_param_value == NULL)
       
  4261               IN_param_value = function_call_param_iterator.next();
       
  4262             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4263             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4264             
       
  4265             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  4266             {
       
  4267         
       
  4268                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4269                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4270                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  4271                 function_type_prefix = return_type_symbol;
       
  4272                 break;
       
  4273                 
       
  4274             }
       
  4275             
       
  4276             
       
  4277             ERROR;
       
  4278         }
       
  4279         
       
  4280     }/*function_dt_to_uint*/
       
  4281     break;
       
  4282 
       
  4283 /****
       
  4284  *DT_TO_LREAL
       
  4285  */
       
  4286     case function_dt_to_lreal :
       
  4287     {
       
  4288         symbol_c *last_type_symbol = NULL;
       
  4289 
       
  4290         {
       
  4291             identifier_c param_name("IN");
       
  4292             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4293             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4294             
       
  4295             /* Get the value from a foo(<param_value>) style call */
       
  4296             if (IN_param_value == NULL)
       
  4297               IN_param_value = function_call_param_iterator.next();
       
  4298             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4299             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4300             
       
  4301             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  4302             {
       
  4303         
       
  4304                 function_name = (symbol_c*)(new pragma_c("__time_to_real"));
       
  4305                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4306                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  4307                 function_type_prefix = return_type_symbol;
       
  4308                 break;
       
  4309                 
       
  4310             }
       
  4311             
       
  4312             
       
  4313             ERROR;
       
  4314         }
       
  4315         
       
  4316     }/*function_dt_to_lreal*/
       
  4317     break;
       
  4318 
       
  4319 /****
       
  4320  *DT_TO_BYTE
       
  4321  */
       
  4322     case function_dt_to_byte :
       
  4323     {
       
  4324         symbol_c *last_type_symbol = NULL;
       
  4325 
       
  4326         {
       
  4327             identifier_c param_name("IN");
       
  4328             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4329             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4330             
       
  4331             /* Get the value from a foo(<param_value>) style call */
       
  4332             if (IN_param_value == NULL)
       
  4333               IN_param_value = function_call_param_iterator.next();
       
  4334             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4335             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4336             
       
  4337             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  4338             {
       
  4339         
       
  4340                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4341                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4342                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  4343                 function_type_prefix = return_type_symbol;
       
  4344                 break;
       
  4345                 
       
  4346             }
       
  4347             
       
  4348             
       
  4349             ERROR;
       
  4350         }
       
  4351         
       
  4352     }/*function_dt_to_byte*/
       
  4353     break;
       
  4354 
       
  4355 /****
       
  4356  *DT_TO_USINT
       
  4357  */
       
  4358     case function_dt_to_usint :
       
  4359     {
       
  4360         symbol_c *last_type_symbol = NULL;
       
  4361 
       
  4362         {
       
  4363             identifier_c param_name("IN");
       
  4364             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4365             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4366             
       
  4367             /* Get the value from a foo(<param_value>) style call */
       
  4368             if (IN_param_value == NULL)
       
  4369               IN_param_value = function_call_param_iterator.next();
       
  4370             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4371             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4372             
       
  4373             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  4374             {
       
  4375         
       
  4376                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4377                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4378                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  4379                 function_type_prefix = return_type_symbol;
       
  4380                 break;
       
  4381                 
       
  4382             }
       
  4383             
       
  4384             
       
  4385             ERROR;
       
  4386         }
       
  4387         
       
  4388     }/*function_dt_to_usint*/
       
  4389     break;
       
  4390 
       
  4391 /****
       
  4392  *DT_TO_ULINT
       
  4393  */
       
  4394     case function_dt_to_ulint :
       
  4395     {
       
  4396         symbol_c *last_type_symbol = NULL;
       
  4397 
       
  4398         {
       
  4399             identifier_c param_name("IN");
       
  4400             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4401             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4402             
       
  4403             /* Get the value from a foo(<param_value>) style call */
       
  4404             if (IN_param_value == NULL)
       
  4405               IN_param_value = function_call_param_iterator.next();
       
  4406             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4407             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4408             
       
  4409             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  4410             {
       
  4411         
       
  4412                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4413                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4414                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  4415                 function_type_prefix = return_type_symbol;
       
  4416                 break;
       
  4417                 
       
  4418             }
       
  4419             
       
  4420             
       
  4421             ERROR;
       
  4422         }
       
  4423         
       
  4424     }/*function_dt_to_ulint*/
       
  4425     break;
       
  4426 
       
  4427 /****
       
  4428  *DT_TO_INT
       
  4429  */
       
  4430     case function_dt_to_int :
       
  4431     {
       
  4432         symbol_c *last_type_symbol = NULL;
       
  4433 
       
  4434         {
       
  4435             identifier_c param_name("IN");
       
  4436             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4437             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4438             
       
  4439             /* Get the value from a foo(<param_value>) style call */
       
  4440             if (IN_param_value == NULL)
       
  4441               IN_param_value = function_call_param_iterator.next();
       
  4442             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4443             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4444             
       
  4445             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  4446             {
       
  4447         
       
  4448                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4449                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4450                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  4451                 function_type_prefix = return_type_symbol;
       
  4452                 break;
       
  4453                 
       
  4454             }
       
  4455             
       
  4456             
       
  4457             ERROR;
       
  4458         }
       
  4459         
       
  4460     }/*function_dt_to_int*/
       
  4461     break;
       
  4462 
       
  4463 /****
       
  4464  *TOD_TO_REAL
       
  4465  */
       
  4466     case function_tod_to_real :
       
  4467     {
       
  4468         symbol_c *last_type_symbol = NULL;
       
  4469 
       
  4470         {
       
  4471             identifier_c param_name("IN");
       
  4472             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4473             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4474             
       
  4475             /* Get the value from a foo(<param_value>) style call */
       
  4476             if (IN_param_value == NULL)
       
  4477               IN_param_value = function_call_param_iterator.next();
       
  4478             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4479             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4480             
       
  4481             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4482             {
       
  4483         
       
  4484                 function_name = (symbol_c*)(new pragma_c("__time_to_real"));
       
  4485                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4486                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  4487                 function_type_prefix = return_type_symbol;
       
  4488                 break;
       
  4489                 
       
  4490             }
       
  4491             
       
  4492             
       
  4493             ERROR;
       
  4494         }
       
  4495         
       
  4496     }/*function_tod_to_real*/
       
  4497     break;
       
  4498 
       
  4499 /****
       
  4500  *TOD_TO_SINT
       
  4501  */
       
  4502     case function_tod_to_sint :
       
  4503     {
       
  4504         symbol_c *last_type_symbol = NULL;
       
  4505 
       
  4506         {
       
  4507             identifier_c param_name("IN");
       
  4508             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4509             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4510             
       
  4511             /* Get the value from a foo(<param_value>) style call */
       
  4512             if (IN_param_value == NULL)
       
  4513               IN_param_value = function_call_param_iterator.next();
       
  4514             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4515             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4516             
       
  4517             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4518             {
       
  4519         
       
  4520                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4521                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4522                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  4523                 function_type_prefix = return_type_symbol;
       
  4524                 break;
       
  4525                 
       
  4526             }
       
  4527             
       
  4528             
       
  4529             ERROR;
       
  4530         }
       
  4531         
       
  4532     }/*function_tod_to_sint*/
       
  4533     break;
       
  4534 
       
  4535 /****
       
  4536  *TOD_TO_LINT
       
  4537  */
       
  4538     case function_tod_to_lint :
       
  4539     {
       
  4540         symbol_c *last_type_symbol = NULL;
       
  4541 
       
  4542         {
       
  4543             identifier_c param_name("IN");
       
  4544             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4545             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4546             
       
  4547             /* Get the value from a foo(<param_value>) style call */
       
  4548             if (IN_param_value == NULL)
       
  4549               IN_param_value = function_call_param_iterator.next();
       
  4550             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4551             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4552             
       
  4553             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4554             {
       
  4555         
       
  4556                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4557                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4558                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  4559                 function_type_prefix = return_type_symbol;
       
  4560                 break;
       
  4561                 
       
  4562             }
       
  4563             
       
  4564             
       
  4565             ERROR;
       
  4566         }
       
  4567         
       
  4568     }/*function_tod_to_lint*/
       
  4569     break;
       
  4570 
       
  4571 /****
       
  4572  *TOD_TO_DINT
       
  4573  */
       
  4574     case function_tod_to_dint :
       
  4575     {
       
  4576         symbol_c *last_type_symbol = NULL;
       
  4577 
       
  4578         {
       
  4579             identifier_c param_name("IN");
       
  4580             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4581             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4582             
       
  4583             /* Get the value from a foo(<param_value>) style call */
       
  4584             if (IN_param_value == NULL)
       
  4585               IN_param_value = function_call_param_iterator.next();
       
  4586             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4587             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4588             
       
  4589             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4590             {
       
  4591         
       
  4592                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4593                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4594                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  4595                 function_type_prefix = return_type_symbol;
       
  4596                 break;
       
  4597                 
       
  4598             }
       
  4599             
       
  4600             
       
  4601             ERROR;
       
  4602         }
       
  4603         
       
  4604     }/*function_tod_to_dint*/
       
  4605     break;
       
  4606 
       
  4607 /****
       
  4608  *TOD_TO_DWORD
       
  4609  */
       
  4610     case function_tod_to_dword :
       
  4611     {
       
  4612         symbol_c *last_type_symbol = NULL;
       
  4613 
       
  4614         {
       
  4615             identifier_c param_name("IN");
       
  4616             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4617             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4618             
       
  4619             /* Get the value from a foo(<param_value>) style call */
       
  4620             if (IN_param_value == NULL)
       
  4621               IN_param_value = function_call_param_iterator.next();
       
  4622             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4623             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4624             
       
  4625             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4626             {
       
  4627         
       
  4628                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4629                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4630                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  4631                 function_type_prefix = return_type_symbol;
       
  4632                 break;
       
  4633                 
       
  4634             }
       
  4635             
       
  4636             
       
  4637             ERROR;
       
  4638         }
       
  4639         
       
  4640     }/*function_tod_to_dword*/
       
  4641     break;
       
  4642 
       
  4643 /****
       
  4644  *TOD_TO_UDINT
       
  4645  */
       
  4646     case function_tod_to_udint :
       
  4647     {
       
  4648         symbol_c *last_type_symbol = NULL;
       
  4649 
       
  4650         {
       
  4651             identifier_c param_name("IN");
       
  4652             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4653             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4654             
       
  4655             /* Get the value from a foo(<param_value>) style call */
       
  4656             if (IN_param_value == NULL)
       
  4657               IN_param_value = function_call_param_iterator.next();
       
  4658             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4659             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4660             
       
  4661             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4662             {
       
  4663         
       
  4664                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4665                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4666                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  4667                 function_type_prefix = return_type_symbol;
       
  4668                 break;
       
  4669                 
       
  4670             }
       
  4671             
       
  4672             
       
  4673             ERROR;
       
  4674         }
       
  4675         
       
  4676     }/*function_tod_to_udint*/
       
  4677     break;
       
  4678 
       
  4679 /****
       
  4680  *TOD_TO_WORD
       
  4681  */
       
  4682     case function_tod_to_word :
       
  4683     {
       
  4684         symbol_c *last_type_symbol = NULL;
       
  4685 
       
  4686         {
       
  4687             identifier_c param_name("IN");
       
  4688             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4689             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4690             
       
  4691             /* Get the value from a foo(<param_value>) style call */
       
  4692             if (IN_param_value == NULL)
       
  4693               IN_param_value = function_call_param_iterator.next();
       
  4694             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4695             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4696             
       
  4697             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4698             {
       
  4699         
       
  4700                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4701                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4702                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  4703                 function_type_prefix = return_type_symbol;
       
  4704                 break;
       
  4705                 
       
  4706             }
       
  4707             
       
  4708             
       
  4709             ERROR;
       
  4710         }
       
  4711         
       
  4712     }/*function_tod_to_word*/
       
  4713     break;
       
  4714 
       
  4715 /****
       
  4716  *TOD_TO_STRING
       
  4717  */
       
  4718     case function_tod_to_string :
       
  4719     {
       
  4720         symbol_c *last_type_symbol = NULL;
       
  4721 
       
  4722         {
       
  4723             identifier_c param_name("IN");
       
  4724             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4725             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4726             
       
  4727             /* Get the value from a foo(<param_value>) style call */
       
  4728             if (IN_param_value == NULL)
       
  4729               IN_param_value = function_call_param_iterator.next();
       
  4730             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4731             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4732             
       
  4733             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4734             {
       
  4735         
       
  4736                 function_name = (symbol_c*)(new pragma_c("__tod_to_string"));
       
  4737                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4738                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  4739                 function_type_prefix = return_type_symbol;
       
  4740                 break;
       
  4741                 
       
  4742             }
       
  4743             
       
  4744             
       
  4745             ERROR;
       
  4746         }
       
  4747         
       
  4748     }/*function_tod_to_string*/
       
  4749     break;
       
  4750 
       
  4751 /****
       
  4752  *TOD_TO_LWORD
       
  4753  */
       
  4754     case function_tod_to_lword :
       
  4755     {
       
  4756         symbol_c *last_type_symbol = NULL;
       
  4757 
       
  4758         {
       
  4759             identifier_c param_name("IN");
       
  4760             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4761             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4762             
       
  4763             /* Get the value from a foo(<param_value>) style call */
       
  4764             if (IN_param_value == NULL)
       
  4765               IN_param_value = function_call_param_iterator.next();
       
  4766             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4767             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4768             
       
  4769             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4770             {
       
  4771         
       
  4772                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4773                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4774                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  4775                 function_type_prefix = return_type_symbol;
       
  4776                 break;
       
  4777                 
       
  4778             }
       
  4779             
       
  4780             
       
  4781             ERROR;
       
  4782         }
       
  4783         
       
  4784     }/*function_tod_to_lword*/
       
  4785     break;
       
  4786 
       
  4787 /****
       
  4788  *TOD_TO_UINT
       
  4789  */
       
  4790     case function_tod_to_uint :
       
  4791     {
       
  4792         symbol_c *last_type_symbol = NULL;
       
  4793 
       
  4794         {
       
  4795             identifier_c param_name("IN");
       
  4796             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4797             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4798             
       
  4799             /* Get the value from a foo(<param_value>) style call */
       
  4800             if (IN_param_value == NULL)
       
  4801               IN_param_value = function_call_param_iterator.next();
       
  4802             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4803             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4804             
       
  4805             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4806             {
       
  4807         
       
  4808                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4809                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4810                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  4811                 function_type_prefix = return_type_symbol;
       
  4812                 break;
       
  4813                 
       
  4814             }
       
  4815             
       
  4816             
       
  4817             ERROR;
       
  4818         }
       
  4819         
       
  4820     }/*function_tod_to_uint*/
       
  4821     break;
       
  4822 
       
  4823 /****
       
  4824  *TOD_TO_LREAL
       
  4825  */
       
  4826     case function_tod_to_lreal :
       
  4827     {
       
  4828         symbol_c *last_type_symbol = NULL;
       
  4829 
       
  4830         {
       
  4831             identifier_c param_name("IN");
       
  4832             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4833             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4834             
       
  4835             /* Get the value from a foo(<param_value>) style call */
       
  4836             if (IN_param_value == NULL)
       
  4837               IN_param_value = function_call_param_iterator.next();
       
  4838             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4839             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4840             
       
  4841             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4842             {
       
  4843         
       
  4844                 function_name = (symbol_c*)(new pragma_c("__time_to_real"));
       
  4845                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4846                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  4847                 function_type_prefix = return_type_symbol;
       
  4848                 break;
       
  4849                 
       
  4850             }
       
  4851             
       
  4852             
       
  4853             ERROR;
       
  4854         }
       
  4855         
       
  4856     }/*function_tod_to_lreal*/
       
  4857     break;
       
  4858 
       
  4859 /****
       
  4860  *TOD_TO_BYTE
       
  4861  */
       
  4862     case function_tod_to_byte :
       
  4863     {
       
  4864         symbol_c *last_type_symbol = NULL;
       
  4865 
       
  4866         {
       
  4867             identifier_c param_name("IN");
       
  4868             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4869             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4870             
       
  4871             /* Get the value from a foo(<param_value>) style call */
       
  4872             if (IN_param_value == NULL)
       
  4873               IN_param_value = function_call_param_iterator.next();
       
  4874             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4875             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4876             
       
  4877             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4878             {
       
  4879         
       
  4880                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4881                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4882                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  4883                 function_type_prefix = return_type_symbol;
       
  4884                 break;
       
  4885                 
       
  4886             }
       
  4887             
       
  4888             
       
  4889             ERROR;
       
  4890         }
       
  4891         
       
  4892     }/*function_tod_to_byte*/
       
  4893     break;
       
  4894 
       
  4895 /****
       
  4896  *TOD_TO_USINT
       
  4897  */
       
  4898     case function_tod_to_usint :
       
  4899     {
       
  4900         symbol_c *last_type_symbol = NULL;
       
  4901 
       
  4902         {
       
  4903             identifier_c param_name("IN");
       
  4904             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4905             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4906             
       
  4907             /* Get the value from a foo(<param_value>) style call */
       
  4908             if (IN_param_value == NULL)
       
  4909               IN_param_value = function_call_param_iterator.next();
       
  4910             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4911             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4912             
       
  4913             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4914             {
       
  4915         
       
  4916                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4917                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4918                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  4919                 function_type_prefix = return_type_symbol;
       
  4920                 break;
       
  4921                 
       
  4922             }
       
  4923             
       
  4924             
       
  4925             ERROR;
       
  4926         }
       
  4927         
       
  4928     }/*function_tod_to_usint*/
       
  4929     break;
       
  4930 
       
  4931 /****
       
  4932  *TOD_TO_ULINT
       
  4933  */
       
  4934     case function_tod_to_ulint :
       
  4935     {
       
  4936         symbol_c *last_type_symbol = NULL;
       
  4937 
       
  4938         {
       
  4939             identifier_c param_name("IN");
       
  4940             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4941             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4942             
       
  4943             /* Get the value from a foo(<param_value>) style call */
       
  4944             if (IN_param_value == NULL)
       
  4945               IN_param_value = function_call_param_iterator.next();
       
  4946             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4947             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4948             
       
  4949             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4950             {
       
  4951         
       
  4952                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4953                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4954                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  4955                 function_type_prefix = return_type_symbol;
       
  4956                 break;
       
  4957                 
       
  4958             }
       
  4959             
       
  4960             
       
  4961             ERROR;
       
  4962         }
       
  4963         
       
  4964     }/*function_tod_to_ulint*/
       
  4965     break;
       
  4966 
       
  4967 /****
       
  4968  *TOD_TO_INT
       
  4969  */
       
  4970     case function_tod_to_int :
       
  4971     {
       
  4972         symbol_c *last_type_symbol = NULL;
       
  4973 
       
  4974         {
       
  4975             identifier_c param_name("IN");
       
  4976             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4977             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4978             
       
  4979             /* Get the value from a foo(<param_value>) style call */
       
  4980             if (IN_param_value == NULL)
       
  4981               IN_param_value = function_call_param_iterator.next();
       
  4982             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4983             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4984             
       
  4985             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  4986             {
       
  4987         
       
  4988                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
  4989                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  4990                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  4991                 function_type_prefix = return_type_symbol;
       
  4992                 break;
       
  4993                 
       
  4994             }
       
  4995             
       
  4996             
       
  4997             ERROR;
       
  4998         }
       
  4999         
       
  5000     }/*function_tod_to_int*/
       
  5001     break;
       
  5002 
       
  5003 /****
       
  5004  *UDINT_TO_REAL
       
  5005  */
       
  5006     case function_udint_to_real :
       
  5007     {
       
  5008         symbol_c *last_type_symbol = NULL;
       
  5009 
       
  5010         {
       
  5011             identifier_c param_name("IN");
       
  5012             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5013             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5014             
       
  5015             /* Get the value from a foo(<param_value>) style call */
       
  5016             if (IN_param_value == NULL)
       
  5017               IN_param_value = function_call_param_iterator.next();
       
  5018             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5019             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5020             
       
  5021             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5022             {
       
  5023         
       
  5024                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5025                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  5026                 function_type_prefix = return_type_symbol;
       
  5027                 break;
       
  5028                 
       
  5029             }
       
  5030             
       
  5031             
       
  5032             ERROR;
       
  5033         }
       
  5034         
       
  5035     }/*function_udint_to_real*/
       
  5036     break;
       
  5037 
       
  5038 /****
       
  5039  *UDINT_TO_SINT
       
  5040  */
       
  5041     case function_udint_to_sint :
       
  5042     {
       
  5043         symbol_c *last_type_symbol = NULL;
       
  5044 
       
  5045         {
       
  5046             identifier_c param_name("IN");
       
  5047             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5048             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5049             
       
  5050             /* Get the value from a foo(<param_value>) style call */
       
  5051             if (IN_param_value == NULL)
       
  5052               IN_param_value = function_call_param_iterator.next();
       
  5053             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5054             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5055             
       
  5056             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5057             {
       
  5058         
       
  5059                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5060                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  5061                 function_type_prefix = return_type_symbol;
       
  5062                 break;
       
  5063                 
       
  5064             }
       
  5065             
       
  5066             
       
  5067             ERROR;
       
  5068         }
       
  5069         
       
  5070     }/*function_udint_to_sint*/
       
  5071     break;
       
  5072 
       
  5073 /****
       
  5074  *UDINT_TO_LINT
       
  5075  */
       
  5076     case function_udint_to_lint :
       
  5077     {
       
  5078         symbol_c *last_type_symbol = NULL;
       
  5079 
       
  5080         {
       
  5081             identifier_c param_name("IN");
       
  5082             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5083             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5084             
       
  5085             /* Get the value from a foo(<param_value>) style call */
       
  5086             if (IN_param_value == NULL)
       
  5087               IN_param_value = function_call_param_iterator.next();
       
  5088             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5089             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5090             
       
  5091             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5092             {
       
  5093         
       
  5094                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5095                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  5096                 function_type_prefix = return_type_symbol;
       
  5097                 break;
       
  5098                 
       
  5099             }
       
  5100             
       
  5101             
       
  5102             ERROR;
       
  5103         }
       
  5104         
       
  5105     }/*function_udint_to_lint*/
       
  5106     break;
       
  5107 
       
  5108 /****
       
  5109  *UDINT_TO_DINT
       
  5110  */
       
  5111     case function_udint_to_dint :
       
  5112     {
       
  5113         symbol_c *last_type_symbol = NULL;
       
  5114 
       
  5115         {
       
  5116             identifier_c param_name("IN");
       
  5117             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5118             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5119             
       
  5120             /* Get the value from a foo(<param_value>) style call */
       
  5121             if (IN_param_value == NULL)
       
  5122               IN_param_value = function_call_param_iterator.next();
       
  5123             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5124             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5125             
       
  5126             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5127             {
       
  5128         
       
  5129                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5130                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  5131                 function_type_prefix = return_type_symbol;
       
  5132                 break;
       
  5133                 
       
  5134             }
       
  5135             
       
  5136             
       
  5137             ERROR;
       
  5138         }
       
  5139         
       
  5140     }/*function_udint_to_dint*/
       
  5141     break;
       
  5142 
       
  5143 /****
       
  5144  *UDINT_TO_DATE
       
  5145  */
       
  5146     case function_udint_to_date :
       
  5147     {
       
  5148         symbol_c *last_type_symbol = NULL;
       
  5149 
       
  5150         {
       
  5151             identifier_c param_name("IN");
       
  5152             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5153             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5154             
       
  5155             /* Get the value from a foo(<param_value>) style call */
       
  5156             if (IN_param_value == NULL)
       
  5157               IN_param_value = function_call_param_iterator.next();
       
  5158             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5159             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5160             
       
  5161             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5162             {
       
  5163         
       
  5164                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  5165                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5166                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  5167                 function_type_prefix = return_type_symbol;
       
  5168                 break;
       
  5169                 
       
  5170             }
       
  5171             
       
  5172             
       
  5173             ERROR;
       
  5174         }
       
  5175         
       
  5176     }/*function_udint_to_date*/
       
  5177     break;
       
  5178 
       
  5179 /****
       
  5180  *UDINT_TO_DWORD
       
  5181  */
       
  5182     case function_udint_to_dword :
       
  5183     {
       
  5184         symbol_c *last_type_symbol = NULL;
       
  5185 
       
  5186         {
       
  5187             identifier_c param_name("IN");
       
  5188             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5189             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5190             
       
  5191             /* Get the value from a foo(<param_value>) style call */
       
  5192             if (IN_param_value == NULL)
       
  5193               IN_param_value = function_call_param_iterator.next();
       
  5194             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5195             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5196             
       
  5197             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5198             {
       
  5199         
       
  5200                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5201                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  5202                 function_type_prefix = return_type_symbol;
       
  5203                 break;
       
  5204                 
       
  5205             }
       
  5206             
       
  5207             
       
  5208             ERROR;
       
  5209         }
       
  5210         
       
  5211     }/*function_udint_to_dword*/
       
  5212     break;
       
  5213 
       
  5214 /****
       
  5215  *UDINT_TO_DT
       
  5216  */
       
  5217     case function_udint_to_dt :
       
  5218     {
       
  5219         symbol_c *last_type_symbol = NULL;
       
  5220 
       
  5221         {
       
  5222             identifier_c param_name("IN");
       
  5223             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5224             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5225             
       
  5226             /* Get the value from a foo(<param_value>) style call */
       
  5227             if (IN_param_value == NULL)
       
  5228               IN_param_value = function_call_param_iterator.next();
       
  5229             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5230             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5231             
       
  5232             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5233             {
       
  5234         
       
  5235                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  5236                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5237                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  5238                 function_type_prefix = return_type_symbol;
       
  5239                 break;
       
  5240                 
       
  5241             }
       
  5242             
       
  5243             
       
  5244             ERROR;
       
  5245         }
       
  5246         
       
  5247     }/*function_udint_to_dt*/
       
  5248     break;
       
  5249 
       
  5250 /****
       
  5251  *UDINT_TO_TOD
       
  5252  */
       
  5253     case function_udint_to_tod :
       
  5254     {
       
  5255         symbol_c *last_type_symbol = NULL;
       
  5256 
       
  5257         {
       
  5258             identifier_c param_name("IN");
       
  5259             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5260             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5261             
       
  5262             /* Get the value from a foo(<param_value>) style call */
       
  5263             if (IN_param_value == NULL)
       
  5264               IN_param_value = function_call_param_iterator.next();
       
  5265             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5266             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5267             
       
  5268             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5269             {
       
  5270         
       
  5271                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  5272                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5273                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  5274                 function_type_prefix = return_type_symbol;
       
  5275                 break;
       
  5276                 
       
  5277             }
       
  5278             
       
  5279             
       
  5280             ERROR;
       
  5281         }
       
  5282         
       
  5283     }/*function_udint_to_tod*/
       
  5284     break;
       
  5285 
       
  5286 /****
       
  5287  *UDINT_TO_WORD
       
  5288  */
       
  5289     case function_udint_to_word :
       
  5290     {
       
  5291         symbol_c *last_type_symbol = NULL;
       
  5292 
       
  5293         {
       
  5294             identifier_c param_name("IN");
       
  5295             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5296             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5297             
       
  5298             /* Get the value from a foo(<param_value>) style call */
       
  5299             if (IN_param_value == NULL)
       
  5300               IN_param_value = function_call_param_iterator.next();
       
  5301             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5302             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5303             
       
  5304             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5305             {
       
  5306         
       
  5307                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5308                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  5309                 function_type_prefix = return_type_symbol;
       
  5310                 break;
       
  5311                 
       
  5312             }
       
  5313             
       
  5314             
       
  5315             ERROR;
       
  5316         }
       
  5317         
       
  5318     }/*function_udint_to_word*/
       
  5319     break;
       
  5320 
       
  5321 /****
       
  5322  *UDINT_TO_STRING
       
  5323  */
       
  5324     case function_udint_to_string :
       
  5325     {
       
  5326         symbol_c *last_type_symbol = NULL;
       
  5327 
       
  5328         {
       
  5329             identifier_c param_name("IN");
       
  5330             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5331             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5332             
       
  5333             /* Get the value from a foo(<param_value>) style call */
       
  5334             if (IN_param_value == NULL)
       
  5335               IN_param_value = function_call_param_iterator.next();
       
  5336             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5337             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5338             
       
  5339             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5340             {
       
  5341         
       
  5342                 function_name = (symbol_c*)(new pragma_c("__uint_to_string"));
       
  5343                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5344                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  5345                 function_type_prefix = return_type_symbol;
       
  5346                 break;
       
  5347                 
       
  5348             }
       
  5349             
       
  5350             
       
  5351             ERROR;
       
  5352         }
       
  5353         
       
  5354     }/*function_udint_to_string*/
       
  5355     break;
       
  5356 
       
  5357 /****
       
  5358  *UDINT_TO_LWORD
       
  5359  */
       
  5360     case function_udint_to_lword :
       
  5361     {
       
  5362         symbol_c *last_type_symbol = NULL;
       
  5363 
       
  5364         {
       
  5365             identifier_c param_name("IN");
       
  5366             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5367             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5368             
       
  5369             /* Get the value from a foo(<param_value>) style call */
       
  5370             if (IN_param_value == NULL)
       
  5371               IN_param_value = function_call_param_iterator.next();
       
  5372             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5373             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5374             
       
  5375             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5376             {
       
  5377         
       
  5378                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5379                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  5380                 function_type_prefix = return_type_symbol;
       
  5381                 break;
       
  5382                 
       
  5383             }
       
  5384             
       
  5385             
       
  5386             ERROR;
       
  5387         }
       
  5388         
       
  5389     }/*function_udint_to_lword*/
       
  5390     break;
       
  5391 
       
  5392 /****
       
  5393  *UDINT_TO_UINT
       
  5394  */
       
  5395     case function_udint_to_uint :
       
  5396     {
       
  5397         symbol_c *last_type_symbol = NULL;
       
  5398 
       
  5399         {
       
  5400             identifier_c param_name("IN");
       
  5401             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5402             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5403             
       
  5404             /* Get the value from a foo(<param_value>) style call */
       
  5405             if (IN_param_value == NULL)
       
  5406               IN_param_value = function_call_param_iterator.next();
       
  5407             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5408             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5409             
       
  5410             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5411             {
       
  5412         
       
  5413                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5414                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  5415                 function_type_prefix = return_type_symbol;
       
  5416                 break;
       
  5417                 
       
  5418             }
       
  5419             
       
  5420             
       
  5421             ERROR;
       
  5422         }
       
  5423         
       
  5424     }/*function_udint_to_uint*/
       
  5425     break;
       
  5426 
       
  5427 /****
       
  5428  *UDINT_TO_LREAL
       
  5429  */
       
  5430     case function_udint_to_lreal :
       
  5431     {
       
  5432         symbol_c *last_type_symbol = NULL;
       
  5433 
       
  5434         {
       
  5435             identifier_c param_name("IN");
       
  5436             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5437             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5438             
       
  5439             /* Get the value from a foo(<param_value>) style call */
       
  5440             if (IN_param_value == NULL)
       
  5441               IN_param_value = function_call_param_iterator.next();
       
  5442             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5443             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5444             
       
  5445             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5446             {
       
  5447         
       
  5448                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5449                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  5450                 function_type_prefix = return_type_symbol;
       
  5451                 break;
       
  5452                 
       
  5453             }
       
  5454             
       
  5455             
       
  5456             ERROR;
       
  5457         }
       
  5458         
       
  5459     }/*function_udint_to_lreal*/
       
  5460     break;
       
  5461 
       
  5462 /****
       
  5463  *UDINT_TO_BYTE
       
  5464  */
       
  5465     case function_udint_to_byte :
       
  5466     {
       
  5467         symbol_c *last_type_symbol = NULL;
       
  5468 
       
  5469         {
       
  5470             identifier_c param_name("IN");
       
  5471             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5472             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5473             
       
  5474             /* Get the value from a foo(<param_value>) style call */
       
  5475             if (IN_param_value == NULL)
       
  5476               IN_param_value = function_call_param_iterator.next();
       
  5477             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5478             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5479             
       
  5480             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5481             {
       
  5482         
       
  5483                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5484                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  5485                 function_type_prefix = return_type_symbol;
       
  5486                 break;
       
  5487                 
       
  5488             }
       
  5489             
       
  5490             
       
  5491             ERROR;
       
  5492         }
       
  5493         
       
  5494     }/*function_udint_to_byte*/
       
  5495     break;
       
  5496 
       
  5497 /****
       
  5498  *UDINT_TO_USINT
       
  5499  */
       
  5500     case function_udint_to_usint :
       
  5501     {
       
  5502         symbol_c *last_type_symbol = NULL;
       
  5503 
       
  5504         {
       
  5505             identifier_c param_name("IN");
       
  5506             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5507             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5508             
       
  5509             /* Get the value from a foo(<param_value>) style call */
       
  5510             if (IN_param_value == NULL)
       
  5511               IN_param_value = function_call_param_iterator.next();
       
  5512             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5513             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5514             
       
  5515             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5516             {
       
  5517         
       
  5518                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5519                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  5520                 function_type_prefix = return_type_symbol;
       
  5521                 break;
       
  5522                 
       
  5523             }
       
  5524             
       
  5525             
       
  5526             ERROR;
       
  5527         }
       
  5528         
       
  5529     }/*function_udint_to_usint*/
       
  5530     break;
       
  5531 
       
  5532 /****
       
  5533  *UDINT_TO_ULINT
       
  5534  */
       
  5535     case function_udint_to_ulint :
       
  5536     {
       
  5537         symbol_c *last_type_symbol = NULL;
       
  5538 
       
  5539         {
       
  5540             identifier_c param_name("IN");
       
  5541             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5542             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5543             
       
  5544             /* Get the value from a foo(<param_value>) style call */
       
  5545             if (IN_param_value == NULL)
       
  5546               IN_param_value = function_call_param_iterator.next();
       
  5547             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5548             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5549             
       
  5550             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5551             {
       
  5552         
       
  5553                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5554                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  5555                 function_type_prefix = return_type_symbol;
       
  5556                 break;
       
  5557                 
       
  5558             }
       
  5559             
       
  5560             
       
  5561             ERROR;
       
  5562         }
       
  5563         
       
  5564     }/*function_udint_to_ulint*/
       
  5565     break;
       
  5566 
       
  5567 /****
       
  5568  *UDINT_TO_BOOL
       
  5569  */
       
  5570     case function_udint_to_bool :
       
  5571     {
       
  5572         symbol_c *last_type_symbol = NULL;
       
  5573 
       
  5574         {
       
  5575             identifier_c param_name("IN");
       
  5576             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5577             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5578             
       
  5579             /* Get the value from a foo(<param_value>) style call */
       
  5580             if (IN_param_value == NULL)
       
  5581               IN_param_value = function_call_param_iterator.next();
       
  5582             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5583             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5584             
       
  5585             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5586             {
       
  5587         
       
  5588                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5589                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  5590                 function_type_prefix = return_type_symbol;
       
  5591                 break;
       
  5592                 
       
  5593             }
       
  5594             
       
  5595             
       
  5596             ERROR;
       
  5597         }
       
  5598         
       
  5599     }/*function_udint_to_bool*/
       
  5600     break;
       
  5601 
       
  5602 /****
       
  5603  *UDINT_TO_TIME
       
  5604  */
       
  5605     case function_udint_to_time :
       
  5606     {
       
  5607         symbol_c *last_type_symbol = NULL;
       
  5608 
       
  5609         {
       
  5610             identifier_c param_name("IN");
       
  5611             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5612             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5613             
       
  5614             /* Get the value from a foo(<param_value>) style call */
       
  5615             if (IN_param_value == NULL)
       
  5616               IN_param_value = function_call_param_iterator.next();
       
  5617             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5618             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5619             
       
  5620             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5621             {
       
  5622         
       
  5623                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  5624                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5625                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  5626                 function_type_prefix = return_type_symbol;
       
  5627                 break;
       
  5628                 
       
  5629             }
       
  5630             
       
  5631             
       
  5632             ERROR;
       
  5633         }
       
  5634         
       
  5635     }/*function_udint_to_time*/
       
  5636     break;
       
  5637 
       
  5638 /****
       
  5639  *UDINT_TO_INT
       
  5640  */
       
  5641     case function_udint_to_int :
       
  5642     {
       
  5643         symbol_c *last_type_symbol = NULL;
       
  5644 
       
  5645         {
       
  5646             identifier_c param_name("IN");
       
  5647             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5648             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5649             
       
  5650             /* Get the value from a foo(<param_value>) style call */
       
  5651             if (IN_param_value == NULL)
       
  5652               IN_param_value = function_call_param_iterator.next();
       
  5653             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5654             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5655             
       
  5656             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5657             {
       
  5658         
       
  5659                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5660                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  5661                 function_type_prefix = return_type_symbol;
       
  5662                 break;
       
  5663                 
       
  5664             }
       
  5665             
       
  5666             
       
  5667             ERROR;
       
  5668         }
       
  5669         
       
  5670     }/*function_udint_to_int*/
       
  5671     break;
       
  5672 
       
  5673 /****
       
  5674  *WORD_TO_REAL
       
  5675  */
       
  5676     case function_word_to_real :
       
  5677     {
       
  5678         symbol_c *last_type_symbol = NULL;
       
  5679 
       
  5680         {
       
  5681             identifier_c param_name("IN");
       
  5682             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5683             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5684             
       
  5685             /* Get the value from a foo(<param_value>) style call */
       
  5686             if (IN_param_value == NULL)
       
  5687               IN_param_value = function_call_param_iterator.next();
       
  5688             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5689             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5690             
       
  5691             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  5692             {
       
  5693         
       
  5694                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5695                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  5696                 function_type_prefix = return_type_symbol;
       
  5697                 break;
       
  5698                 
       
  5699             }
       
  5700             
       
  5701             
       
  5702             ERROR;
       
  5703         }
       
  5704         
       
  5705     }/*function_word_to_real*/
       
  5706     break;
       
  5707 
       
  5708 /****
       
  5709  *WORD_TO_SINT
       
  5710  */
       
  5711     case function_word_to_sint :
       
  5712     {
       
  5713         symbol_c *last_type_symbol = NULL;
       
  5714 
       
  5715         {
       
  5716             identifier_c param_name("IN");
       
  5717             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5718             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5719             
       
  5720             /* Get the value from a foo(<param_value>) style call */
       
  5721             if (IN_param_value == NULL)
       
  5722               IN_param_value = function_call_param_iterator.next();
       
  5723             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5724             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5725             
       
  5726             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  5727             {
       
  5728         
       
  5729                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5730                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  5731                 function_type_prefix = return_type_symbol;
       
  5732                 break;
       
  5733                 
       
  5734             }
       
  5735             
       
  5736             
       
  5737             ERROR;
       
  5738         }
       
  5739         
       
  5740     }/*function_word_to_sint*/
       
  5741     break;
       
  5742 
       
  5743 /****
       
  5744  *WORD_TO_LINT
       
  5745  */
       
  5746     case function_word_to_lint :
       
  5747     {
       
  5748         symbol_c *last_type_symbol = NULL;
       
  5749 
       
  5750         {
       
  5751             identifier_c param_name("IN");
       
  5752             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5753             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5754             
       
  5755             /* Get the value from a foo(<param_value>) style call */
       
  5756             if (IN_param_value == NULL)
       
  5757               IN_param_value = function_call_param_iterator.next();
       
  5758             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5759             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5760             
       
  5761             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  5762             {
       
  5763         
       
  5764                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5765                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  5766                 function_type_prefix = return_type_symbol;
       
  5767                 break;
       
  5768                 
       
  5769             }
       
  5770             
       
  5771             
       
  5772             ERROR;
       
  5773         }
       
  5774         
       
  5775     }/*function_word_to_lint*/
       
  5776     break;
       
  5777 
       
  5778 /****
       
  5779  *WORD_TO_DINT
       
  5780  */
       
  5781     case function_word_to_dint :
       
  5782     {
       
  5783         symbol_c *last_type_symbol = NULL;
       
  5784 
       
  5785         {
       
  5786             identifier_c param_name("IN");
       
  5787             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5788             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5789             
       
  5790             /* Get the value from a foo(<param_value>) style call */
       
  5791             if (IN_param_value == NULL)
       
  5792               IN_param_value = function_call_param_iterator.next();
       
  5793             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5794             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5795             
       
  5796             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  5797             {
       
  5798         
       
  5799                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5800                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  5801                 function_type_prefix = return_type_symbol;
       
  5802                 break;
       
  5803                 
       
  5804             }
       
  5805             
       
  5806             
       
  5807             ERROR;
       
  5808         }
       
  5809         
       
  5810     }/*function_word_to_dint*/
       
  5811     break;
       
  5812 
       
  5813 /****
       
  5814  *WORD_TO_DATE
       
  5815  */
       
  5816     case function_word_to_date :
       
  5817     {
       
  5818         symbol_c *last_type_symbol = NULL;
       
  5819 
       
  5820         {
       
  5821             identifier_c param_name("IN");
       
  5822             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5823             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5824             
       
  5825             /* Get the value from a foo(<param_value>) style call */
       
  5826             if (IN_param_value == NULL)
       
  5827               IN_param_value = function_call_param_iterator.next();
       
  5828             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5829             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5830             
       
  5831             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  5832             {
       
  5833         
       
  5834                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  5835                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5836                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  5837                 function_type_prefix = return_type_symbol;
       
  5838                 break;
       
  5839                 
       
  5840             }
       
  5841             
       
  5842             
       
  5843             ERROR;
       
  5844         }
       
  5845         
       
  5846     }/*function_word_to_date*/
       
  5847     break;
       
  5848 
       
  5849 /****
       
  5850  *WORD_TO_DWORD
       
  5851  */
       
  5852     case function_word_to_dword :
       
  5853     {
       
  5854         symbol_c *last_type_symbol = NULL;
       
  5855 
       
  5856         {
       
  5857             identifier_c param_name("IN");
       
  5858             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5859             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5860             
       
  5861             /* Get the value from a foo(<param_value>) style call */
       
  5862             if (IN_param_value == NULL)
       
  5863               IN_param_value = function_call_param_iterator.next();
       
  5864             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5865             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5866             
       
  5867             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  5868             {
       
  5869         
       
  5870                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5871                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  5872                 function_type_prefix = return_type_symbol;
       
  5873                 break;
       
  5874                 
       
  5875             }
       
  5876             
       
  5877             
       
  5878             ERROR;
       
  5879         }
       
  5880         
       
  5881     }/*function_word_to_dword*/
       
  5882     break;
       
  5883 
       
  5884 /****
       
  5885  *WORD_TO_DT
       
  5886  */
       
  5887     case function_word_to_dt :
       
  5888     {
       
  5889         symbol_c *last_type_symbol = NULL;
       
  5890 
       
  5891         {
       
  5892             identifier_c param_name("IN");
       
  5893             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5894             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5895             
       
  5896             /* Get the value from a foo(<param_value>) style call */
       
  5897             if (IN_param_value == NULL)
       
  5898               IN_param_value = function_call_param_iterator.next();
       
  5899             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5900             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5901             
       
  5902             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  5903             {
       
  5904         
       
  5905                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  5906                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5907                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  5908                 function_type_prefix = return_type_symbol;
       
  5909                 break;
       
  5910                 
       
  5911             }
       
  5912             
       
  5913             
       
  5914             ERROR;
       
  5915         }
       
  5916         
       
  5917     }/*function_word_to_dt*/
       
  5918     break;
       
  5919 
       
  5920 /****
       
  5921  *WORD_TO_TOD
       
  5922  */
       
  5923     case function_word_to_tod :
       
  5924     {
       
  5925         symbol_c *last_type_symbol = NULL;
       
  5926 
       
  5927         {
       
  5928             identifier_c param_name("IN");
       
  5929             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5930             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5931             
       
  5932             /* Get the value from a foo(<param_value>) style call */
       
  5933             if (IN_param_value == NULL)
       
  5934               IN_param_value = function_call_param_iterator.next();
       
  5935             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5936             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5937             
       
  5938             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  5939             {
       
  5940         
       
  5941                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  5942                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5943                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  5944                 function_type_prefix = return_type_symbol;
       
  5945                 break;
       
  5946                 
       
  5947             }
       
  5948             
       
  5949             
       
  5950             ERROR;
       
  5951         }
       
  5952         
       
  5953     }/*function_word_to_tod*/
       
  5954     break;
       
  5955 
       
  5956 /****
       
  5957  *WORD_TO_UDINT
       
  5958  */
       
  5959     case function_word_to_udint :
       
  5960     {
       
  5961         symbol_c *last_type_symbol = NULL;
       
  5962 
       
  5963         {
       
  5964             identifier_c param_name("IN");
       
  5965             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5966             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5967             
       
  5968             /* Get the value from a foo(<param_value>) style call */
       
  5969             if (IN_param_value == NULL)
       
  5970               IN_param_value = function_call_param_iterator.next();
       
  5971             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5972             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5973             
       
  5974             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  5975             {
       
  5976         
       
  5977                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  5978                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  5979                 function_type_prefix = return_type_symbol;
       
  5980                 break;
       
  5981                 
       
  5982             }
       
  5983             
       
  5984             
       
  5985             ERROR;
       
  5986         }
       
  5987         
       
  5988     }/*function_word_to_udint*/
       
  5989     break;
       
  5990 
       
  5991 /****
       
  5992  *WORD_TO_STRING
       
  5993  */
       
  5994     case function_word_to_string :
       
  5995     {
       
  5996         symbol_c *last_type_symbol = NULL;
       
  5997 
       
  5998         {
       
  5999             identifier_c param_name("IN");
       
  6000             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6001             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6002             
       
  6003             /* Get the value from a foo(<param_value>) style call */
       
  6004             if (IN_param_value == NULL)
       
  6005               IN_param_value = function_call_param_iterator.next();
       
  6006             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6007             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6008             
       
  6009             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  6010             {
       
  6011         
       
  6012                 function_name = (symbol_c*)(new pragma_c("__bit_to_string"));
       
  6013                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6014                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  6015                 function_type_prefix = return_type_symbol;
       
  6016                 break;
       
  6017                 
       
  6018             }
       
  6019             
       
  6020             
       
  6021             ERROR;
       
  6022         }
       
  6023         
       
  6024     }/*function_word_to_string*/
       
  6025     break;
       
  6026 
       
  6027 /****
       
  6028  *WORD_TO_LWORD
       
  6029  */
       
  6030     case function_word_to_lword :
       
  6031     {
       
  6032         symbol_c *last_type_symbol = NULL;
       
  6033 
       
  6034         {
       
  6035             identifier_c param_name("IN");
       
  6036             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6037             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6038             
       
  6039             /* Get the value from a foo(<param_value>) style call */
       
  6040             if (IN_param_value == NULL)
       
  6041               IN_param_value = function_call_param_iterator.next();
       
  6042             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6043             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6044             
       
  6045             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  6046             {
       
  6047         
       
  6048                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6049                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  6050                 function_type_prefix = return_type_symbol;
       
  6051                 break;
       
  6052                 
       
  6053             }
       
  6054             
       
  6055             
       
  6056             ERROR;
       
  6057         }
       
  6058         
       
  6059     }/*function_word_to_lword*/
       
  6060     break;
       
  6061 
       
  6062 /****
       
  6063  *WORD_TO_UINT
       
  6064  */
       
  6065     case function_word_to_uint :
       
  6066     {
       
  6067         symbol_c *last_type_symbol = NULL;
       
  6068 
       
  6069         {
       
  6070             identifier_c param_name("IN");
       
  6071             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6072             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6073             
       
  6074             /* Get the value from a foo(<param_value>) style call */
       
  6075             if (IN_param_value == NULL)
       
  6076               IN_param_value = function_call_param_iterator.next();
       
  6077             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6078             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6079             
       
  6080             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  6081             {
       
  6082         
       
  6083                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6084                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  6085                 function_type_prefix = return_type_symbol;
       
  6086                 break;
       
  6087                 
       
  6088             }
       
  6089             
       
  6090             
       
  6091             ERROR;
       
  6092         }
       
  6093         
       
  6094     }/*function_word_to_uint*/
       
  6095     break;
       
  6096 
       
  6097 /****
       
  6098  *WORD_TO_LREAL
       
  6099  */
       
  6100     case function_word_to_lreal :
       
  6101     {
       
  6102         symbol_c *last_type_symbol = NULL;
       
  6103 
       
  6104         {
       
  6105             identifier_c param_name("IN");
       
  6106             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6107             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6108             
       
  6109             /* Get the value from a foo(<param_value>) style call */
       
  6110             if (IN_param_value == NULL)
       
  6111               IN_param_value = function_call_param_iterator.next();
       
  6112             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6113             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6114             
       
  6115             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  6116             {
       
  6117         
       
  6118                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6119                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  6120                 function_type_prefix = return_type_symbol;
       
  6121                 break;
       
  6122                 
       
  6123             }
       
  6124             
       
  6125             
       
  6126             ERROR;
       
  6127         }
       
  6128         
       
  6129     }/*function_word_to_lreal*/
       
  6130     break;
       
  6131 
       
  6132 /****
       
  6133  *WORD_TO_BYTE
       
  6134  */
       
  6135     case function_word_to_byte :
       
  6136     {
       
  6137         symbol_c *last_type_symbol = NULL;
       
  6138 
       
  6139         {
       
  6140             identifier_c param_name("IN");
       
  6141             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6142             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6143             
       
  6144             /* Get the value from a foo(<param_value>) style call */
       
  6145             if (IN_param_value == NULL)
       
  6146               IN_param_value = function_call_param_iterator.next();
       
  6147             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6148             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6149             
       
  6150             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  6151             {
       
  6152         
       
  6153                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6154                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  6155                 function_type_prefix = return_type_symbol;
       
  6156                 break;
       
  6157                 
       
  6158             }
       
  6159             
       
  6160             
       
  6161             ERROR;
       
  6162         }
       
  6163         
       
  6164     }/*function_word_to_byte*/
       
  6165     break;
       
  6166 
       
  6167 /****
       
  6168  *WORD_TO_USINT
       
  6169  */
       
  6170     case function_word_to_usint :
       
  6171     {
       
  6172         symbol_c *last_type_symbol = NULL;
       
  6173 
       
  6174         {
       
  6175             identifier_c param_name("IN");
       
  6176             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6177             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6178             
       
  6179             /* Get the value from a foo(<param_value>) style call */
       
  6180             if (IN_param_value == NULL)
       
  6181               IN_param_value = function_call_param_iterator.next();
       
  6182             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6183             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6184             
       
  6185             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  6186             {
       
  6187         
       
  6188                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6189                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  6190                 function_type_prefix = return_type_symbol;
       
  6191                 break;
       
  6192                 
       
  6193             }
       
  6194             
       
  6195             
       
  6196             ERROR;
       
  6197         }
       
  6198         
       
  6199     }/*function_word_to_usint*/
       
  6200     break;
       
  6201 
       
  6202 /****
       
  6203  *WORD_TO_ULINT
       
  6204  */
       
  6205     case function_word_to_ulint :
       
  6206     {
       
  6207         symbol_c *last_type_symbol = NULL;
       
  6208 
       
  6209         {
       
  6210             identifier_c param_name("IN");
       
  6211             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6212             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6213             
       
  6214             /* Get the value from a foo(<param_value>) style call */
       
  6215             if (IN_param_value == NULL)
       
  6216               IN_param_value = function_call_param_iterator.next();
       
  6217             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6218             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6219             
       
  6220             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  6221             {
       
  6222         
       
  6223                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6224                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  6225                 function_type_prefix = return_type_symbol;
       
  6226                 break;
       
  6227                 
       
  6228             }
       
  6229             
       
  6230             
       
  6231             ERROR;
       
  6232         }
       
  6233         
       
  6234     }/*function_word_to_ulint*/
       
  6235     break;
       
  6236 
       
  6237 /****
       
  6238  *WORD_TO_BOOL
       
  6239  */
       
  6240     case function_word_to_bool :
       
  6241     {
       
  6242         symbol_c *last_type_symbol = NULL;
       
  6243 
       
  6244         {
       
  6245             identifier_c param_name("IN");
       
  6246             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6247             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6248             
       
  6249             /* Get the value from a foo(<param_value>) style call */
       
  6250             if (IN_param_value == NULL)
       
  6251               IN_param_value = function_call_param_iterator.next();
       
  6252             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6253             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6254             
       
  6255             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  6256             {
       
  6257         
       
  6258                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6259                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  6260                 function_type_prefix = return_type_symbol;
       
  6261                 break;
       
  6262                 
       
  6263             }
       
  6264             
       
  6265             
       
  6266             ERROR;
       
  6267         }
       
  6268         
       
  6269     }/*function_word_to_bool*/
       
  6270     break;
       
  6271 
       
  6272 /****
       
  6273  *WORD_TO_TIME
       
  6274  */
       
  6275     case function_word_to_time :
       
  6276     {
       
  6277         symbol_c *last_type_symbol = NULL;
       
  6278 
       
  6279         {
       
  6280             identifier_c param_name("IN");
       
  6281             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6282             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6283             
       
  6284             /* Get the value from a foo(<param_value>) style call */
       
  6285             if (IN_param_value == NULL)
       
  6286               IN_param_value = function_call_param_iterator.next();
       
  6287             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6288             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6289             
       
  6290             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  6291             {
       
  6292         
       
  6293                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  6294                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6295                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  6296                 function_type_prefix = return_type_symbol;
       
  6297                 break;
       
  6298                 
       
  6299             }
       
  6300             
       
  6301             
       
  6302             ERROR;
       
  6303         }
       
  6304         
       
  6305     }/*function_word_to_time*/
       
  6306     break;
       
  6307 
       
  6308 /****
       
  6309  *WORD_TO_INT
       
  6310  */
       
  6311     case function_word_to_int :
       
  6312     {
       
  6313         symbol_c *last_type_symbol = NULL;
       
  6314 
       
  6315         {
       
  6316             identifier_c param_name("IN");
       
  6317             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6318             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6319             
       
  6320             /* Get the value from a foo(<param_value>) style call */
       
  6321             if (IN_param_value == NULL)
       
  6322               IN_param_value = function_call_param_iterator.next();
       
  6323             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6324             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6325             
       
  6326             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
  6327             {
       
  6328         
       
  6329                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6330                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  6331                 function_type_prefix = return_type_symbol;
       
  6332                 break;
       
  6333                 
       
  6334             }
       
  6335             
       
  6336             
       
  6337             ERROR;
       
  6338         }
       
  6339         
       
  6340     }/*function_word_to_int*/
       
  6341     break;
       
  6342 
       
  6343 /****
       
  6344  *STRING_TO_REAL
       
  6345  */
       
  6346     case function_string_to_real :
       
  6347     {
       
  6348         symbol_c *last_type_symbol = NULL;
       
  6349 
       
  6350         {
       
  6351             identifier_c param_name("IN");
       
  6352             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6353             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6354             
       
  6355             /* Get the value from a foo(<param_value>) style call */
       
  6356             if (IN_param_value == NULL)
       
  6357               IN_param_value = function_call_param_iterator.next();
       
  6358             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6359             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6360             
       
  6361             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6362             {
       
  6363         
       
  6364                 function_name = (symbol_c*)(new pragma_c("__string_to_real"));
       
  6365                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6366                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  6367                 function_type_prefix = return_type_symbol;
       
  6368                 break;
       
  6369                 
       
  6370             }
       
  6371             
       
  6372             
       
  6373             ERROR;
       
  6374         }
       
  6375         
       
  6376     }/*function_string_to_real*/
       
  6377     break;
       
  6378 
       
  6379 /****
       
  6380  *STRING_TO_SINT
       
  6381  */
       
  6382     case function_string_to_sint :
       
  6383     {
       
  6384         symbol_c *last_type_symbol = NULL;
       
  6385 
       
  6386         {
       
  6387             identifier_c param_name("IN");
       
  6388             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6389             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6390             
       
  6391             /* Get the value from a foo(<param_value>) style call */
       
  6392             if (IN_param_value == NULL)
       
  6393               IN_param_value = function_call_param_iterator.next();
       
  6394             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6395             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6396             
       
  6397             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6398             {
       
  6399         
       
  6400                 function_name = (symbol_c*)(new pragma_c("__string_to_sint"));
       
  6401                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6402                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  6403                 function_type_prefix = return_type_symbol;
       
  6404                 break;
       
  6405                 
       
  6406             }
       
  6407             
       
  6408             
       
  6409             ERROR;
       
  6410         }
       
  6411         
       
  6412     }/*function_string_to_sint*/
       
  6413     break;
       
  6414 
       
  6415 /****
       
  6416  *STRING_TO_LINT
       
  6417  */
       
  6418     case function_string_to_lint :
       
  6419     {
       
  6420         symbol_c *last_type_symbol = NULL;
       
  6421 
       
  6422         {
       
  6423             identifier_c param_name("IN");
       
  6424             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6425             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6426             
       
  6427             /* Get the value from a foo(<param_value>) style call */
       
  6428             if (IN_param_value == NULL)
       
  6429               IN_param_value = function_call_param_iterator.next();
       
  6430             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6431             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6432             
       
  6433             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6434             {
       
  6435         
       
  6436                 function_name = (symbol_c*)(new pragma_c("__string_to_sint"));
       
  6437                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6438                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  6439                 function_type_prefix = return_type_symbol;
       
  6440                 break;
       
  6441                 
       
  6442             }
       
  6443             
       
  6444             
       
  6445             ERROR;
       
  6446         }
       
  6447         
       
  6448     }/*function_string_to_lint*/
       
  6449     break;
       
  6450 
       
  6451 /****
       
  6452  *STRING_TO_DINT
       
  6453  */
       
  6454     case function_string_to_dint :
       
  6455     {
       
  6456         symbol_c *last_type_symbol = NULL;
       
  6457 
       
  6458         {
       
  6459             identifier_c param_name("IN");
       
  6460             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6461             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6462             
       
  6463             /* Get the value from a foo(<param_value>) style call */
       
  6464             if (IN_param_value == NULL)
       
  6465               IN_param_value = function_call_param_iterator.next();
       
  6466             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6467             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6468             
       
  6469             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6470             {
       
  6471         
       
  6472                 function_name = (symbol_c*)(new pragma_c("__string_to_sint"));
       
  6473                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6474                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  6475                 function_type_prefix = return_type_symbol;
       
  6476                 break;
       
  6477                 
       
  6478             }
       
  6479             
       
  6480             
       
  6481             ERROR;
       
  6482         }
       
  6483         
       
  6484     }/*function_string_to_dint*/
       
  6485     break;
       
  6486 
       
  6487 /****
       
  6488  *STRING_TO_DATE
       
  6489  */
       
  6490     case function_string_to_date :
       
  6491     {
       
  6492         symbol_c *last_type_symbol = NULL;
       
  6493 
       
  6494         {
       
  6495             identifier_c param_name("IN");
       
  6496             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6497             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6498             
       
  6499             /* Get the value from a foo(<param_value>) style call */
       
  6500             if (IN_param_value == NULL)
       
  6501               IN_param_value = function_call_param_iterator.next();
       
  6502             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6503             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6504             
       
  6505             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6506             {
       
  6507         
       
  6508                 function_name = (symbol_c*)(new pragma_c("__string_to_time"));
       
  6509                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6510                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  6511                 function_type_prefix = return_type_symbol;
       
  6512                 break;
       
  6513                 
       
  6514             }
       
  6515             
       
  6516             
       
  6517             ERROR;
       
  6518         }
       
  6519         
       
  6520     }/*function_string_to_date*/
       
  6521     break;
       
  6522 
       
  6523 /****
       
  6524  *STRING_TO_DWORD
       
  6525  */
       
  6526     case function_string_to_dword :
       
  6527     {
       
  6528         symbol_c *last_type_symbol = NULL;
       
  6529 
       
  6530         {
       
  6531             identifier_c param_name("IN");
       
  6532             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6533             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6534             
       
  6535             /* Get the value from a foo(<param_value>) style call */
       
  6536             if (IN_param_value == NULL)
       
  6537               IN_param_value = function_call_param_iterator.next();
       
  6538             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6539             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6540             
       
  6541             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6542             {
       
  6543         
       
  6544                 function_name = (symbol_c*)(new pragma_c("__string_to_bit"));
       
  6545                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6546                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  6547                 function_type_prefix = return_type_symbol;
       
  6548                 break;
       
  6549                 
       
  6550             }
       
  6551             
       
  6552             
       
  6553             ERROR;
       
  6554         }
       
  6555         
       
  6556     }/*function_string_to_dword*/
       
  6557     break;
       
  6558 
       
  6559 /****
       
  6560  *STRING_TO_DT
       
  6561  */
       
  6562     case function_string_to_dt :
       
  6563     {
       
  6564         symbol_c *last_type_symbol = NULL;
       
  6565 
       
  6566         {
       
  6567             identifier_c param_name("IN");
       
  6568             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6569             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6570             
       
  6571             /* Get the value from a foo(<param_value>) style call */
       
  6572             if (IN_param_value == NULL)
       
  6573               IN_param_value = function_call_param_iterator.next();
       
  6574             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6575             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6576             
       
  6577             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6578             {
       
  6579         
       
  6580                 function_name = (symbol_c*)(new pragma_c("__string_to_time"));
       
  6581                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6582                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  6583                 function_type_prefix = return_type_symbol;
       
  6584                 break;
       
  6585                 
       
  6586             }
       
  6587             
       
  6588             
       
  6589             ERROR;
       
  6590         }
       
  6591         
       
  6592     }/*function_string_to_dt*/
       
  6593     break;
       
  6594 
       
  6595 /****
       
  6596  *STRING_TO_TOD
       
  6597  */
       
  6598     case function_string_to_tod :
       
  6599     {
       
  6600         symbol_c *last_type_symbol = NULL;
       
  6601 
       
  6602         {
       
  6603             identifier_c param_name("IN");
       
  6604             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6605             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6606             
       
  6607             /* Get the value from a foo(<param_value>) style call */
       
  6608             if (IN_param_value == NULL)
       
  6609               IN_param_value = function_call_param_iterator.next();
       
  6610             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6611             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6612             
       
  6613             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6614             {
       
  6615         
       
  6616                 function_name = (symbol_c*)(new pragma_c("__string_to_time"));
       
  6617                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6618                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  6619                 function_type_prefix = return_type_symbol;
       
  6620                 break;
       
  6621                 
       
  6622             }
       
  6623             
       
  6624             
       
  6625             ERROR;
       
  6626         }
       
  6627         
       
  6628     }/*function_string_to_tod*/
       
  6629     break;
       
  6630 
       
  6631 /****
       
  6632  *STRING_TO_UDINT
       
  6633  */
       
  6634     case function_string_to_udint :
       
  6635     {
       
  6636         symbol_c *last_type_symbol = NULL;
       
  6637 
       
  6638         {
       
  6639             identifier_c param_name("IN");
       
  6640             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6641             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6642             
       
  6643             /* Get the value from a foo(<param_value>) style call */
       
  6644             if (IN_param_value == NULL)
       
  6645               IN_param_value = function_call_param_iterator.next();
       
  6646             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6647             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6648             
       
  6649             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6650             {
       
  6651         
       
  6652                 function_name = (symbol_c*)(new pragma_c("__string_to_uint"));
       
  6653                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6654                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  6655                 function_type_prefix = return_type_symbol;
       
  6656                 break;
       
  6657                 
       
  6658             }
       
  6659             
       
  6660             
       
  6661             ERROR;
       
  6662         }
       
  6663         
       
  6664     }/*function_string_to_udint*/
       
  6665     break;
       
  6666 
       
  6667 /****
       
  6668  *STRING_TO_WORD
       
  6669  */
       
  6670     case function_string_to_word :
       
  6671     {
       
  6672         symbol_c *last_type_symbol = NULL;
       
  6673 
       
  6674         {
       
  6675             identifier_c param_name("IN");
       
  6676             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6677             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6678             
       
  6679             /* Get the value from a foo(<param_value>) style call */
       
  6680             if (IN_param_value == NULL)
       
  6681               IN_param_value = function_call_param_iterator.next();
       
  6682             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6683             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6684             
       
  6685             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6686             {
       
  6687         
       
  6688                 function_name = (symbol_c*)(new pragma_c("__string_to_bit"));
       
  6689                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6690                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  6691                 function_type_prefix = return_type_symbol;
       
  6692                 break;
       
  6693                 
       
  6694             }
       
  6695             
       
  6696             
       
  6697             ERROR;
       
  6698         }
       
  6699         
       
  6700     }/*function_string_to_word*/
       
  6701     break;
       
  6702 
       
  6703 /****
       
  6704  *STRING_TO_LWORD
       
  6705  */
       
  6706     case function_string_to_lword :
       
  6707     {
       
  6708         symbol_c *last_type_symbol = NULL;
       
  6709 
       
  6710         {
       
  6711             identifier_c param_name("IN");
       
  6712             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6713             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6714             
       
  6715             /* Get the value from a foo(<param_value>) style call */
       
  6716             if (IN_param_value == NULL)
       
  6717               IN_param_value = function_call_param_iterator.next();
       
  6718             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6719             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6720             
       
  6721             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6722             {
       
  6723         
       
  6724                 function_name = (symbol_c*)(new pragma_c("__string_to_bit"));
       
  6725                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6726                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  6727                 function_type_prefix = return_type_symbol;
       
  6728                 break;
       
  6729                 
       
  6730             }
       
  6731             
       
  6732             
       
  6733             ERROR;
       
  6734         }
       
  6735         
       
  6736     }/*function_string_to_lword*/
       
  6737     break;
       
  6738 
       
  6739 /****
       
  6740  *STRING_TO_UINT
       
  6741  */
       
  6742     case function_string_to_uint :
       
  6743     {
       
  6744         symbol_c *last_type_symbol = NULL;
       
  6745 
       
  6746         {
       
  6747             identifier_c param_name("IN");
       
  6748             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6749             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6750             
       
  6751             /* Get the value from a foo(<param_value>) style call */
       
  6752             if (IN_param_value == NULL)
       
  6753               IN_param_value = function_call_param_iterator.next();
       
  6754             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6755             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6756             
       
  6757             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6758             {
       
  6759         
       
  6760                 function_name = (symbol_c*)(new pragma_c("__string_to_uint"));
       
  6761                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6762                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  6763                 function_type_prefix = return_type_symbol;
       
  6764                 break;
       
  6765                 
       
  6766             }
       
  6767             
       
  6768             
       
  6769             ERROR;
       
  6770         }
       
  6771         
       
  6772     }/*function_string_to_uint*/
       
  6773     break;
       
  6774 
       
  6775 /****
       
  6776  *STRING_TO_LREAL
       
  6777  */
       
  6778     case function_string_to_lreal :
       
  6779     {
       
  6780         symbol_c *last_type_symbol = NULL;
       
  6781 
       
  6782         {
       
  6783             identifier_c param_name("IN");
       
  6784             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6785             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6786             
       
  6787             /* Get the value from a foo(<param_value>) style call */
       
  6788             if (IN_param_value == NULL)
       
  6789               IN_param_value = function_call_param_iterator.next();
       
  6790             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6791             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6792             
       
  6793             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6794             {
       
  6795         
       
  6796                 function_name = (symbol_c*)(new pragma_c("__string_to_real"));
       
  6797                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6798                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  6799                 function_type_prefix = return_type_symbol;
       
  6800                 break;
       
  6801                 
       
  6802             }
       
  6803             
       
  6804             
       
  6805             ERROR;
       
  6806         }
       
  6807         
       
  6808     }/*function_string_to_lreal*/
       
  6809     break;
       
  6810 
       
  6811 /****
       
  6812  *STRING_TO_BYTE
       
  6813  */
       
  6814     case function_string_to_byte :
       
  6815     {
       
  6816         symbol_c *last_type_symbol = NULL;
       
  6817 
       
  6818         {
       
  6819             identifier_c param_name("IN");
       
  6820             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6821             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6822             
       
  6823             /* Get the value from a foo(<param_value>) style call */
       
  6824             if (IN_param_value == NULL)
       
  6825               IN_param_value = function_call_param_iterator.next();
       
  6826             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6827             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6828             
       
  6829             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6830             {
       
  6831         
       
  6832                 function_name = (symbol_c*)(new pragma_c("__string_to_bit"));
       
  6833                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6834                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  6835                 function_type_prefix = return_type_symbol;
       
  6836                 break;
       
  6837                 
       
  6838             }
       
  6839             
       
  6840             
       
  6841             ERROR;
       
  6842         }
       
  6843         
       
  6844     }/*function_string_to_byte*/
       
  6845     break;
       
  6846 
       
  6847 /****
       
  6848  *STRING_TO_USINT
       
  6849  */
       
  6850     case function_string_to_usint :
       
  6851     {
       
  6852         symbol_c *last_type_symbol = NULL;
       
  6853 
       
  6854         {
       
  6855             identifier_c param_name("IN");
       
  6856             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6857             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6858             
       
  6859             /* Get the value from a foo(<param_value>) style call */
       
  6860             if (IN_param_value == NULL)
       
  6861               IN_param_value = function_call_param_iterator.next();
       
  6862             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6863             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6864             
       
  6865             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6866             {
       
  6867         
       
  6868                 function_name = (symbol_c*)(new pragma_c("__string_to_uint"));
       
  6869                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6870                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  6871                 function_type_prefix = return_type_symbol;
       
  6872                 break;
       
  6873                 
       
  6874             }
       
  6875             
       
  6876             
       
  6877             ERROR;
       
  6878         }
       
  6879         
       
  6880     }/*function_string_to_usint*/
       
  6881     break;
       
  6882 
       
  6883 /****
       
  6884  *STRING_TO_ULINT
       
  6885  */
       
  6886     case function_string_to_ulint :
       
  6887     {
       
  6888         symbol_c *last_type_symbol = NULL;
       
  6889 
       
  6890         {
       
  6891             identifier_c param_name("IN");
       
  6892             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6893             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6894             
       
  6895             /* Get the value from a foo(<param_value>) style call */
       
  6896             if (IN_param_value == NULL)
       
  6897               IN_param_value = function_call_param_iterator.next();
       
  6898             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6899             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6900             
       
  6901             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6902             {
       
  6903         
       
  6904                 function_name = (symbol_c*)(new pragma_c("__string_to_uint"));
       
  6905                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6906                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  6907                 function_type_prefix = return_type_symbol;
       
  6908                 break;
       
  6909                 
       
  6910             }
       
  6911             
       
  6912             
       
  6913             ERROR;
       
  6914         }
       
  6915         
       
  6916     }/*function_string_to_ulint*/
       
  6917     break;
       
  6918 
       
  6919 /****
       
  6920  *STRING_TO_BOOL
       
  6921  */
       
  6922     case function_string_to_bool :
       
  6923     {
       
  6924         symbol_c *last_type_symbol = NULL;
       
  6925 
       
  6926         {
       
  6927             identifier_c param_name("IN");
       
  6928             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6929             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6930             
       
  6931             /* Get the value from a foo(<param_value>) style call */
       
  6932             if (IN_param_value == NULL)
       
  6933               IN_param_value = function_call_param_iterator.next();
       
  6934             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6935             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6936             
       
  6937             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6938             {
       
  6939         
       
  6940                 function_name = (symbol_c*)(new pragma_c("__string_to_bool"));
       
  6941                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6942                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  6943                 function_type_prefix = return_type_symbol;
       
  6944                 break;
       
  6945                 
       
  6946             }
       
  6947             
       
  6948             
       
  6949             ERROR;
       
  6950         }
       
  6951         
       
  6952     }/*function_string_to_bool*/
       
  6953     break;
       
  6954 
       
  6955 /****
       
  6956  *STRING_TO_TIME
       
  6957  */
       
  6958     case function_string_to_time :
       
  6959     {
       
  6960         symbol_c *last_type_symbol = NULL;
       
  6961 
       
  6962         {
       
  6963             identifier_c param_name("IN");
       
  6964             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6965             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6966             
       
  6967             /* Get the value from a foo(<param_value>) style call */
       
  6968             if (IN_param_value == NULL)
       
  6969               IN_param_value = function_call_param_iterator.next();
       
  6970             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6971             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6972             
       
  6973             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  6974             {
       
  6975         
       
  6976                 function_name = (symbol_c*)(new pragma_c("__string_to_time"));
       
  6977                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  6978                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  6979                 function_type_prefix = return_type_symbol;
       
  6980                 break;
       
  6981                 
       
  6982             }
       
  6983             
       
  6984             
       
  6985             ERROR;
       
  6986         }
       
  6987         
       
  6988     }/*function_string_to_time*/
       
  6989     break;
       
  6990 
       
  6991 /****
       
  6992  *STRING_TO_INT
       
  6993  */
       
  6994     case function_string_to_int :
       
  6995     {
       
  6996         symbol_c *last_type_symbol = NULL;
       
  6997 
       
  6998         {
       
  6999             identifier_c param_name("IN");
       
  7000             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7001             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7002             
       
  7003             /* Get the value from a foo(<param_value>) style call */
       
  7004             if (IN_param_value == NULL)
       
  7005               IN_param_value = function_call_param_iterator.next();
       
  7006             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7007             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7008             
       
  7009             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  7010             {
       
  7011         
       
  7012                 function_name = (symbol_c*)(new pragma_c("__string_to_sint"));
       
  7013                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7014                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  7015                 function_type_prefix = return_type_symbol;
       
  7016                 break;
       
  7017                 
       
  7018             }
       
  7019             
       
  7020             
       
  7021             ERROR;
       
  7022         }
       
  7023         
       
  7024     }/*function_string_to_int*/
       
  7025     break;
       
  7026 
       
  7027 /****
       
  7028  *LWORD_TO_REAL
       
  7029  */
       
  7030     case function_lword_to_real :
       
  7031     {
       
  7032         symbol_c *last_type_symbol = NULL;
       
  7033 
       
  7034         {
       
  7035             identifier_c param_name("IN");
       
  7036             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7037             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7038             
       
  7039             /* Get the value from a foo(<param_value>) style call */
       
  7040             if (IN_param_value == NULL)
       
  7041               IN_param_value = function_call_param_iterator.next();
       
  7042             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7043             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7044             
       
  7045             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7046             {
       
  7047         
       
  7048                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7049                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  7050                 function_type_prefix = return_type_symbol;
       
  7051                 break;
       
  7052                 
       
  7053             }
       
  7054             
       
  7055             
       
  7056             ERROR;
       
  7057         }
       
  7058         
       
  7059     }/*function_lword_to_real*/
       
  7060     break;
       
  7061 
       
  7062 /****
       
  7063  *LWORD_TO_SINT
       
  7064  */
       
  7065     case function_lword_to_sint :
       
  7066     {
       
  7067         symbol_c *last_type_symbol = NULL;
       
  7068 
       
  7069         {
       
  7070             identifier_c param_name("IN");
       
  7071             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7072             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7073             
       
  7074             /* Get the value from a foo(<param_value>) style call */
       
  7075             if (IN_param_value == NULL)
       
  7076               IN_param_value = function_call_param_iterator.next();
       
  7077             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7078             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7079             
       
  7080             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7081             {
       
  7082         
       
  7083                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7084                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  7085                 function_type_prefix = return_type_symbol;
       
  7086                 break;
       
  7087                 
       
  7088             }
       
  7089             
       
  7090             
       
  7091             ERROR;
       
  7092         }
       
  7093         
       
  7094     }/*function_lword_to_sint*/
       
  7095     break;
       
  7096 
       
  7097 /****
       
  7098  *LWORD_TO_LINT
       
  7099  */
       
  7100     case function_lword_to_lint :
       
  7101     {
       
  7102         symbol_c *last_type_symbol = NULL;
       
  7103 
       
  7104         {
       
  7105             identifier_c param_name("IN");
       
  7106             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7107             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7108             
       
  7109             /* Get the value from a foo(<param_value>) style call */
       
  7110             if (IN_param_value == NULL)
       
  7111               IN_param_value = function_call_param_iterator.next();
       
  7112             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7113             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7114             
       
  7115             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7116             {
       
  7117         
       
  7118                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7119                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  7120                 function_type_prefix = return_type_symbol;
       
  7121                 break;
       
  7122                 
       
  7123             }
       
  7124             
       
  7125             
       
  7126             ERROR;
       
  7127         }
       
  7128         
       
  7129     }/*function_lword_to_lint*/
       
  7130     break;
       
  7131 
       
  7132 /****
       
  7133  *LWORD_TO_DINT
       
  7134  */
       
  7135     case function_lword_to_dint :
       
  7136     {
       
  7137         symbol_c *last_type_symbol = NULL;
       
  7138 
       
  7139         {
       
  7140             identifier_c param_name("IN");
       
  7141             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7142             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7143             
       
  7144             /* Get the value from a foo(<param_value>) style call */
       
  7145             if (IN_param_value == NULL)
       
  7146               IN_param_value = function_call_param_iterator.next();
       
  7147             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7148             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7149             
       
  7150             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7151             {
       
  7152         
       
  7153                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7154                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  7155                 function_type_prefix = return_type_symbol;
       
  7156                 break;
       
  7157                 
       
  7158             }
       
  7159             
       
  7160             
       
  7161             ERROR;
       
  7162         }
       
  7163         
       
  7164     }/*function_lword_to_dint*/
       
  7165     break;
       
  7166 
       
  7167 /****
       
  7168  *LWORD_TO_DATE
       
  7169  */
       
  7170     case function_lword_to_date :
       
  7171     {
       
  7172         symbol_c *last_type_symbol = NULL;
       
  7173 
       
  7174         {
       
  7175             identifier_c param_name("IN");
       
  7176             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7177             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7178             
       
  7179             /* Get the value from a foo(<param_value>) style call */
       
  7180             if (IN_param_value == NULL)
       
  7181               IN_param_value = function_call_param_iterator.next();
       
  7182             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7183             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7184             
       
  7185             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7186             {
       
  7187         
       
  7188                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  7189                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7190                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  7191                 function_type_prefix = return_type_symbol;
       
  7192                 break;
       
  7193                 
       
  7194             }
       
  7195             
       
  7196             
       
  7197             ERROR;
       
  7198         }
       
  7199         
       
  7200     }/*function_lword_to_date*/
       
  7201     break;
       
  7202 
       
  7203 /****
       
  7204  *LWORD_TO_DWORD
       
  7205  */
       
  7206     case function_lword_to_dword :
       
  7207     {
       
  7208         symbol_c *last_type_symbol = NULL;
       
  7209 
       
  7210         {
       
  7211             identifier_c param_name("IN");
       
  7212             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7213             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7214             
       
  7215             /* Get the value from a foo(<param_value>) style call */
       
  7216             if (IN_param_value == NULL)
       
  7217               IN_param_value = function_call_param_iterator.next();
       
  7218             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7219             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7220             
       
  7221             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7222             {
       
  7223         
       
  7224                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7225                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  7226                 function_type_prefix = return_type_symbol;
       
  7227                 break;
       
  7228                 
       
  7229             }
       
  7230             
       
  7231             
       
  7232             ERROR;
       
  7233         }
       
  7234         
       
  7235     }/*function_lword_to_dword*/
       
  7236     break;
       
  7237 
       
  7238 /****
       
  7239  *LWORD_TO_DT
       
  7240  */
       
  7241     case function_lword_to_dt :
       
  7242     {
       
  7243         symbol_c *last_type_symbol = NULL;
       
  7244 
       
  7245         {
       
  7246             identifier_c param_name("IN");
       
  7247             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7248             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7249             
       
  7250             /* Get the value from a foo(<param_value>) style call */
       
  7251             if (IN_param_value == NULL)
       
  7252               IN_param_value = function_call_param_iterator.next();
       
  7253             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7254             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7255             
       
  7256             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7257             {
       
  7258         
       
  7259                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  7260                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7261                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  7262                 function_type_prefix = return_type_symbol;
       
  7263                 break;
       
  7264                 
       
  7265             }
       
  7266             
       
  7267             
       
  7268             ERROR;
       
  7269         }
       
  7270         
       
  7271     }/*function_lword_to_dt*/
       
  7272     break;
       
  7273 
       
  7274 /****
       
  7275  *LWORD_TO_TOD
       
  7276  */
       
  7277     case function_lword_to_tod :
       
  7278     {
       
  7279         symbol_c *last_type_symbol = NULL;
       
  7280 
       
  7281         {
       
  7282             identifier_c param_name("IN");
       
  7283             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7284             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7285             
       
  7286             /* Get the value from a foo(<param_value>) style call */
       
  7287             if (IN_param_value == NULL)
       
  7288               IN_param_value = function_call_param_iterator.next();
       
  7289             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7290             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7291             
       
  7292             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7293             {
       
  7294         
       
  7295                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  7296                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7297                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  7298                 function_type_prefix = return_type_symbol;
       
  7299                 break;
       
  7300                 
       
  7301             }
       
  7302             
       
  7303             
       
  7304             ERROR;
       
  7305         }
       
  7306         
       
  7307     }/*function_lword_to_tod*/
       
  7308     break;
       
  7309 
       
  7310 /****
       
  7311  *LWORD_TO_UDINT
       
  7312  */
       
  7313     case function_lword_to_udint :
       
  7314     {
       
  7315         symbol_c *last_type_symbol = NULL;
       
  7316 
       
  7317         {
       
  7318             identifier_c param_name("IN");
       
  7319             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7320             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7321             
       
  7322             /* Get the value from a foo(<param_value>) style call */
       
  7323             if (IN_param_value == NULL)
       
  7324               IN_param_value = function_call_param_iterator.next();
       
  7325             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7326             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7327             
       
  7328             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7329             {
       
  7330         
       
  7331                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7332                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  7333                 function_type_prefix = return_type_symbol;
       
  7334                 break;
       
  7335                 
       
  7336             }
       
  7337             
       
  7338             
       
  7339             ERROR;
       
  7340         }
       
  7341         
       
  7342     }/*function_lword_to_udint*/
       
  7343     break;
       
  7344 
       
  7345 /****
       
  7346  *LWORD_TO_WORD
       
  7347  */
       
  7348     case function_lword_to_word :
       
  7349     {
       
  7350         symbol_c *last_type_symbol = NULL;
       
  7351 
       
  7352         {
       
  7353             identifier_c param_name("IN");
       
  7354             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7355             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7356             
       
  7357             /* Get the value from a foo(<param_value>) style call */
       
  7358             if (IN_param_value == NULL)
       
  7359               IN_param_value = function_call_param_iterator.next();
       
  7360             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7361             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7362             
       
  7363             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7364             {
       
  7365         
       
  7366                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7367                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  7368                 function_type_prefix = return_type_symbol;
       
  7369                 break;
       
  7370                 
       
  7371             }
       
  7372             
       
  7373             
       
  7374             ERROR;
       
  7375         }
       
  7376         
       
  7377     }/*function_lword_to_word*/
       
  7378     break;
       
  7379 
       
  7380 /****
       
  7381  *LWORD_TO_STRING
       
  7382  */
       
  7383     case function_lword_to_string :
       
  7384     {
       
  7385         symbol_c *last_type_symbol = NULL;
       
  7386 
       
  7387         {
       
  7388             identifier_c param_name("IN");
       
  7389             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7390             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7391             
       
  7392             /* Get the value from a foo(<param_value>) style call */
       
  7393             if (IN_param_value == NULL)
       
  7394               IN_param_value = function_call_param_iterator.next();
       
  7395             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7396             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7397             
       
  7398             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7399             {
       
  7400         
       
  7401                 function_name = (symbol_c*)(new pragma_c("__bit_to_string"));
       
  7402                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7403                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  7404                 function_type_prefix = return_type_symbol;
       
  7405                 break;
       
  7406                 
       
  7407             }
       
  7408             
       
  7409             
       
  7410             ERROR;
       
  7411         }
       
  7412         
       
  7413     }/*function_lword_to_string*/
       
  7414     break;
       
  7415 
       
  7416 /****
       
  7417  *LWORD_TO_UINT
       
  7418  */
       
  7419     case function_lword_to_uint :
       
  7420     {
       
  7421         symbol_c *last_type_symbol = NULL;
       
  7422 
       
  7423         {
       
  7424             identifier_c param_name("IN");
       
  7425             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7426             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7427             
       
  7428             /* Get the value from a foo(<param_value>) style call */
       
  7429             if (IN_param_value == NULL)
       
  7430               IN_param_value = function_call_param_iterator.next();
       
  7431             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7432             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7433             
       
  7434             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7435             {
       
  7436         
       
  7437                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7438                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  7439                 function_type_prefix = return_type_symbol;
       
  7440                 break;
       
  7441                 
       
  7442             }
       
  7443             
       
  7444             
       
  7445             ERROR;
       
  7446         }
       
  7447         
       
  7448     }/*function_lword_to_uint*/
       
  7449     break;
       
  7450 
       
  7451 /****
       
  7452  *LWORD_TO_LREAL
       
  7453  */
       
  7454     case function_lword_to_lreal :
       
  7455     {
       
  7456         symbol_c *last_type_symbol = NULL;
       
  7457 
       
  7458         {
       
  7459             identifier_c param_name("IN");
       
  7460             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7461             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7462             
       
  7463             /* Get the value from a foo(<param_value>) style call */
       
  7464             if (IN_param_value == NULL)
       
  7465               IN_param_value = function_call_param_iterator.next();
       
  7466             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7467             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7468             
       
  7469             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7470             {
       
  7471         
       
  7472                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7473                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  7474                 function_type_prefix = return_type_symbol;
       
  7475                 break;
       
  7476                 
       
  7477             }
       
  7478             
       
  7479             
       
  7480             ERROR;
       
  7481         }
       
  7482         
       
  7483     }/*function_lword_to_lreal*/
       
  7484     break;
       
  7485 
       
  7486 /****
       
  7487  *LWORD_TO_BYTE
       
  7488  */
       
  7489     case function_lword_to_byte :
       
  7490     {
       
  7491         symbol_c *last_type_symbol = NULL;
       
  7492 
       
  7493         {
       
  7494             identifier_c param_name("IN");
       
  7495             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7496             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7497             
       
  7498             /* Get the value from a foo(<param_value>) style call */
       
  7499             if (IN_param_value == NULL)
       
  7500               IN_param_value = function_call_param_iterator.next();
       
  7501             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7502             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7503             
       
  7504             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7505             {
       
  7506         
       
  7507                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7508                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  7509                 function_type_prefix = return_type_symbol;
       
  7510                 break;
       
  7511                 
       
  7512             }
       
  7513             
       
  7514             
       
  7515             ERROR;
       
  7516         }
       
  7517         
       
  7518     }/*function_lword_to_byte*/
       
  7519     break;
       
  7520 
       
  7521 /****
       
  7522  *LWORD_TO_USINT
       
  7523  */
       
  7524     case function_lword_to_usint :
       
  7525     {
       
  7526         symbol_c *last_type_symbol = NULL;
       
  7527 
       
  7528         {
       
  7529             identifier_c param_name("IN");
       
  7530             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7531             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7532             
       
  7533             /* Get the value from a foo(<param_value>) style call */
       
  7534             if (IN_param_value == NULL)
       
  7535               IN_param_value = function_call_param_iterator.next();
       
  7536             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7537             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7538             
       
  7539             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7540             {
       
  7541         
       
  7542                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7543                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  7544                 function_type_prefix = return_type_symbol;
       
  7545                 break;
       
  7546                 
       
  7547             }
       
  7548             
       
  7549             
       
  7550             ERROR;
       
  7551         }
       
  7552         
       
  7553     }/*function_lword_to_usint*/
       
  7554     break;
       
  7555 
       
  7556 /****
       
  7557  *LWORD_TO_ULINT
       
  7558  */
       
  7559     case function_lword_to_ulint :
       
  7560     {
       
  7561         symbol_c *last_type_symbol = NULL;
       
  7562 
       
  7563         {
       
  7564             identifier_c param_name("IN");
       
  7565             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7566             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7567             
       
  7568             /* Get the value from a foo(<param_value>) style call */
       
  7569             if (IN_param_value == NULL)
       
  7570               IN_param_value = function_call_param_iterator.next();
       
  7571             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7572             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7573             
       
  7574             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7575             {
       
  7576         
       
  7577                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7578                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  7579                 function_type_prefix = return_type_symbol;
       
  7580                 break;
       
  7581                 
       
  7582             }
       
  7583             
       
  7584             
       
  7585             ERROR;
       
  7586         }
       
  7587         
       
  7588     }/*function_lword_to_ulint*/
       
  7589     break;
       
  7590 
       
  7591 /****
       
  7592  *LWORD_TO_BOOL
       
  7593  */
       
  7594     case function_lword_to_bool :
       
  7595     {
       
  7596         symbol_c *last_type_symbol = NULL;
       
  7597 
       
  7598         {
       
  7599             identifier_c param_name("IN");
       
  7600             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7601             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7602             
       
  7603             /* Get the value from a foo(<param_value>) style call */
       
  7604             if (IN_param_value == NULL)
       
  7605               IN_param_value = function_call_param_iterator.next();
       
  7606             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7607             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7608             
       
  7609             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7610             {
       
  7611         
       
  7612                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7613                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  7614                 function_type_prefix = return_type_symbol;
       
  7615                 break;
       
  7616                 
       
  7617             }
       
  7618             
       
  7619             
       
  7620             ERROR;
       
  7621         }
       
  7622         
       
  7623     }/*function_lword_to_bool*/
       
  7624     break;
       
  7625 
       
  7626 /****
       
  7627  *LWORD_TO_TIME
       
  7628  */
       
  7629     case function_lword_to_time :
       
  7630     {
       
  7631         symbol_c *last_type_symbol = NULL;
       
  7632 
       
  7633         {
       
  7634             identifier_c param_name("IN");
       
  7635             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7636             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7637             
       
  7638             /* Get the value from a foo(<param_value>) style call */
       
  7639             if (IN_param_value == NULL)
       
  7640               IN_param_value = function_call_param_iterator.next();
       
  7641             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7642             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7643             
       
  7644             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7645             {
       
  7646         
       
  7647                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  7648                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7649                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  7650                 function_type_prefix = return_type_symbol;
       
  7651                 break;
       
  7652                 
       
  7653             }
       
  7654             
       
  7655             
       
  7656             ERROR;
       
  7657         }
       
  7658         
       
  7659     }/*function_lword_to_time*/
       
  7660     break;
       
  7661 
       
  7662 /****
       
  7663  *LWORD_TO_INT
       
  7664  */
       
  7665     case function_lword_to_int :
       
  7666     {
       
  7667         symbol_c *last_type_symbol = NULL;
       
  7668 
       
  7669         {
       
  7670             identifier_c param_name("IN");
       
  7671             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7672             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7673             
       
  7674             /* Get the value from a foo(<param_value>) style call */
       
  7675             if (IN_param_value == NULL)
       
  7676               IN_param_value = function_call_param_iterator.next();
       
  7677             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7678             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7679             
       
  7680             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
  7681             {
       
  7682         
       
  7683                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7684                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  7685                 function_type_prefix = return_type_symbol;
       
  7686                 break;
       
  7687                 
       
  7688             }
       
  7689             
       
  7690             
       
  7691             ERROR;
       
  7692         }
       
  7693         
       
  7694     }/*function_lword_to_int*/
       
  7695     break;
       
  7696 
       
  7697 /****
       
  7698  *UINT_TO_REAL
       
  7699  */
       
  7700     case function_uint_to_real :
       
  7701     {
       
  7702         symbol_c *last_type_symbol = NULL;
       
  7703 
       
  7704         {
       
  7705             identifier_c param_name("IN");
       
  7706             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7707             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7708             
       
  7709             /* Get the value from a foo(<param_value>) style call */
       
  7710             if (IN_param_value == NULL)
       
  7711               IN_param_value = function_call_param_iterator.next();
       
  7712             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7713             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7714             
       
  7715             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  7716             {
       
  7717         
       
  7718                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7719                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  7720                 function_type_prefix = return_type_symbol;
       
  7721                 break;
       
  7722                 
       
  7723             }
       
  7724             
       
  7725             
       
  7726             ERROR;
       
  7727         }
       
  7728         
       
  7729     }/*function_uint_to_real*/
       
  7730     break;
       
  7731 
       
  7732 /****
       
  7733  *UINT_TO_SINT
       
  7734  */
       
  7735     case function_uint_to_sint :
       
  7736     {
       
  7737         symbol_c *last_type_symbol = NULL;
       
  7738 
       
  7739         {
       
  7740             identifier_c param_name("IN");
       
  7741             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7742             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7743             
       
  7744             /* Get the value from a foo(<param_value>) style call */
       
  7745             if (IN_param_value == NULL)
       
  7746               IN_param_value = function_call_param_iterator.next();
       
  7747             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7748             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7749             
       
  7750             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  7751             {
       
  7752         
       
  7753                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7754                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  7755                 function_type_prefix = return_type_symbol;
       
  7756                 break;
       
  7757                 
       
  7758             }
       
  7759             
       
  7760             
       
  7761             ERROR;
       
  7762         }
       
  7763         
       
  7764     }/*function_uint_to_sint*/
       
  7765     break;
       
  7766 
       
  7767 /****
       
  7768  *UINT_TO_LINT
       
  7769  */
       
  7770     case function_uint_to_lint :
       
  7771     {
       
  7772         symbol_c *last_type_symbol = NULL;
       
  7773 
       
  7774         {
       
  7775             identifier_c param_name("IN");
       
  7776             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7777             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7778             
       
  7779             /* Get the value from a foo(<param_value>) style call */
       
  7780             if (IN_param_value == NULL)
       
  7781               IN_param_value = function_call_param_iterator.next();
       
  7782             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7783             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7784             
       
  7785             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  7786             {
       
  7787         
       
  7788                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7789                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  7790                 function_type_prefix = return_type_symbol;
       
  7791                 break;
       
  7792                 
       
  7793             }
       
  7794             
       
  7795             
       
  7796             ERROR;
       
  7797         }
       
  7798         
       
  7799     }/*function_uint_to_lint*/
       
  7800     break;
       
  7801 
       
  7802 /****
       
  7803  *UINT_TO_DINT
       
  7804  */
       
  7805     case function_uint_to_dint :
       
  7806     {
       
  7807         symbol_c *last_type_symbol = NULL;
       
  7808 
       
  7809         {
       
  7810             identifier_c param_name("IN");
       
  7811             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7812             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7813             
       
  7814             /* Get the value from a foo(<param_value>) style call */
       
  7815             if (IN_param_value == NULL)
       
  7816               IN_param_value = function_call_param_iterator.next();
       
  7817             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7818             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7819             
       
  7820             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  7821             {
       
  7822         
       
  7823                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7824                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  7825                 function_type_prefix = return_type_symbol;
       
  7826                 break;
       
  7827                 
       
  7828             }
       
  7829             
       
  7830             
       
  7831             ERROR;
       
  7832         }
       
  7833         
       
  7834     }/*function_uint_to_dint*/
       
  7835     break;
       
  7836 
       
  7837 /****
       
  7838  *UINT_TO_DATE
       
  7839  */
       
  7840     case function_uint_to_date :
       
  7841     {
       
  7842         symbol_c *last_type_symbol = NULL;
       
  7843 
       
  7844         {
       
  7845             identifier_c param_name("IN");
       
  7846             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7847             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7848             
       
  7849             /* Get the value from a foo(<param_value>) style call */
       
  7850             if (IN_param_value == NULL)
       
  7851               IN_param_value = function_call_param_iterator.next();
       
  7852             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7853             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7854             
       
  7855             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  7856             {
       
  7857         
       
  7858                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  7859                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7860                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  7861                 function_type_prefix = return_type_symbol;
       
  7862                 break;
       
  7863                 
       
  7864             }
       
  7865             
       
  7866             
       
  7867             ERROR;
       
  7868         }
       
  7869         
       
  7870     }/*function_uint_to_date*/
       
  7871     break;
       
  7872 
       
  7873 /****
       
  7874  *UINT_TO_DWORD
       
  7875  */
       
  7876     case function_uint_to_dword :
       
  7877     {
       
  7878         symbol_c *last_type_symbol = NULL;
       
  7879 
       
  7880         {
       
  7881             identifier_c param_name("IN");
       
  7882             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7883             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7884             
       
  7885             /* Get the value from a foo(<param_value>) style call */
       
  7886             if (IN_param_value == NULL)
       
  7887               IN_param_value = function_call_param_iterator.next();
       
  7888             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7889             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7890             
       
  7891             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  7892             {
       
  7893         
       
  7894                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7895                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  7896                 function_type_prefix = return_type_symbol;
       
  7897                 break;
       
  7898                 
       
  7899             }
       
  7900             
       
  7901             
       
  7902             ERROR;
       
  7903         }
       
  7904         
       
  7905     }/*function_uint_to_dword*/
       
  7906     break;
       
  7907 
       
  7908 /****
       
  7909  *UINT_TO_DT
       
  7910  */
       
  7911     case function_uint_to_dt :
       
  7912     {
       
  7913         symbol_c *last_type_symbol = NULL;
       
  7914 
       
  7915         {
       
  7916             identifier_c param_name("IN");
       
  7917             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7918             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7919             
       
  7920             /* Get the value from a foo(<param_value>) style call */
       
  7921             if (IN_param_value == NULL)
       
  7922               IN_param_value = function_call_param_iterator.next();
       
  7923             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7924             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7925             
       
  7926             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  7927             {
       
  7928         
       
  7929                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  7930                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7931                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  7932                 function_type_prefix = return_type_symbol;
       
  7933                 break;
       
  7934                 
       
  7935             }
       
  7936             
       
  7937             
       
  7938             ERROR;
       
  7939         }
       
  7940         
       
  7941     }/*function_uint_to_dt*/
       
  7942     break;
       
  7943 
       
  7944 /****
       
  7945  *UINT_TO_TOD
       
  7946  */
       
  7947     case function_uint_to_tod :
       
  7948     {
       
  7949         symbol_c *last_type_symbol = NULL;
       
  7950 
       
  7951         {
       
  7952             identifier_c param_name("IN");
       
  7953             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7954             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7955             
       
  7956             /* Get the value from a foo(<param_value>) style call */
       
  7957             if (IN_param_value == NULL)
       
  7958               IN_param_value = function_call_param_iterator.next();
       
  7959             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7960             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7961             
       
  7962             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  7963             {
       
  7964         
       
  7965                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  7966                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  7967                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  7968                 function_type_prefix = return_type_symbol;
       
  7969                 break;
       
  7970                 
       
  7971             }
       
  7972             
       
  7973             
       
  7974             ERROR;
       
  7975         }
       
  7976         
       
  7977     }/*function_uint_to_tod*/
       
  7978     break;
       
  7979 
       
  7980 /****
       
  7981  *UINT_TO_UDINT
       
  7982  */
       
  7983     case function_uint_to_udint :
       
  7984     {
       
  7985         symbol_c *last_type_symbol = NULL;
       
  7986 
       
  7987         {
       
  7988             identifier_c param_name("IN");
       
  7989             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7990             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7991             
       
  7992             /* Get the value from a foo(<param_value>) style call */
       
  7993             if (IN_param_value == NULL)
       
  7994               IN_param_value = function_call_param_iterator.next();
       
  7995             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7996             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7997             
       
  7998             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  7999             {
       
  8000         
       
  8001                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8002                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  8003                 function_type_prefix = return_type_symbol;
       
  8004                 break;
       
  8005                 
       
  8006             }
       
  8007             
       
  8008             
       
  8009             ERROR;
       
  8010         }
       
  8011         
       
  8012     }/*function_uint_to_udint*/
       
  8013     break;
       
  8014 
       
  8015 /****
       
  8016  *UINT_TO_WORD
       
  8017  */
       
  8018     case function_uint_to_word :
       
  8019     {
       
  8020         symbol_c *last_type_symbol = NULL;
       
  8021 
       
  8022         {
       
  8023             identifier_c param_name("IN");
       
  8024             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8025             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8026             
       
  8027             /* Get the value from a foo(<param_value>) style call */
       
  8028             if (IN_param_value == NULL)
       
  8029               IN_param_value = function_call_param_iterator.next();
       
  8030             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8031             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8032             
       
  8033             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  8034             {
       
  8035         
       
  8036                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8037                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  8038                 function_type_prefix = return_type_symbol;
       
  8039                 break;
       
  8040                 
       
  8041             }
       
  8042             
       
  8043             
       
  8044             ERROR;
       
  8045         }
       
  8046         
       
  8047     }/*function_uint_to_word*/
       
  8048     break;
       
  8049 
       
  8050 /****
       
  8051  *UINT_TO_STRING
       
  8052  */
       
  8053     case function_uint_to_string :
       
  8054     {
       
  8055         symbol_c *last_type_symbol = NULL;
       
  8056 
       
  8057         {
       
  8058             identifier_c param_name("IN");
       
  8059             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8060             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8061             
       
  8062             /* Get the value from a foo(<param_value>) style call */
       
  8063             if (IN_param_value == NULL)
       
  8064               IN_param_value = function_call_param_iterator.next();
       
  8065             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8066             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8067             
       
  8068             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  8069             {
       
  8070         
       
  8071                 function_name = (symbol_c*)(new pragma_c("__uint_to_string"));
       
  8072                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8073                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  8074                 function_type_prefix = return_type_symbol;
       
  8075                 break;
       
  8076                 
       
  8077             }
       
  8078             
       
  8079             
       
  8080             ERROR;
       
  8081         }
       
  8082         
       
  8083     }/*function_uint_to_string*/
       
  8084     break;
       
  8085 
       
  8086 /****
       
  8087  *UINT_TO_LWORD
       
  8088  */
       
  8089     case function_uint_to_lword :
       
  8090     {
       
  8091         symbol_c *last_type_symbol = NULL;
       
  8092 
       
  8093         {
       
  8094             identifier_c param_name("IN");
       
  8095             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8096             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8097             
       
  8098             /* Get the value from a foo(<param_value>) style call */
       
  8099             if (IN_param_value == NULL)
       
  8100               IN_param_value = function_call_param_iterator.next();
       
  8101             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8102             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8103             
       
  8104             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  8105             {
       
  8106         
       
  8107                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8108                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  8109                 function_type_prefix = return_type_symbol;
       
  8110                 break;
       
  8111                 
       
  8112             }
       
  8113             
       
  8114             
       
  8115             ERROR;
       
  8116         }
       
  8117         
       
  8118     }/*function_uint_to_lword*/
       
  8119     break;
       
  8120 
       
  8121 /****
       
  8122  *UINT_TO_LREAL
       
  8123  */
       
  8124     case function_uint_to_lreal :
       
  8125     {
       
  8126         symbol_c *last_type_symbol = NULL;
       
  8127 
       
  8128         {
       
  8129             identifier_c param_name("IN");
       
  8130             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8131             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8132             
       
  8133             /* Get the value from a foo(<param_value>) style call */
       
  8134             if (IN_param_value == NULL)
       
  8135               IN_param_value = function_call_param_iterator.next();
       
  8136             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8137             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8138             
       
  8139             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  8140             {
       
  8141         
       
  8142                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8143                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  8144                 function_type_prefix = return_type_symbol;
       
  8145                 break;
       
  8146                 
       
  8147             }
       
  8148             
       
  8149             
       
  8150             ERROR;
       
  8151         }
       
  8152         
       
  8153     }/*function_uint_to_lreal*/
       
  8154     break;
       
  8155 
       
  8156 /****
       
  8157  *UINT_TO_BYTE
       
  8158  */
       
  8159     case function_uint_to_byte :
       
  8160     {
       
  8161         symbol_c *last_type_symbol = NULL;
       
  8162 
       
  8163         {
       
  8164             identifier_c param_name("IN");
       
  8165             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8166             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8167             
       
  8168             /* Get the value from a foo(<param_value>) style call */
       
  8169             if (IN_param_value == NULL)
       
  8170               IN_param_value = function_call_param_iterator.next();
       
  8171             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8172             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8173             
       
  8174             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  8175             {
       
  8176         
       
  8177                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8178                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  8179                 function_type_prefix = return_type_symbol;
       
  8180                 break;
       
  8181                 
       
  8182             }
       
  8183             
       
  8184             
       
  8185             ERROR;
       
  8186         }
       
  8187         
       
  8188     }/*function_uint_to_byte*/
       
  8189     break;
       
  8190 
       
  8191 /****
       
  8192  *UINT_TO_USINT
       
  8193  */
       
  8194     case function_uint_to_usint :
       
  8195     {
       
  8196         symbol_c *last_type_symbol = NULL;
       
  8197 
       
  8198         {
       
  8199             identifier_c param_name("IN");
       
  8200             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8201             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8202             
       
  8203             /* Get the value from a foo(<param_value>) style call */
       
  8204             if (IN_param_value == NULL)
       
  8205               IN_param_value = function_call_param_iterator.next();
       
  8206             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8207             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8208             
       
  8209             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  8210             {
       
  8211         
       
  8212                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8213                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  8214                 function_type_prefix = return_type_symbol;
       
  8215                 break;
       
  8216                 
       
  8217             }
       
  8218             
       
  8219             
       
  8220             ERROR;
       
  8221         }
       
  8222         
       
  8223     }/*function_uint_to_usint*/
       
  8224     break;
       
  8225 
       
  8226 /****
       
  8227  *UINT_TO_ULINT
       
  8228  */
       
  8229     case function_uint_to_ulint :
       
  8230     {
       
  8231         symbol_c *last_type_symbol = NULL;
       
  8232 
       
  8233         {
       
  8234             identifier_c param_name("IN");
       
  8235             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8236             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8237             
       
  8238             /* Get the value from a foo(<param_value>) style call */
       
  8239             if (IN_param_value == NULL)
       
  8240               IN_param_value = function_call_param_iterator.next();
       
  8241             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8242             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8243             
       
  8244             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  8245             {
       
  8246         
       
  8247                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8248                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  8249                 function_type_prefix = return_type_symbol;
       
  8250                 break;
       
  8251                 
       
  8252             }
       
  8253             
       
  8254             
       
  8255             ERROR;
       
  8256         }
       
  8257         
       
  8258     }/*function_uint_to_ulint*/
       
  8259     break;
       
  8260 
       
  8261 /****
       
  8262  *UINT_TO_BOOL
       
  8263  */
       
  8264     case function_uint_to_bool :
       
  8265     {
       
  8266         symbol_c *last_type_symbol = NULL;
       
  8267 
       
  8268         {
       
  8269             identifier_c param_name("IN");
       
  8270             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8271             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8272             
       
  8273             /* Get the value from a foo(<param_value>) style call */
       
  8274             if (IN_param_value == NULL)
       
  8275               IN_param_value = function_call_param_iterator.next();
       
  8276             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8277             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8278             
       
  8279             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  8280             {
       
  8281         
       
  8282                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8283                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  8284                 function_type_prefix = return_type_symbol;
       
  8285                 break;
       
  8286                 
       
  8287             }
       
  8288             
       
  8289             
       
  8290             ERROR;
       
  8291         }
       
  8292         
       
  8293     }/*function_uint_to_bool*/
       
  8294     break;
       
  8295 
       
  8296 /****
       
  8297  *UINT_TO_TIME
       
  8298  */
       
  8299     case function_uint_to_time :
       
  8300     {
       
  8301         symbol_c *last_type_symbol = NULL;
       
  8302 
       
  8303         {
       
  8304             identifier_c param_name("IN");
       
  8305             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8306             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8307             
       
  8308             /* Get the value from a foo(<param_value>) style call */
       
  8309             if (IN_param_value == NULL)
       
  8310               IN_param_value = function_call_param_iterator.next();
       
  8311             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8312             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8313             
       
  8314             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  8315             {
       
  8316         
       
  8317                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  8318                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8319                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  8320                 function_type_prefix = return_type_symbol;
       
  8321                 break;
       
  8322                 
       
  8323             }
       
  8324             
       
  8325             
       
  8326             ERROR;
       
  8327         }
       
  8328         
       
  8329     }/*function_uint_to_time*/
       
  8330     break;
       
  8331 
       
  8332 /****
       
  8333  *UINT_TO_INT
       
  8334  */
       
  8335     case function_uint_to_int :
       
  8336     {
       
  8337         symbol_c *last_type_symbol = NULL;
       
  8338 
       
  8339         {
       
  8340             identifier_c param_name("IN");
       
  8341             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8342             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8343             
       
  8344             /* Get the value from a foo(<param_value>) style call */
       
  8345             if (IN_param_value == NULL)
       
  8346               IN_param_value = function_call_param_iterator.next();
       
  8347             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8348             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8349             
       
  8350             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  8351             {
       
  8352         
       
  8353                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8354                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  8355                 function_type_prefix = return_type_symbol;
       
  8356                 break;
       
  8357                 
       
  8358             }
       
  8359             
       
  8360             
       
  8361             ERROR;
       
  8362         }
       
  8363         
       
  8364     }/*function_uint_to_int*/
       
  8365     break;
       
  8366 
       
  8367 /****
       
  8368  *LREAL_TO_REAL
       
  8369  */
       
  8370     case function_lreal_to_real :
       
  8371     {
       
  8372         symbol_c *last_type_symbol = NULL;
       
  8373 
       
  8374         {
       
  8375             identifier_c param_name("IN");
       
  8376             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8377             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8378             
       
  8379             /* Get the value from a foo(<param_value>) style call */
       
  8380             if (IN_param_value == NULL)
       
  8381               IN_param_value = function_call_param_iterator.next();
       
  8382             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8383             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8384             
       
  8385             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8386             {
       
  8387         
       
  8388                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8389                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  8390                 function_type_prefix = return_type_symbol;
       
  8391                 break;
       
  8392                 
       
  8393             }
       
  8394             
       
  8395             
       
  8396             ERROR;
       
  8397         }
       
  8398         
       
  8399     }/*function_lreal_to_real*/
       
  8400     break;
       
  8401 
       
  8402 /****
       
  8403  *LREAL_TO_SINT
       
  8404  */
       
  8405     case function_lreal_to_sint :
       
  8406     {
       
  8407         symbol_c *last_type_symbol = NULL;
       
  8408 
       
  8409         {
       
  8410             identifier_c param_name("IN");
       
  8411             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8412             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8413             
       
  8414             /* Get the value from a foo(<param_value>) style call */
       
  8415             if (IN_param_value == NULL)
       
  8416               IN_param_value = function_call_param_iterator.next();
       
  8417             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8418             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8419             
       
  8420             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8421             {
       
  8422         
       
  8423                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8424                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  8425                 function_type_prefix = return_type_symbol;
       
  8426                 break;
       
  8427                 
       
  8428             }
       
  8429             
       
  8430             
       
  8431             ERROR;
       
  8432         }
       
  8433         
       
  8434     }/*function_lreal_to_sint*/
       
  8435     break;
       
  8436 
       
  8437 /****
       
  8438  *LREAL_TO_LINT
       
  8439  */
       
  8440     case function_lreal_to_lint :
       
  8441     {
       
  8442         symbol_c *last_type_symbol = NULL;
       
  8443 
       
  8444         {
       
  8445             identifier_c param_name("IN");
       
  8446             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8447             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8448             
       
  8449             /* Get the value from a foo(<param_value>) style call */
       
  8450             if (IN_param_value == NULL)
       
  8451               IN_param_value = function_call_param_iterator.next();
       
  8452             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8453             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8454             
       
  8455             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8456             {
       
  8457         
       
  8458                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8459                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  8460                 function_type_prefix = return_type_symbol;
       
  8461                 break;
       
  8462                 
       
  8463             }
       
  8464             
       
  8465             
       
  8466             ERROR;
       
  8467         }
       
  8468         
       
  8469     }/*function_lreal_to_lint*/
       
  8470     break;
       
  8471 
       
  8472 /****
       
  8473  *LREAL_TO_DINT
       
  8474  */
       
  8475     case function_lreal_to_dint :
       
  8476     {
       
  8477         symbol_c *last_type_symbol = NULL;
       
  8478 
       
  8479         {
       
  8480             identifier_c param_name("IN");
       
  8481             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8482             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8483             
       
  8484             /* Get the value from a foo(<param_value>) style call */
       
  8485             if (IN_param_value == NULL)
       
  8486               IN_param_value = function_call_param_iterator.next();
       
  8487             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8488             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8489             
       
  8490             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8491             {
       
  8492         
       
  8493                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8494                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  8495                 function_type_prefix = return_type_symbol;
       
  8496                 break;
       
  8497                 
       
  8498             }
       
  8499             
       
  8500             
       
  8501             ERROR;
       
  8502         }
       
  8503         
       
  8504     }/*function_lreal_to_dint*/
       
  8505     break;
       
  8506 
       
  8507 /****
       
  8508  *LREAL_TO_DATE
       
  8509  */
       
  8510     case function_lreal_to_date :
       
  8511     {
       
  8512         symbol_c *last_type_symbol = NULL;
       
  8513 
       
  8514         {
       
  8515             identifier_c param_name("IN");
       
  8516             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8517             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8518             
       
  8519             /* Get the value from a foo(<param_value>) style call */
       
  8520             if (IN_param_value == NULL)
       
  8521               IN_param_value = function_call_param_iterator.next();
       
  8522             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8523             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8524             
       
  8525             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8526             {
       
  8527         
       
  8528                 function_name = (symbol_c*)(new pragma_c("__real_to_time"));
       
  8529                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8530                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  8531                 function_type_prefix = return_type_symbol;
       
  8532                 break;
       
  8533                 
       
  8534             }
       
  8535             
       
  8536             
       
  8537             ERROR;
       
  8538         }
       
  8539         
       
  8540     }/*function_lreal_to_date*/
       
  8541     break;
       
  8542 
       
  8543 /****
       
  8544  *LREAL_TO_DWORD
       
  8545  */
       
  8546     case function_lreal_to_dword :
       
  8547     {
       
  8548         symbol_c *last_type_symbol = NULL;
       
  8549 
       
  8550         {
       
  8551             identifier_c param_name("IN");
       
  8552             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8553             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8554             
       
  8555             /* Get the value from a foo(<param_value>) style call */
       
  8556             if (IN_param_value == NULL)
       
  8557               IN_param_value = function_call_param_iterator.next();
       
  8558             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8559             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8560             
       
  8561             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8562             {
       
  8563         
       
  8564                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8565                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  8566                 function_type_prefix = return_type_symbol;
       
  8567                 break;
       
  8568                 
       
  8569             }
       
  8570             
       
  8571             
       
  8572             ERROR;
       
  8573         }
       
  8574         
       
  8575     }/*function_lreal_to_dword*/
       
  8576     break;
       
  8577 
       
  8578 /****
       
  8579  *LREAL_TO_DT
       
  8580  */
       
  8581     case function_lreal_to_dt :
       
  8582     {
       
  8583         symbol_c *last_type_symbol = NULL;
       
  8584 
       
  8585         {
       
  8586             identifier_c param_name("IN");
       
  8587             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8588             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8589             
       
  8590             /* Get the value from a foo(<param_value>) style call */
       
  8591             if (IN_param_value == NULL)
       
  8592               IN_param_value = function_call_param_iterator.next();
       
  8593             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8594             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8595             
       
  8596             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8597             {
       
  8598         
       
  8599                 function_name = (symbol_c*)(new pragma_c("__real_to_time"));
       
  8600                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8601                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  8602                 function_type_prefix = return_type_symbol;
       
  8603                 break;
       
  8604                 
       
  8605             }
       
  8606             
       
  8607             
       
  8608             ERROR;
       
  8609         }
       
  8610         
       
  8611     }/*function_lreal_to_dt*/
       
  8612     break;
       
  8613 
       
  8614 /****
       
  8615  *LREAL_TO_TOD
       
  8616  */
       
  8617     case function_lreal_to_tod :
       
  8618     {
       
  8619         symbol_c *last_type_symbol = NULL;
       
  8620 
       
  8621         {
       
  8622             identifier_c param_name("IN");
       
  8623             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8624             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8625             
       
  8626             /* Get the value from a foo(<param_value>) style call */
       
  8627             if (IN_param_value == NULL)
       
  8628               IN_param_value = function_call_param_iterator.next();
       
  8629             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8630             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8631             
       
  8632             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8633             {
       
  8634         
       
  8635                 function_name = (symbol_c*)(new pragma_c("__real_to_time"));
       
  8636                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8637                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  8638                 function_type_prefix = return_type_symbol;
       
  8639                 break;
       
  8640                 
       
  8641             }
       
  8642             
       
  8643             
       
  8644             ERROR;
       
  8645         }
       
  8646         
       
  8647     }/*function_lreal_to_tod*/
       
  8648     break;
       
  8649 
       
  8650 /****
       
  8651  *LREAL_TO_UDINT
       
  8652  */
       
  8653     case function_lreal_to_udint :
       
  8654     {
       
  8655         symbol_c *last_type_symbol = NULL;
       
  8656 
       
  8657         {
       
  8658             identifier_c param_name("IN");
       
  8659             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8660             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8661             
       
  8662             /* Get the value from a foo(<param_value>) style call */
       
  8663             if (IN_param_value == NULL)
       
  8664               IN_param_value = function_call_param_iterator.next();
       
  8665             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8666             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8667             
       
  8668             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8669             {
       
  8670         
       
  8671                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8672                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  8673                 function_type_prefix = return_type_symbol;
       
  8674                 break;
       
  8675                 
       
  8676             }
       
  8677             
       
  8678             
       
  8679             ERROR;
       
  8680         }
       
  8681         
       
  8682     }/*function_lreal_to_udint*/
       
  8683     break;
       
  8684 
       
  8685 /****
       
  8686  *LREAL_TO_WORD
       
  8687  */
       
  8688     case function_lreal_to_word :
       
  8689     {
       
  8690         symbol_c *last_type_symbol = NULL;
       
  8691 
       
  8692         {
       
  8693             identifier_c param_name("IN");
       
  8694             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8695             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8696             
       
  8697             /* Get the value from a foo(<param_value>) style call */
       
  8698             if (IN_param_value == NULL)
       
  8699               IN_param_value = function_call_param_iterator.next();
       
  8700             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8701             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8702             
       
  8703             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8704             {
       
  8705         
       
  8706                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8707                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  8708                 function_type_prefix = return_type_symbol;
       
  8709                 break;
       
  8710                 
       
  8711             }
       
  8712             
       
  8713             
       
  8714             ERROR;
       
  8715         }
       
  8716         
       
  8717     }/*function_lreal_to_word*/
       
  8718     break;
       
  8719 
       
  8720 /****
       
  8721  *LREAL_TO_STRING
       
  8722  */
       
  8723     case function_lreal_to_string :
       
  8724     {
       
  8725         symbol_c *last_type_symbol = NULL;
       
  8726 
       
  8727         {
       
  8728             identifier_c param_name("IN");
       
  8729             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8730             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8731             
       
  8732             /* Get the value from a foo(<param_value>) style call */
       
  8733             if (IN_param_value == NULL)
       
  8734               IN_param_value = function_call_param_iterator.next();
       
  8735             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8736             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8737             
       
  8738             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8739             {
       
  8740         
       
  8741                 function_name = (symbol_c*)(new pragma_c("__real_to_string"));
       
  8742                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8743                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  8744                 function_type_prefix = return_type_symbol;
       
  8745                 break;
       
  8746                 
       
  8747             }
       
  8748             
       
  8749             
       
  8750             ERROR;
       
  8751         }
       
  8752         
       
  8753     }/*function_lreal_to_string*/
       
  8754     break;
       
  8755 
       
  8756 /****
       
  8757  *LREAL_TO_LWORD
       
  8758  */
       
  8759     case function_lreal_to_lword :
       
  8760     {
       
  8761         symbol_c *last_type_symbol = NULL;
       
  8762 
       
  8763         {
       
  8764             identifier_c param_name("IN");
       
  8765             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8766             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8767             
       
  8768             /* Get the value from a foo(<param_value>) style call */
       
  8769             if (IN_param_value == NULL)
       
  8770               IN_param_value = function_call_param_iterator.next();
       
  8771             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8772             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8773             
       
  8774             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8775             {
       
  8776         
       
  8777                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8778                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  8779                 function_type_prefix = return_type_symbol;
       
  8780                 break;
       
  8781                 
       
  8782             }
       
  8783             
       
  8784             
       
  8785             ERROR;
       
  8786         }
       
  8787         
       
  8788     }/*function_lreal_to_lword*/
       
  8789     break;
       
  8790 
       
  8791 /****
       
  8792  *LREAL_TO_UINT
       
  8793  */
       
  8794     case function_lreal_to_uint :
       
  8795     {
       
  8796         symbol_c *last_type_symbol = NULL;
       
  8797 
       
  8798         {
       
  8799             identifier_c param_name("IN");
       
  8800             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8801             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8802             
       
  8803             /* Get the value from a foo(<param_value>) style call */
       
  8804             if (IN_param_value == NULL)
       
  8805               IN_param_value = function_call_param_iterator.next();
       
  8806             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8807             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8808             
       
  8809             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8810             {
       
  8811         
       
  8812                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8813                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  8814                 function_type_prefix = return_type_symbol;
       
  8815                 break;
       
  8816                 
       
  8817             }
       
  8818             
       
  8819             
       
  8820             ERROR;
       
  8821         }
       
  8822         
       
  8823     }/*function_lreal_to_uint*/
       
  8824     break;
       
  8825 
       
  8826 /****
       
  8827  *LREAL_TO_BYTE
       
  8828  */
       
  8829     case function_lreal_to_byte :
       
  8830     {
       
  8831         symbol_c *last_type_symbol = NULL;
       
  8832 
       
  8833         {
       
  8834             identifier_c param_name("IN");
       
  8835             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8836             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8837             
       
  8838             /* Get the value from a foo(<param_value>) style call */
       
  8839             if (IN_param_value == NULL)
       
  8840               IN_param_value = function_call_param_iterator.next();
       
  8841             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8842             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8843             
       
  8844             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8845             {
       
  8846         
       
  8847                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8848                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  8849                 function_type_prefix = return_type_symbol;
       
  8850                 break;
       
  8851                 
       
  8852             }
       
  8853             
       
  8854             
       
  8855             ERROR;
       
  8856         }
       
  8857         
       
  8858     }/*function_lreal_to_byte*/
       
  8859     break;
       
  8860 
       
  8861 /****
       
  8862  *LREAL_TO_USINT
       
  8863  */
       
  8864     case function_lreal_to_usint :
       
  8865     {
       
  8866         symbol_c *last_type_symbol = NULL;
       
  8867 
       
  8868         {
       
  8869             identifier_c param_name("IN");
       
  8870             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8871             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8872             
       
  8873             /* Get the value from a foo(<param_value>) style call */
       
  8874             if (IN_param_value == NULL)
       
  8875               IN_param_value = function_call_param_iterator.next();
       
  8876             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8877             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8878             
       
  8879             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8880             {
       
  8881         
       
  8882                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8883                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  8884                 function_type_prefix = return_type_symbol;
       
  8885                 break;
       
  8886                 
       
  8887             }
       
  8888             
       
  8889             
       
  8890             ERROR;
       
  8891         }
       
  8892         
       
  8893     }/*function_lreal_to_usint*/
       
  8894     break;
       
  8895 
       
  8896 /****
       
  8897  *LREAL_TO_ULINT
       
  8898  */
       
  8899     case function_lreal_to_ulint :
       
  8900     {
       
  8901         symbol_c *last_type_symbol = NULL;
       
  8902 
       
  8903         {
       
  8904             identifier_c param_name("IN");
       
  8905             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8906             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8907             
       
  8908             /* Get the value from a foo(<param_value>) style call */
       
  8909             if (IN_param_value == NULL)
       
  8910               IN_param_value = function_call_param_iterator.next();
       
  8911             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8912             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8913             
       
  8914             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8915             {
       
  8916         
       
  8917                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8918                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  8919                 function_type_prefix = return_type_symbol;
       
  8920                 break;
       
  8921                 
       
  8922             }
       
  8923             
       
  8924             
       
  8925             ERROR;
       
  8926         }
       
  8927         
       
  8928     }/*function_lreal_to_ulint*/
       
  8929     break;
       
  8930 
       
  8931 /****
       
  8932  *LREAL_TO_BOOL
       
  8933  */
       
  8934     case function_lreal_to_bool :
       
  8935     {
       
  8936         symbol_c *last_type_symbol = NULL;
       
  8937 
       
  8938         {
       
  8939             identifier_c param_name("IN");
       
  8940             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8941             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8942             
       
  8943             /* Get the value from a foo(<param_value>) style call */
       
  8944             if (IN_param_value == NULL)
       
  8945               IN_param_value = function_call_param_iterator.next();
       
  8946             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8947             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8948             
       
  8949             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8950             {
       
  8951         
       
  8952                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8953                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  8954                 function_type_prefix = return_type_symbol;
       
  8955                 break;
       
  8956                 
       
  8957             }
       
  8958             
       
  8959             
       
  8960             ERROR;
       
  8961         }
       
  8962         
       
  8963     }/*function_lreal_to_bool*/
       
  8964     break;
       
  8965 
       
  8966 /****
       
  8967  *LREAL_TO_TIME
       
  8968  */
       
  8969     case function_lreal_to_time :
       
  8970     {
       
  8971         symbol_c *last_type_symbol = NULL;
       
  8972 
       
  8973         {
       
  8974             identifier_c param_name("IN");
       
  8975             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8976             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8977             
       
  8978             /* Get the value from a foo(<param_value>) style call */
       
  8979             if (IN_param_value == NULL)
       
  8980               IN_param_value = function_call_param_iterator.next();
       
  8981             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8982             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8983             
       
  8984             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  8985             {
       
  8986         
       
  8987                 function_name = (symbol_c*)(new pragma_c("__real_to_time"));
       
  8988                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  8989                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  8990                 function_type_prefix = return_type_symbol;
       
  8991                 break;
       
  8992                 
       
  8993             }
       
  8994             
       
  8995             
       
  8996             ERROR;
       
  8997         }
       
  8998         
       
  8999     }/*function_lreal_to_time*/
       
  9000     break;
       
  9001 
       
  9002 /****
       
  9003  *LREAL_TO_INT
       
  9004  */
       
  9005     case function_lreal_to_int :
       
  9006     {
       
  9007         symbol_c *last_type_symbol = NULL;
       
  9008 
       
  9009         {
       
  9010             identifier_c param_name("IN");
       
  9011             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9012             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9013             
       
  9014             /* Get the value from a foo(<param_value>) style call */
       
  9015             if (IN_param_value == NULL)
       
  9016               IN_param_value = function_call_param_iterator.next();
       
  9017             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9018             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9019             
       
  9020             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  9021             {
       
  9022         
       
  9023                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9024                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  9025                 function_type_prefix = return_type_symbol;
       
  9026                 break;
       
  9027                 
       
  9028             }
       
  9029             
       
  9030             
       
  9031             ERROR;
       
  9032         }
       
  9033         
       
  9034     }/*function_lreal_to_int*/
       
  9035     break;
       
  9036 
       
  9037 /****
       
  9038  *BYTE_TO_REAL
       
  9039  */
       
  9040     case function_byte_to_real :
       
  9041     {
       
  9042         symbol_c *last_type_symbol = NULL;
       
  9043 
       
  9044         {
       
  9045             identifier_c param_name("IN");
       
  9046             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9047             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9048             
       
  9049             /* Get the value from a foo(<param_value>) style call */
       
  9050             if (IN_param_value == NULL)
       
  9051               IN_param_value = function_call_param_iterator.next();
       
  9052             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9053             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9054             
       
  9055             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9056             {
       
  9057         
       
  9058                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9059                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  9060                 function_type_prefix = return_type_symbol;
       
  9061                 break;
       
  9062                 
       
  9063             }
       
  9064             
       
  9065             
       
  9066             ERROR;
       
  9067         }
       
  9068         
       
  9069     }/*function_byte_to_real*/
       
  9070     break;
       
  9071 
       
  9072 /****
       
  9073  *BYTE_TO_SINT
       
  9074  */
       
  9075     case function_byte_to_sint :
       
  9076     {
       
  9077         symbol_c *last_type_symbol = NULL;
       
  9078 
       
  9079         {
       
  9080             identifier_c param_name("IN");
       
  9081             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9082             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9083             
       
  9084             /* Get the value from a foo(<param_value>) style call */
       
  9085             if (IN_param_value == NULL)
       
  9086               IN_param_value = function_call_param_iterator.next();
       
  9087             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9088             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9089             
       
  9090             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9091             {
       
  9092         
       
  9093                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9094                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  9095                 function_type_prefix = return_type_symbol;
       
  9096                 break;
       
  9097                 
       
  9098             }
       
  9099             
       
  9100             
       
  9101             ERROR;
       
  9102         }
       
  9103         
       
  9104     }/*function_byte_to_sint*/
       
  9105     break;
       
  9106 
       
  9107 /****
       
  9108  *BYTE_TO_LINT
       
  9109  */
       
  9110     case function_byte_to_lint :
       
  9111     {
       
  9112         symbol_c *last_type_symbol = NULL;
       
  9113 
       
  9114         {
       
  9115             identifier_c param_name("IN");
       
  9116             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9117             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9118             
       
  9119             /* Get the value from a foo(<param_value>) style call */
       
  9120             if (IN_param_value == NULL)
       
  9121               IN_param_value = function_call_param_iterator.next();
       
  9122             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9123             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9124             
       
  9125             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9126             {
       
  9127         
       
  9128                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9129                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  9130                 function_type_prefix = return_type_symbol;
       
  9131                 break;
       
  9132                 
       
  9133             }
       
  9134             
       
  9135             
       
  9136             ERROR;
       
  9137         }
       
  9138         
       
  9139     }/*function_byte_to_lint*/
       
  9140     break;
       
  9141 
       
  9142 /****
       
  9143  *BYTE_TO_DINT
       
  9144  */
       
  9145     case function_byte_to_dint :
       
  9146     {
       
  9147         symbol_c *last_type_symbol = NULL;
       
  9148 
       
  9149         {
       
  9150             identifier_c param_name("IN");
       
  9151             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9152             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9153             
       
  9154             /* Get the value from a foo(<param_value>) style call */
       
  9155             if (IN_param_value == NULL)
       
  9156               IN_param_value = function_call_param_iterator.next();
       
  9157             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9158             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9159             
       
  9160             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9161             {
       
  9162         
       
  9163                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9164                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  9165                 function_type_prefix = return_type_symbol;
       
  9166                 break;
       
  9167                 
       
  9168             }
       
  9169             
       
  9170             
       
  9171             ERROR;
       
  9172         }
       
  9173         
       
  9174     }/*function_byte_to_dint*/
       
  9175     break;
       
  9176 
       
  9177 /****
       
  9178  *BYTE_TO_DATE
       
  9179  */
       
  9180     case function_byte_to_date :
       
  9181     {
       
  9182         symbol_c *last_type_symbol = NULL;
       
  9183 
       
  9184         {
       
  9185             identifier_c param_name("IN");
       
  9186             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9187             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9188             
       
  9189             /* Get the value from a foo(<param_value>) style call */
       
  9190             if (IN_param_value == NULL)
       
  9191               IN_param_value = function_call_param_iterator.next();
       
  9192             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9193             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9194             
       
  9195             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9196             {
       
  9197         
       
  9198                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  9199                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9200                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  9201                 function_type_prefix = return_type_symbol;
       
  9202                 break;
       
  9203                 
       
  9204             }
       
  9205             
       
  9206             
       
  9207             ERROR;
       
  9208         }
       
  9209         
       
  9210     }/*function_byte_to_date*/
       
  9211     break;
       
  9212 
       
  9213 /****
       
  9214  *BYTE_TO_DWORD
       
  9215  */
       
  9216     case function_byte_to_dword :
       
  9217     {
       
  9218         symbol_c *last_type_symbol = NULL;
       
  9219 
       
  9220         {
       
  9221             identifier_c param_name("IN");
       
  9222             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9223             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9224             
       
  9225             /* Get the value from a foo(<param_value>) style call */
       
  9226             if (IN_param_value == NULL)
       
  9227               IN_param_value = function_call_param_iterator.next();
       
  9228             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9229             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9230             
       
  9231             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9232             {
       
  9233         
       
  9234                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9235                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  9236                 function_type_prefix = return_type_symbol;
       
  9237                 break;
       
  9238                 
       
  9239             }
       
  9240             
       
  9241             
       
  9242             ERROR;
       
  9243         }
       
  9244         
       
  9245     }/*function_byte_to_dword*/
       
  9246     break;
       
  9247 
       
  9248 /****
       
  9249  *BYTE_TO_DT
       
  9250  */
       
  9251     case function_byte_to_dt :
       
  9252     {
       
  9253         symbol_c *last_type_symbol = NULL;
       
  9254 
       
  9255         {
       
  9256             identifier_c param_name("IN");
       
  9257             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9258             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9259             
       
  9260             /* Get the value from a foo(<param_value>) style call */
       
  9261             if (IN_param_value == NULL)
       
  9262               IN_param_value = function_call_param_iterator.next();
       
  9263             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9264             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9265             
       
  9266             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9267             {
       
  9268         
       
  9269                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  9270                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9271                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  9272                 function_type_prefix = return_type_symbol;
       
  9273                 break;
       
  9274                 
       
  9275             }
       
  9276             
       
  9277             
       
  9278             ERROR;
       
  9279         }
       
  9280         
       
  9281     }/*function_byte_to_dt*/
       
  9282     break;
       
  9283 
       
  9284 /****
       
  9285  *BYTE_TO_TOD
       
  9286  */
       
  9287     case function_byte_to_tod :
       
  9288     {
       
  9289         symbol_c *last_type_symbol = NULL;
       
  9290 
       
  9291         {
       
  9292             identifier_c param_name("IN");
       
  9293             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9294             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9295             
       
  9296             /* Get the value from a foo(<param_value>) style call */
       
  9297             if (IN_param_value == NULL)
       
  9298               IN_param_value = function_call_param_iterator.next();
       
  9299             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9300             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9301             
       
  9302             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9303             {
       
  9304         
       
  9305                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  9306                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9307                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  9308                 function_type_prefix = return_type_symbol;
       
  9309                 break;
       
  9310                 
       
  9311             }
       
  9312             
       
  9313             
       
  9314             ERROR;
       
  9315         }
       
  9316         
       
  9317     }/*function_byte_to_tod*/
       
  9318     break;
       
  9319 
       
  9320 /****
       
  9321  *BYTE_TO_UDINT
       
  9322  */
       
  9323     case function_byte_to_udint :
       
  9324     {
       
  9325         symbol_c *last_type_symbol = NULL;
       
  9326 
       
  9327         {
       
  9328             identifier_c param_name("IN");
       
  9329             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9330             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9331             
       
  9332             /* Get the value from a foo(<param_value>) style call */
       
  9333             if (IN_param_value == NULL)
       
  9334               IN_param_value = function_call_param_iterator.next();
       
  9335             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9336             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9337             
       
  9338             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9339             {
       
  9340         
       
  9341                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9342                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  9343                 function_type_prefix = return_type_symbol;
       
  9344                 break;
       
  9345                 
       
  9346             }
       
  9347             
       
  9348             
       
  9349             ERROR;
       
  9350         }
       
  9351         
       
  9352     }/*function_byte_to_udint*/
       
  9353     break;
       
  9354 
       
  9355 /****
       
  9356  *BYTE_TO_WORD
       
  9357  */
       
  9358     case function_byte_to_word :
       
  9359     {
       
  9360         symbol_c *last_type_symbol = NULL;
       
  9361 
       
  9362         {
       
  9363             identifier_c param_name("IN");
       
  9364             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9365             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9366             
       
  9367             /* Get the value from a foo(<param_value>) style call */
       
  9368             if (IN_param_value == NULL)
       
  9369               IN_param_value = function_call_param_iterator.next();
       
  9370             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9371             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9372             
       
  9373             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9374             {
       
  9375         
       
  9376                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9377                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  9378                 function_type_prefix = return_type_symbol;
       
  9379                 break;
       
  9380                 
       
  9381             }
       
  9382             
       
  9383             
       
  9384             ERROR;
       
  9385         }
       
  9386         
       
  9387     }/*function_byte_to_word*/
       
  9388     break;
       
  9389 
       
  9390 /****
       
  9391  *BYTE_TO_STRING
       
  9392  */
       
  9393     case function_byte_to_string :
       
  9394     {
       
  9395         symbol_c *last_type_symbol = NULL;
       
  9396 
       
  9397         {
       
  9398             identifier_c param_name("IN");
       
  9399             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9400             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9401             
       
  9402             /* Get the value from a foo(<param_value>) style call */
       
  9403             if (IN_param_value == NULL)
       
  9404               IN_param_value = function_call_param_iterator.next();
       
  9405             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9406             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9407             
       
  9408             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9409             {
       
  9410         
       
  9411                 function_name = (symbol_c*)(new pragma_c("__bit_to_string"));
       
  9412                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9413                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  9414                 function_type_prefix = return_type_symbol;
       
  9415                 break;
       
  9416                 
       
  9417             }
       
  9418             
       
  9419             
       
  9420             ERROR;
       
  9421         }
       
  9422         
       
  9423     }/*function_byte_to_string*/
       
  9424     break;
       
  9425 
       
  9426 /****
       
  9427  *BYTE_TO_LWORD
       
  9428  */
       
  9429     case function_byte_to_lword :
       
  9430     {
       
  9431         symbol_c *last_type_symbol = NULL;
       
  9432 
       
  9433         {
       
  9434             identifier_c param_name("IN");
       
  9435             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9436             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9437             
       
  9438             /* Get the value from a foo(<param_value>) style call */
       
  9439             if (IN_param_value == NULL)
       
  9440               IN_param_value = function_call_param_iterator.next();
       
  9441             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9442             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9443             
       
  9444             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9445             {
       
  9446         
       
  9447                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9448                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  9449                 function_type_prefix = return_type_symbol;
       
  9450                 break;
       
  9451                 
       
  9452             }
       
  9453             
       
  9454             
       
  9455             ERROR;
       
  9456         }
       
  9457         
       
  9458     }/*function_byte_to_lword*/
       
  9459     break;
       
  9460 
       
  9461 /****
       
  9462  *BYTE_TO_UINT
       
  9463  */
       
  9464     case function_byte_to_uint :
       
  9465     {
       
  9466         symbol_c *last_type_symbol = NULL;
       
  9467 
       
  9468         {
       
  9469             identifier_c param_name("IN");
       
  9470             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9471             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9472             
       
  9473             /* Get the value from a foo(<param_value>) style call */
       
  9474             if (IN_param_value == NULL)
       
  9475               IN_param_value = function_call_param_iterator.next();
       
  9476             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9477             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9478             
       
  9479             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9480             {
       
  9481         
       
  9482                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9483                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  9484                 function_type_prefix = return_type_symbol;
       
  9485                 break;
       
  9486                 
       
  9487             }
       
  9488             
       
  9489             
       
  9490             ERROR;
       
  9491         }
       
  9492         
       
  9493     }/*function_byte_to_uint*/
       
  9494     break;
       
  9495 
       
  9496 /****
       
  9497  *BYTE_TO_LREAL
       
  9498  */
       
  9499     case function_byte_to_lreal :
       
  9500     {
       
  9501         symbol_c *last_type_symbol = NULL;
       
  9502 
       
  9503         {
       
  9504             identifier_c param_name("IN");
       
  9505             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9506             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9507             
       
  9508             /* Get the value from a foo(<param_value>) style call */
       
  9509             if (IN_param_value == NULL)
       
  9510               IN_param_value = function_call_param_iterator.next();
       
  9511             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9512             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9513             
       
  9514             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9515             {
       
  9516         
       
  9517                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9518                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  9519                 function_type_prefix = return_type_symbol;
       
  9520                 break;
       
  9521                 
       
  9522             }
       
  9523             
       
  9524             
       
  9525             ERROR;
       
  9526         }
       
  9527         
       
  9528     }/*function_byte_to_lreal*/
       
  9529     break;
       
  9530 
       
  9531 /****
       
  9532  *BYTE_TO_USINT
       
  9533  */
       
  9534     case function_byte_to_usint :
       
  9535     {
       
  9536         symbol_c *last_type_symbol = NULL;
       
  9537 
       
  9538         {
       
  9539             identifier_c param_name("IN");
       
  9540             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9541             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9542             
       
  9543             /* Get the value from a foo(<param_value>) style call */
       
  9544             if (IN_param_value == NULL)
       
  9545               IN_param_value = function_call_param_iterator.next();
       
  9546             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9547             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9548             
       
  9549             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9550             {
       
  9551         
       
  9552                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9553                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  9554                 function_type_prefix = return_type_symbol;
       
  9555                 break;
       
  9556                 
       
  9557             }
       
  9558             
       
  9559             
       
  9560             ERROR;
       
  9561         }
       
  9562         
       
  9563     }/*function_byte_to_usint*/
       
  9564     break;
       
  9565 
       
  9566 /****
       
  9567  *BYTE_TO_ULINT
       
  9568  */
       
  9569     case function_byte_to_ulint :
       
  9570     {
       
  9571         symbol_c *last_type_symbol = NULL;
       
  9572 
       
  9573         {
       
  9574             identifier_c param_name("IN");
       
  9575             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9576             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9577             
       
  9578             /* Get the value from a foo(<param_value>) style call */
       
  9579             if (IN_param_value == NULL)
       
  9580               IN_param_value = function_call_param_iterator.next();
       
  9581             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9582             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9583             
       
  9584             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9585             {
       
  9586         
       
  9587                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9588                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  9589                 function_type_prefix = return_type_symbol;
       
  9590                 break;
       
  9591                 
       
  9592             }
       
  9593             
       
  9594             
       
  9595             ERROR;
       
  9596         }
       
  9597         
       
  9598     }/*function_byte_to_ulint*/
       
  9599     break;
       
  9600 
       
  9601 /****
       
  9602  *BYTE_TO_BOOL
       
  9603  */
       
  9604     case function_byte_to_bool :
       
  9605     {
       
  9606         symbol_c *last_type_symbol = NULL;
       
  9607 
       
  9608         {
       
  9609             identifier_c param_name("IN");
       
  9610             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9611             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9612             
       
  9613             /* Get the value from a foo(<param_value>) style call */
       
  9614             if (IN_param_value == NULL)
       
  9615               IN_param_value = function_call_param_iterator.next();
       
  9616             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9617             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9618             
       
  9619             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9620             {
       
  9621         
       
  9622                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9623                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  9624                 function_type_prefix = return_type_symbol;
       
  9625                 break;
       
  9626                 
       
  9627             }
       
  9628             
       
  9629             
       
  9630             ERROR;
       
  9631         }
       
  9632         
       
  9633     }/*function_byte_to_bool*/
       
  9634     break;
       
  9635 
       
  9636 /****
       
  9637  *BYTE_TO_TIME
       
  9638  */
       
  9639     case function_byte_to_time :
       
  9640     {
       
  9641         symbol_c *last_type_symbol = NULL;
       
  9642 
       
  9643         {
       
  9644             identifier_c param_name("IN");
       
  9645             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9646             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9647             
       
  9648             /* Get the value from a foo(<param_value>) style call */
       
  9649             if (IN_param_value == NULL)
       
  9650               IN_param_value = function_call_param_iterator.next();
       
  9651             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9652             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9653             
       
  9654             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9655             {
       
  9656         
       
  9657                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  9658                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9659                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  9660                 function_type_prefix = return_type_symbol;
       
  9661                 break;
       
  9662                 
       
  9663             }
       
  9664             
       
  9665             
       
  9666             ERROR;
       
  9667         }
       
  9668         
       
  9669     }/*function_byte_to_time*/
       
  9670     break;
       
  9671 
       
  9672 /****
       
  9673  *BYTE_TO_INT
       
  9674  */
       
  9675     case function_byte_to_int :
       
  9676     {
       
  9677         symbol_c *last_type_symbol = NULL;
       
  9678 
       
  9679         {
       
  9680             identifier_c param_name("IN");
       
  9681             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9682             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9683             
       
  9684             /* Get the value from a foo(<param_value>) style call */
       
  9685             if (IN_param_value == NULL)
       
  9686               IN_param_value = function_call_param_iterator.next();
       
  9687             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9688             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9689             
       
  9690             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
  9691             {
       
  9692         
       
  9693                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9694                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  9695                 function_type_prefix = return_type_symbol;
       
  9696                 break;
       
  9697                 
       
  9698             }
       
  9699             
       
  9700             
       
  9701             ERROR;
       
  9702         }
       
  9703         
       
  9704     }/*function_byte_to_int*/
       
  9705     break;
       
  9706 
       
  9707 /****
       
  9708  *USINT_TO_REAL
       
  9709  */
       
  9710     case function_usint_to_real :
       
  9711     {
       
  9712         symbol_c *last_type_symbol = NULL;
       
  9713 
       
  9714         {
       
  9715             identifier_c param_name("IN");
       
  9716             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9717             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9718             
       
  9719             /* Get the value from a foo(<param_value>) style call */
       
  9720             if (IN_param_value == NULL)
       
  9721               IN_param_value = function_call_param_iterator.next();
       
  9722             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9723             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9724             
       
  9725             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  9726             {
       
  9727         
       
  9728                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9729                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  9730                 function_type_prefix = return_type_symbol;
       
  9731                 break;
       
  9732                 
       
  9733             }
       
  9734             
       
  9735             
       
  9736             ERROR;
       
  9737         }
       
  9738         
       
  9739     }/*function_usint_to_real*/
       
  9740     break;
       
  9741 
       
  9742 /****
       
  9743  *USINT_TO_SINT
       
  9744  */
       
  9745     case function_usint_to_sint :
       
  9746     {
       
  9747         symbol_c *last_type_symbol = NULL;
       
  9748 
       
  9749         {
       
  9750             identifier_c param_name("IN");
       
  9751             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9752             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9753             
       
  9754             /* Get the value from a foo(<param_value>) style call */
       
  9755             if (IN_param_value == NULL)
       
  9756               IN_param_value = function_call_param_iterator.next();
       
  9757             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9758             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9759             
       
  9760             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  9761             {
       
  9762         
       
  9763                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9764                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  9765                 function_type_prefix = return_type_symbol;
       
  9766                 break;
       
  9767                 
       
  9768             }
       
  9769             
       
  9770             
       
  9771             ERROR;
       
  9772         }
       
  9773         
       
  9774     }/*function_usint_to_sint*/
       
  9775     break;
       
  9776 
       
  9777 /****
       
  9778  *USINT_TO_LINT
       
  9779  */
       
  9780     case function_usint_to_lint :
       
  9781     {
       
  9782         symbol_c *last_type_symbol = NULL;
       
  9783 
       
  9784         {
       
  9785             identifier_c param_name("IN");
       
  9786             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9787             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9788             
       
  9789             /* Get the value from a foo(<param_value>) style call */
       
  9790             if (IN_param_value == NULL)
       
  9791               IN_param_value = function_call_param_iterator.next();
       
  9792             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9793             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9794             
       
  9795             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  9796             {
       
  9797         
       
  9798                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9799                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  9800                 function_type_prefix = return_type_symbol;
       
  9801                 break;
       
  9802                 
       
  9803             }
       
  9804             
       
  9805             
       
  9806             ERROR;
       
  9807         }
       
  9808         
       
  9809     }/*function_usint_to_lint*/
       
  9810     break;
       
  9811 
       
  9812 /****
       
  9813  *USINT_TO_DINT
       
  9814  */
       
  9815     case function_usint_to_dint :
       
  9816     {
       
  9817         symbol_c *last_type_symbol = NULL;
       
  9818 
       
  9819         {
       
  9820             identifier_c param_name("IN");
       
  9821             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9822             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9823             
       
  9824             /* Get the value from a foo(<param_value>) style call */
       
  9825             if (IN_param_value == NULL)
       
  9826               IN_param_value = function_call_param_iterator.next();
       
  9827             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9828             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9829             
       
  9830             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  9831             {
       
  9832         
       
  9833                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9834                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  9835                 function_type_prefix = return_type_symbol;
       
  9836                 break;
       
  9837                 
       
  9838             }
       
  9839             
       
  9840             
       
  9841             ERROR;
       
  9842         }
       
  9843         
       
  9844     }/*function_usint_to_dint*/
       
  9845     break;
       
  9846 
       
  9847 /****
       
  9848  *USINT_TO_DATE
       
  9849  */
       
  9850     case function_usint_to_date :
       
  9851     {
       
  9852         symbol_c *last_type_symbol = NULL;
       
  9853 
       
  9854         {
       
  9855             identifier_c param_name("IN");
       
  9856             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9857             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9858             
       
  9859             /* Get the value from a foo(<param_value>) style call */
       
  9860             if (IN_param_value == NULL)
       
  9861               IN_param_value = function_call_param_iterator.next();
       
  9862             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9863             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9864             
       
  9865             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  9866             {
       
  9867         
       
  9868                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  9869                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9870                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  9871                 function_type_prefix = return_type_symbol;
       
  9872                 break;
       
  9873                 
       
  9874             }
       
  9875             
       
  9876             
       
  9877             ERROR;
       
  9878         }
       
  9879         
       
  9880     }/*function_usint_to_date*/
       
  9881     break;
       
  9882 
       
  9883 /****
       
  9884  *USINT_TO_DWORD
       
  9885  */
       
  9886     case function_usint_to_dword :
       
  9887     {
       
  9888         symbol_c *last_type_symbol = NULL;
       
  9889 
       
  9890         {
       
  9891             identifier_c param_name("IN");
       
  9892             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9893             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9894             
       
  9895             /* Get the value from a foo(<param_value>) style call */
       
  9896             if (IN_param_value == NULL)
       
  9897               IN_param_value = function_call_param_iterator.next();
       
  9898             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9899             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9900             
       
  9901             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  9902             {
       
  9903         
       
  9904                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9905                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  9906                 function_type_prefix = return_type_symbol;
       
  9907                 break;
       
  9908                 
       
  9909             }
       
  9910             
       
  9911             
       
  9912             ERROR;
       
  9913         }
       
  9914         
       
  9915     }/*function_usint_to_dword*/
       
  9916     break;
       
  9917 
       
  9918 /****
       
  9919  *USINT_TO_DT
       
  9920  */
       
  9921     case function_usint_to_dt :
       
  9922     {
       
  9923         symbol_c *last_type_symbol = NULL;
       
  9924 
       
  9925         {
       
  9926             identifier_c param_name("IN");
       
  9927             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9928             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9929             
       
  9930             /* Get the value from a foo(<param_value>) style call */
       
  9931             if (IN_param_value == NULL)
       
  9932               IN_param_value = function_call_param_iterator.next();
       
  9933             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9934             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9935             
       
  9936             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  9937             {
       
  9938         
       
  9939                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  9940                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9941                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  9942                 function_type_prefix = return_type_symbol;
       
  9943                 break;
       
  9944                 
       
  9945             }
       
  9946             
       
  9947             
       
  9948             ERROR;
       
  9949         }
       
  9950         
       
  9951     }/*function_usint_to_dt*/
       
  9952     break;
       
  9953 
       
  9954 /****
       
  9955  *USINT_TO_TOD
       
  9956  */
       
  9957     case function_usint_to_tod :
       
  9958     {
       
  9959         symbol_c *last_type_symbol = NULL;
       
  9960 
       
  9961         {
       
  9962             identifier_c param_name("IN");
       
  9963             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9964             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9965             
       
  9966             /* Get the value from a foo(<param_value>) style call */
       
  9967             if (IN_param_value == NULL)
       
  9968               IN_param_value = function_call_param_iterator.next();
       
  9969             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9970             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9971             
       
  9972             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  9973             {
       
  9974         
       
  9975                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
  9976                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
  9977                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  9978                 function_type_prefix = return_type_symbol;
       
  9979                 break;
       
  9980                 
       
  9981             }
       
  9982             
       
  9983             
       
  9984             ERROR;
       
  9985         }
       
  9986         
       
  9987     }/*function_usint_to_tod*/
       
  9988     break;
       
  9989 
       
  9990 /****
       
  9991  *USINT_TO_UDINT
       
  9992  */
       
  9993     case function_usint_to_udint :
       
  9994     {
       
  9995         symbol_c *last_type_symbol = NULL;
       
  9996 
       
  9997         {
       
  9998             identifier_c param_name("IN");
       
  9999             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10000             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10001             
       
 10002             /* Get the value from a foo(<param_value>) style call */
       
 10003             if (IN_param_value == NULL)
       
 10004               IN_param_value = function_call_param_iterator.next();
       
 10005             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10006             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10007             
       
 10008             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
 10009             {
       
 10010         
       
 10011                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10012                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 10013                 function_type_prefix = return_type_symbol;
       
 10014                 break;
       
 10015                 
       
 10016             }
       
 10017             
       
 10018             
       
 10019             ERROR;
       
 10020         }
       
 10021         
       
 10022     }/*function_usint_to_udint*/
       
 10023     break;
       
 10024 
       
 10025 /****
       
 10026  *USINT_TO_WORD
       
 10027  */
       
 10028     case function_usint_to_word :
       
 10029     {
       
 10030         symbol_c *last_type_symbol = NULL;
       
 10031 
       
 10032         {
       
 10033             identifier_c param_name("IN");
       
 10034             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10035             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10036             
       
 10037             /* Get the value from a foo(<param_value>) style call */
       
 10038             if (IN_param_value == NULL)
       
 10039               IN_param_value = function_call_param_iterator.next();
       
 10040             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10041             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10042             
       
 10043             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
 10044             {
       
 10045         
       
 10046                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10047                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 10048                 function_type_prefix = return_type_symbol;
       
 10049                 break;
       
 10050                 
       
 10051             }
       
 10052             
       
 10053             
       
 10054             ERROR;
       
 10055         }
       
 10056         
       
 10057     }/*function_usint_to_word*/
       
 10058     break;
       
 10059 
       
 10060 /****
       
 10061  *USINT_TO_STRING
       
 10062  */
       
 10063     case function_usint_to_string :
       
 10064     {
       
 10065         symbol_c *last_type_symbol = NULL;
       
 10066 
       
 10067         {
       
 10068             identifier_c param_name("IN");
       
 10069             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10070             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10071             
       
 10072             /* Get the value from a foo(<param_value>) style call */
       
 10073             if (IN_param_value == NULL)
       
 10074               IN_param_value = function_call_param_iterator.next();
       
 10075             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10076             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10077             
       
 10078             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
 10079             {
       
 10080         
       
 10081                 function_name = (symbol_c*)(new pragma_c("__uint_to_string"));
       
 10082                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10083                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 10084                 function_type_prefix = return_type_symbol;
       
 10085                 break;
       
 10086                 
       
 10087             }
       
 10088             
       
 10089             
       
 10090             ERROR;
       
 10091         }
       
 10092         
       
 10093     }/*function_usint_to_string*/
       
 10094     break;
       
 10095 
       
 10096 /****
       
 10097  *USINT_TO_LWORD
       
 10098  */
       
 10099     case function_usint_to_lword :
       
 10100     {
       
 10101         symbol_c *last_type_symbol = NULL;
       
 10102 
       
 10103         {
       
 10104             identifier_c param_name("IN");
       
 10105             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10106             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10107             
       
 10108             /* Get the value from a foo(<param_value>) style call */
       
 10109             if (IN_param_value == NULL)
       
 10110               IN_param_value = function_call_param_iterator.next();
       
 10111             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10112             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10113             
       
 10114             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
 10115             {
       
 10116         
       
 10117                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10118                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 10119                 function_type_prefix = return_type_symbol;
       
 10120                 break;
       
 10121                 
       
 10122             }
       
 10123             
       
 10124             
       
 10125             ERROR;
       
 10126         }
       
 10127         
       
 10128     }/*function_usint_to_lword*/
       
 10129     break;
       
 10130 
       
 10131 /****
       
 10132  *USINT_TO_UINT
       
 10133  */
       
 10134     case function_usint_to_uint :
       
 10135     {
       
 10136         symbol_c *last_type_symbol = NULL;
       
 10137 
       
 10138         {
       
 10139             identifier_c param_name("IN");
       
 10140             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10141             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10142             
       
 10143             /* Get the value from a foo(<param_value>) style call */
       
 10144             if (IN_param_value == NULL)
       
 10145               IN_param_value = function_call_param_iterator.next();
       
 10146             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10147             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10148             
       
 10149             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
 10150             {
       
 10151         
       
 10152                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10153                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 10154                 function_type_prefix = return_type_symbol;
       
 10155                 break;
       
 10156                 
       
 10157             }
       
 10158             
       
 10159             
       
 10160             ERROR;
       
 10161         }
       
 10162         
       
 10163     }/*function_usint_to_uint*/
       
 10164     break;
       
 10165 
       
 10166 /****
       
 10167  *USINT_TO_LREAL
       
 10168  */
       
 10169     case function_usint_to_lreal :
       
 10170     {
       
 10171         symbol_c *last_type_symbol = NULL;
       
 10172 
       
 10173         {
       
 10174             identifier_c param_name("IN");
       
 10175             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10176             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10177             
       
 10178             /* Get the value from a foo(<param_value>) style call */
       
 10179             if (IN_param_value == NULL)
       
 10180               IN_param_value = function_call_param_iterator.next();
       
 10181             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10182             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10183             
       
 10184             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
 10185             {
       
 10186         
       
 10187                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10188                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 10189                 function_type_prefix = return_type_symbol;
       
 10190                 break;
       
 10191                 
       
 10192             }
       
 10193             
       
 10194             
       
 10195             ERROR;
       
 10196         }
       
 10197         
       
 10198     }/*function_usint_to_lreal*/
       
 10199     break;
       
 10200 
       
 10201 /****
       
 10202  *USINT_TO_BYTE
       
 10203  */
       
 10204     case function_usint_to_byte :
       
 10205     {
       
 10206         symbol_c *last_type_symbol = NULL;
       
 10207 
       
 10208         {
       
 10209             identifier_c param_name("IN");
       
 10210             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10211             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10212             
       
 10213             /* Get the value from a foo(<param_value>) style call */
       
 10214             if (IN_param_value == NULL)
       
 10215               IN_param_value = function_call_param_iterator.next();
       
 10216             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10217             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10218             
       
 10219             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
 10220             {
       
 10221         
       
 10222                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10223                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 10224                 function_type_prefix = return_type_symbol;
       
 10225                 break;
       
 10226                 
       
 10227             }
       
 10228             
       
 10229             
       
 10230             ERROR;
       
 10231         }
       
 10232         
       
 10233     }/*function_usint_to_byte*/
       
 10234     break;
       
 10235 
       
 10236 /****
       
 10237  *USINT_TO_ULINT
       
 10238  */
       
 10239     case function_usint_to_ulint :
       
 10240     {
       
 10241         symbol_c *last_type_symbol = NULL;
       
 10242 
       
 10243         {
       
 10244             identifier_c param_name("IN");
       
 10245             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10246             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10247             
       
 10248             /* Get the value from a foo(<param_value>) style call */
       
 10249             if (IN_param_value == NULL)
       
 10250               IN_param_value = function_call_param_iterator.next();
       
 10251             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10252             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10253             
       
 10254             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
 10255             {
       
 10256         
       
 10257                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10258                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 10259                 function_type_prefix = return_type_symbol;
       
 10260                 break;
       
 10261                 
       
 10262             }
       
 10263             
       
 10264             
       
 10265             ERROR;
       
 10266         }
       
 10267         
       
 10268     }/*function_usint_to_ulint*/
       
 10269     break;
       
 10270 
       
 10271 /****
       
 10272  *USINT_TO_BOOL
       
 10273  */
       
 10274     case function_usint_to_bool :
       
 10275     {
       
 10276         symbol_c *last_type_symbol = NULL;
       
 10277 
       
 10278         {
       
 10279             identifier_c param_name("IN");
       
 10280             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10281             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10282             
       
 10283             /* Get the value from a foo(<param_value>) style call */
       
 10284             if (IN_param_value == NULL)
       
 10285               IN_param_value = function_call_param_iterator.next();
       
 10286             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10287             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10288             
       
 10289             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
 10290             {
       
 10291         
       
 10292                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10293                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 10294                 function_type_prefix = return_type_symbol;
       
 10295                 break;
       
 10296                 
       
 10297             }
       
 10298             
       
 10299             
       
 10300             ERROR;
       
 10301         }
       
 10302         
       
 10303     }/*function_usint_to_bool*/
       
 10304     break;
       
 10305 
       
 10306 /****
       
 10307  *USINT_TO_TIME
       
 10308  */
       
 10309     case function_usint_to_time :
       
 10310     {
       
 10311         symbol_c *last_type_symbol = NULL;
       
 10312 
       
 10313         {
       
 10314             identifier_c param_name("IN");
       
 10315             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10316             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10317             
       
 10318             /* Get the value from a foo(<param_value>) style call */
       
 10319             if (IN_param_value == NULL)
       
 10320               IN_param_value = function_call_param_iterator.next();
       
 10321             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10322             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10323             
       
 10324             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
 10325             {
       
 10326         
       
 10327                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
 10328                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10329                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 10330                 function_type_prefix = return_type_symbol;
       
 10331                 break;
       
 10332                 
       
 10333             }
       
 10334             
       
 10335             
       
 10336             ERROR;
       
 10337         }
       
 10338         
       
 10339     }/*function_usint_to_time*/
       
 10340     break;
       
 10341 
       
 10342 /****
       
 10343  *USINT_TO_INT
       
 10344  */
       
 10345     case function_usint_to_int :
       
 10346     {
       
 10347         symbol_c *last_type_symbol = NULL;
       
 10348 
       
 10349         {
       
 10350             identifier_c param_name("IN");
       
 10351             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10352             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10353             
       
 10354             /* Get the value from a foo(<param_value>) style call */
       
 10355             if (IN_param_value == NULL)
       
 10356               IN_param_value = function_call_param_iterator.next();
       
 10357             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10358             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10359             
       
 10360             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
 10361             {
       
 10362         
       
 10363                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10364                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 10365                 function_type_prefix = return_type_symbol;
       
 10366                 break;
       
 10367                 
       
 10368             }
       
 10369             
       
 10370             
       
 10371             ERROR;
       
 10372         }
       
 10373         
       
 10374     }/*function_usint_to_int*/
       
 10375     break;
       
 10376 
       
 10377 /****
       
 10378  *ULINT_TO_REAL
       
 10379  */
       
 10380     case function_ulint_to_real :
       
 10381     {
       
 10382         symbol_c *last_type_symbol = NULL;
       
 10383 
       
 10384         {
       
 10385             identifier_c param_name("IN");
       
 10386             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10387             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10388             
       
 10389             /* Get the value from a foo(<param_value>) style call */
       
 10390             if (IN_param_value == NULL)
       
 10391               IN_param_value = function_call_param_iterator.next();
       
 10392             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10393             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10394             
       
 10395             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10396             {
       
 10397         
       
 10398                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10399                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 10400                 function_type_prefix = return_type_symbol;
       
 10401                 break;
       
 10402                 
       
 10403             }
       
 10404             
       
 10405             
       
 10406             ERROR;
       
 10407         }
       
 10408         
       
 10409     }/*function_ulint_to_real*/
       
 10410     break;
       
 10411 
       
 10412 /****
       
 10413  *ULINT_TO_SINT
       
 10414  */
       
 10415     case function_ulint_to_sint :
       
 10416     {
       
 10417         symbol_c *last_type_symbol = NULL;
       
 10418 
       
 10419         {
       
 10420             identifier_c param_name("IN");
       
 10421             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10422             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10423             
       
 10424             /* Get the value from a foo(<param_value>) style call */
       
 10425             if (IN_param_value == NULL)
       
 10426               IN_param_value = function_call_param_iterator.next();
       
 10427             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10428             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10429             
       
 10430             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10431             {
       
 10432         
       
 10433                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10434                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 10435                 function_type_prefix = return_type_symbol;
       
 10436                 break;
       
 10437                 
       
 10438             }
       
 10439             
       
 10440             
       
 10441             ERROR;
       
 10442         }
       
 10443         
       
 10444     }/*function_ulint_to_sint*/
       
 10445     break;
       
 10446 
       
 10447 /****
       
 10448  *ULINT_TO_LINT
       
 10449  */
       
 10450     case function_ulint_to_lint :
       
 10451     {
       
 10452         symbol_c *last_type_symbol = NULL;
       
 10453 
       
 10454         {
       
 10455             identifier_c param_name("IN");
       
 10456             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10457             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10458             
       
 10459             /* Get the value from a foo(<param_value>) style call */
       
 10460             if (IN_param_value == NULL)
       
 10461               IN_param_value = function_call_param_iterator.next();
       
 10462             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10463             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10464             
       
 10465             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10466             {
       
 10467         
       
 10468                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10469                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 10470                 function_type_prefix = return_type_symbol;
       
 10471                 break;
       
 10472                 
       
 10473             }
       
 10474             
       
 10475             
       
 10476             ERROR;
       
 10477         }
       
 10478         
       
 10479     }/*function_ulint_to_lint*/
       
 10480     break;
       
 10481 
       
 10482 /****
       
 10483  *ULINT_TO_DINT
       
 10484  */
       
 10485     case function_ulint_to_dint :
       
 10486     {
       
 10487         symbol_c *last_type_symbol = NULL;
       
 10488 
       
 10489         {
       
 10490             identifier_c param_name("IN");
       
 10491             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10492             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10493             
       
 10494             /* Get the value from a foo(<param_value>) style call */
       
 10495             if (IN_param_value == NULL)
       
 10496               IN_param_value = function_call_param_iterator.next();
       
 10497             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10498             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10499             
       
 10500             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10501             {
       
 10502         
       
 10503                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10504                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 10505                 function_type_prefix = return_type_symbol;
       
 10506                 break;
       
 10507                 
       
 10508             }
       
 10509             
       
 10510             
       
 10511             ERROR;
       
 10512         }
       
 10513         
       
 10514     }/*function_ulint_to_dint*/
       
 10515     break;
       
 10516 
       
 10517 /****
       
 10518  *ULINT_TO_DATE
       
 10519  */
       
 10520     case function_ulint_to_date :
       
 10521     {
       
 10522         symbol_c *last_type_symbol = NULL;
       
 10523 
       
 10524         {
       
 10525             identifier_c param_name("IN");
       
 10526             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10527             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10528             
       
 10529             /* Get the value from a foo(<param_value>) style call */
       
 10530             if (IN_param_value == NULL)
       
 10531               IN_param_value = function_call_param_iterator.next();
       
 10532             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10533             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10534             
       
 10535             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10536             {
       
 10537         
       
 10538                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
 10539                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10540                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 10541                 function_type_prefix = return_type_symbol;
       
 10542                 break;
       
 10543                 
       
 10544             }
       
 10545             
       
 10546             
       
 10547             ERROR;
       
 10548         }
       
 10549         
       
 10550     }/*function_ulint_to_date*/
       
 10551     break;
       
 10552 
       
 10553 /****
       
 10554  *ULINT_TO_DWORD
       
 10555  */
       
 10556     case function_ulint_to_dword :
       
 10557     {
       
 10558         symbol_c *last_type_symbol = NULL;
       
 10559 
       
 10560         {
       
 10561             identifier_c param_name("IN");
       
 10562             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10563             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10564             
       
 10565             /* Get the value from a foo(<param_value>) style call */
       
 10566             if (IN_param_value == NULL)
       
 10567               IN_param_value = function_call_param_iterator.next();
       
 10568             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10569             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10570             
       
 10571             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10572             {
       
 10573         
       
 10574                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10575                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 10576                 function_type_prefix = return_type_symbol;
       
 10577                 break;
       
 10578                 
       
 10579             }
       
 10580             
       
 10581             
       
 10582             ERROR;
       
 10583         }
       
 10584         
       
 10585     }/*function_ulint_to_dword*/
       
 10586     break;
       
 10587 
       
 10588 /****
       
 10589  *ULINT_TO_DT
       
 10590  */
       
 10591     case function_ulint_to_dt :
       
 10592     {
       
 10593         symbol_c *last_type_symbol = NULL;
       
 10594 
       
 10595         {
       
 10596             identifier_c param_name("IN");
       
 10597             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10598             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10599             
       
 10600             /* Get the value from a foo(<param_value>) style call */
       
 10601             if (IN_param_value == NULL)
       
 10602               IN_param_value = function_call_param_iterator.next();
       
 10603             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10604             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10605             
       
 10606             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10607             {
       
 10608         
       
 10609                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
 10610                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10611                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 10612                 function_type_prefix = return_type_symbol;
       
 10613                 break;
       
 10614                 
       
 10615             }
       
 10616             
       
 10617             
       
 10618             ERROR;
       
 10619         }
       
 10620         
       
 10621     }/*function_ulint_to_dt*/
       
 10622     break;
       
 10623 
       
 10624 /****
       
 10625  *ULINT_TO_TOD
       
 10626  */
       
 10627     case function_ulint_to_tod :
       
 10628     {
       
 10629         symbol_c *last_type_symbol = NULL;
       
 10630 
       
 10631         {
       
 10632             identifier_c param_name("IN");
       
 10633             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10634             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10635             
       
 10636             /* Get the value from a foo(<param_value>) style call */
       
 10637             if (IN_param_value == NULL)
       
 10638               IN_param_value = function_call_param_iterator.next();
       
 10639             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10640             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10641             
       
 10642             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10643             {
       
 10644         
       
 10645                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
 10646                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10647                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 10648                 function_type_prefix = return_type_symbol;
       
 10649                 break;
       
 10650                 
       
 10651             }
       
 10652             
       
 10653             
       
 10654             ERROR;
       
 10655         }
       
 10656         
       
 10657     }/*function_ulint_to_tod*/
       
 10658     break;
       
 10659 
       
 10660 /****
       
 10661  *ULINT_TO_UDINT
       
 10662  */
       
 10663     case function_ulint_to_udint :
       
 10664     {
       
 10665         symbol_c *last_type_symbol = NULL;
       
 10666 
       
 10667         {
       
 10668             identifier_c param_name("IN");
       
 10669             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10670             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10671             
       
 10672             /* Get the value from a foo(<param_value>) style call */
       
 10673             if (IN_param_value == NULL)
       
 10674               IN_param_value = function_call_param_iterator.next();
       
 10675             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10676             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10677             
       
 10678             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10679             {
       
 10680         
       
 10681                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10682                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 10683                 function_type_prefix = return_type_symbol;
       
 10684                 break;
       
 10685                 
       
 10686             }
       
 10687             
       
 10688             
       
 10689             ERROR;
       
 10690         }
       
 10691         
       
 10692     }/*function_ulint_to_udint*/
       
 10693     break;
       
 10694 
       
 10695 /****
       
 10696  *ULINT_TO_WORD
       
 10697  */
       
 10698     case function_ulint_to_word :
       
 10699     {
       
 10700         symbol_c *last_type_symbol = NULL;
       
 10701 
       
 10702         {
       
 10703             identifier_c param_name("IN");
       
 10704             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10705             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10706             
       
 10707             /* Get the value from a foo(<param_value>) style call */
       
 10708             if (IN_param_value == NULL)
       
 10709               IN_param_value = function_call_param_iterator.next();
       
 10710             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10711             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10712             
       
 10713             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10714             {
       
 10715         
       
 10716                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10717                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 10718                 function_type_prefix = return_type_symbol;
       
 10719                 break;
       
 10720                 
       
 10721             }
       
 10722             
       
 10723             
       
 10724             ERROR;
       
 10725         }
       
 10726         
       
 10727     }/*function_ulint_to_word*/
       
 10728     break;
       
 10729 
       
 10730 /****
       
 10731  *ULINT_TO_STRING
       
 10732  */
       
 10733     case function_ulint_to_string :
       
 10734     {
       
 10735         symbol_c *last_type_symbol = NULL;
       
 10736 
       
 10737         {
       
 10738             identifier_c param_name("IN");
       
 10739             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10740             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10741             
       
 10742             /* Get the value from a foo(<param_value>) style call */
       
 10743             if (IN_param_value == NULL)
       
 10744               IN_param_value = function_call_param_iterator.next();
       
 10745             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10746             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10747             
       
 10748             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10749             {
       
 10750         
       
 10751                 function_name = (symbol_c*)(new pragma_c("__uint_to_string"));
       
 10752                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10753                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 10754                 function_type_prefix = return_type_symbol;
       
 10755                 break;
       
 10756                 
       
 10757             }
       
 10758             
       
 10759             
       
 10760             ERROR;
       
 10761         }
       
 10762         
       
 10763     }/*function_ulint_to_string*/
       
 10764     break;
       
 10765 
       
 10766 /****
       
 10767  *ULINT_TO_LWORD
       
 10768  */
       
 10769     case function_ulint_to_lword :
       
 10770     {
       
 10771         symbol_c *last_type_symbol = NULL;
       
 10772 
       
 10773         {
       
 10774             identifier_c param_name("IN");
       
 10775             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10776             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10777             
       
 10778             /* Get the value from a foo(<param_value>) style call */
       
 10779             if (IN_param_value == NULL)
       
 10780               IN_param_value = function_call_param_iterator.next();
       
 10781             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10782             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10783             
       
 10784             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10785             {
       
 10786         
       
 10787                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10788                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 10789                 function_type_prefix = return_type_symbol;
       
 10790                 break;
       
 10791                 
       
 10792             }
       
 10793             
       
 10794             
       
 10795             ERROR;
       
 10796         }
       
 10797         
       
 10798     }/*function_ulint_to_lword*/
       
 10799     break;
       
 10800 
       
 10801 /****
       
 10802  *ULINT_TO_UINT
       
 10803  */
       
 10804     case function_ulint_to_uint :
       
 10805     {
       
 10806         symbol_c *last_type_symbol = NULL;
       
 10807 
       
 10808         {
       
 10809             identifier_c param_name("IN");
       
 10810             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10811             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10812             
       
 10813             /* Get the value from a foo(<param_value>) style call */
       
 10814             if (IN_param_value == NULL)
       
 10815               IN_param_value = function_call_param_iterator.next();
       
 10816             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10817             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10818             
       
 10819             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10820             {
       
 10821         
       
 10822                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10823                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 10824                 function_type_prefix = return_type_symbol;
       
 10825                 break;
       
 10826                 
       
 10827             }
       
 10828             
       
 10829             
       
 10830             ERROR;
       
 10831         }
       
 10832         
       
 10833     }/*function_ulint_to_uint*/
       
 10834     break;
       
 10835 
       
 10836 /****
       
 10837  *ULINT_TO_LREAL
       
 10838  */
       
 10839     case function_ulint_to_lreal :
       
 10840     {
       
 10841         symbol_c *last_type_symbol = NULL;
       
 10842 
       
 10843         {
       
 10844             identifier_c param_name("IN");
       
 10845             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10846             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10847             
       
 10848             /* Get the value from a foo(<param_value>) style call */
       
 10849             if (IN_param_value == NULL)
       
 10850               IN_param_value = function_call_param_iterator.next();
       
 10851             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10852             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10853             
       
 10854             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10855             {
       
 10856         
       
 10857                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10858                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 10859                 function_type_prefix = return_type_symbol;
       
 10860                 break;
       
 10861                 
       
 10862             }
       
 10863             
       
 10864             
       
 10865             ERROR;
       
 10866         }
       
 10867         
       
 10868     }/*function_ulint_to_lreal*/
       
 10869     break;
       
 10870 
       
 10871 /****
       
 10872  *ULINT_TO_BYTE
       
 10873  */
       
 10874     case function_ulint_to_byte :
       
 10875     {
       
 10876         symbol_c *last_type_symbol = NULL;
       
 10877 
       
 10878         {
       
 10879             identifier_c param_name("IN");
       
 10880             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10881             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10882             
       
 10883             /* Get the value from a foo(<param_value>) style call */
       
 10884             if (IN_param_value == NULL)
       
 10885               IN_param_value = function_call_param_iterator.next();
       
 10886             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10887             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10888             
       
 10889             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10890             {
       
 10891         
       
 10892                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10893                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 10894                 function_type_prefix = return_type_symbol;
       
 10895                 break;
       
 10896                 
       
 10897             }
       
 10898             
       
 10899             
       
 10900             ERROR;
       
 10901         }
       
 10902         
       
 10903     }/*function_ulint_to_byte*/
       
 10904     break;
       
 10905 
       
 10906 /****
       
 10907  *ULINT_TO_USINT
       
 10908  */
       
 10909     case function_ulint_to_usint :
       
 10910     {
       
 10911         symbol_c *last_type_symbol = NULL;
       
 10912 
       
 10913         {
       
 10914             identifier_c param_name("IN");
       
 10915             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10916             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10917             
       
 10918             /* Get the value from a foo(<param_value>) style call */
       
 10919             if (IN_param_value == NULL)
       
 10920               IN_param_value = function_call_param_iterator.next();
       
 10921             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10922             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10923             
       
 10924             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10925             {
       
 10926         
       
 10927                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10928                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 10929                 function_type_prefix = return_type_symbol;
       
 10930                 break;
       
 10931                 
       
 10932             }
       
 10933             
       
 10934             
       
 10935             ERROR;
       
 10936         }
       
 10937         
       
 10938     }/*function_ulint_to_usint*/
       
 10939     break;
       
 10940 
       
 10941 /****
       
 10942  *ULINT_TO_BOOL
       
 10943  */
       
 10944     case function_ulint_to_bool :
       
 10945     {
       
 10946         symbol_c *last_type_symbol = NULL;
       
 10947 
       
 10948         {
       
 10949             identifier_c param_name("IN");
       
 10950             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10951             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10952             
       
 10953             /* Get the value from a foo(<param_value>) style call */
       
 10954             if (IN_param_value == NULL)
       
 10955               IN_param_value = function_call_param_iterator.next();
       
 10956             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10957             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10958             
       
 10959             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10960             {
       
 10961         
       
 10962                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10963                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 10964                 function_type_prefix = return_type_symbol;
       
 10965                 break;
       
 10966                 
       
 10967             }
       
 10968             
       
 10969             
       
 10970             ERROR;
       
 10971         }
       
 10972         
       
 10973     }/*function_ulint_to_bool*/
       
 10974     break;
       
 10975 
       
 10976 /****
       
 10977  *ULINT_TO_TIME
       
 10978  */
       
 10979     case function_ulint_to_time :
       
 10980     {
       
 10981         symbol_c *last_type_symbol = NULL;
       
 10982 
       
 10983         {
       
 10984             identifier_c param_name("IN");
       
 10985             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10986             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10987             
       
 10988             /* Get the value from a foo(<param_value>) style call */
       
 10989             if (IN_param_value == NULL)
       
 10990               IN_param_value = function_call_param_iterator.next();
       
 10991             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10992             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10993             
       
 10994             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 10995             {
       
 10996         
       
 10997                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
 10998                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 10999                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 11000                 function_type_prefix = return_type_symbol;
       
 11001                 break;
       
 11002                 
       
 11003             }
       
 11004             
       
 11005             
       
 11006             ERROR;
       
 11007         }
       
 11008         
       
 11009     }/*function_ulint_to_time*/
       
 11010     break;
       
 11011 
       
 11012 /****
       
 11013  *ULINT_TO_INT
       
 11014  */
       
 11015     case function_ulint_to_int :
       
 11016     {
       
 11017         symbol_c *last_type_symbol = NULL;
       
 11018 
       
 11019         {
       
 11020             identifier_c param_name("IN");
       
 11021             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11022             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11023             
       
 11024             /* Get the value from a foo(<param_value>) style call */
       
 11025             if (IN_param_value == NULL)
       
 11026               IN_param_value = function_call_param_iterator.next();
       
 11027             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11028             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11029             
       
 11030             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 11031             {
       
 11032         
       
 11033                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11034                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 11035                 function_type_prefix = return_type_symbol;
       
 11036                 break;
       
 11037                 
       
 11038             }
       
 11039             
       
 11040             
       
 11041             ERROR;
       
 11042         }
       
 11043         
       
 11044     }/*function_ulint_to_int*/
       
 11045     break;
       
 11046 
       
 11047 /****
       
 11048  *BOOL_TO_REAL
       
 11049  */
       
 11050     case function_bool_to_real :
       
 11051     {
       
 11052         symbol_c *last_type_symbol = NULL;
       
 11053 
       
 11054         {
       
 11055             identifier_c param_name("IN");
       
 11056             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11057             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11058             
       
 11059             /* Get the value from a foo(<param_value>) style call */
       
 11060             if (IN_param_value == NULL)
       
 11061               IN_param_value = function_call_param_iterator.next();
       
 11062             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11063             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11064             
       
 11065             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11066             {
       
 11067         
       
 11068                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11069                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 11070                 function_type_prefix = return_type_symbol;
       
 11071                 break;
       
 11072                 
       
 11073             }
       
 11074             
       
 11075             
       
 11076             ERROR;
       
 11077         }
       
 11078         
       
 11079     }/*function_bool_to_real*/
       
 11080     break;
       
 11081 
       
 11082 /****
    33  *BOOL_TO_SINT
 11083  *BOOL_TO_SINT
    34  */
 11084  */
    35     case function_bool_to_sint :
 11085     case function_bool_to_sint :
    36     {
 11086     {
    37         symbol_c *last_type_symbol = NULL;
 11087         symbol_c *last_type_symbol = NULL;
    48             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 11098             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
    49             
 11099             
    50             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
 11100             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
    51             {
 11101             {
    52         
 11102         
       
 11103                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
    53                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
 11104                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
    54                 s4o.print("(");
 11105                 function_type_prefix = return_type_symbol;
    55                 return_type_symbol->accept(*this);
 11106                 break;
    56                 s4o.print(")");
 11107                 
    57                 IN_param_value->accept(*this);
 11108             }
    58                 return NULL;
 11109             
    59                 
       
    60             }
       
    61             
 11110             
    62             ERROR;
 11111             ERROR;
    63         }
 11112         }
    64         
 11113         
    65     }/*function_bool_to_sint*/
 11114     }/*function_bool_to_sint*/
    66     break;
 11115     break;
    67 
 11116 
    68 /****
 11117 /****
       
 11118  *BOOL_TO_LINT
       
 11119  */
       
 11120     case function_bool_to_lint :
       
 11121     {
       
 11122         symbol_c *last_type_symbol = NULL;
       
 11123 
       
 11124         {
       
 11125             identifier_c param_name("IN");
       
 11126             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11127             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11128             
       
 11129             /* Get the value from a foo(<param_value>) style call */
       
 11130             if (IN_param_value == NULL)
       
 11131               IN_param_value = function_call_param_iterator.next();
       
 11132             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11133             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11134             
       
 11135             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11136             {
       
 11137         
       
 11138                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11139                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 11140                 function_type_prefix = return_type_symbol;
       
 11141                 break;
       
 11142                 
       
 11143             }
       
 11144             
       
 11145             
       
 11146             ERROR;
       
 11147         }
       
 11148         
       
 11149     }/*function_bool_to_lint*/
       
 11150     break;
       
 11151 
       
 11152 /****
       
 11153  *BOOL_TO_DINT
       
 11154  */
       
 11155     case function_bool_to_dint :
       
 11156     {
       
 11157         symbol_c *last_type_symbol = NULL;
       
 11158 
       
 11159         {
       
 11160             identifier_c param_name("IN");
       
 11161             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11162             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11163             
       
 11164             /* Get the value from a foo(<param_value>) style call */
       
 11165             if (IN_param_value == NULL)
       
 11166               IN_param_value = function_call_param_iterator.next();
       
 11167             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11168             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11169             
       
 11170             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11171             {
       
 11172         
       
 11173                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11174                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 11175                 function_type_prefix = return_type_symbol;
       
 11176                 break;
       
 11177                 
       
 11178             }
       
 11179             
       
 11180             
       
 11181             ERROR;
       
 11182         }
       
 11183         
       
 11184     }/*function_bool_to_dint*/
       
 11185     break;
       
 11186 
       
 11187 /****
       
 11188  *BOOL_TO_DATE
       
 11189  */
       
 11190     case function_bool_to_date :
       
 11191     {
       
 11192         symbol_c *last_type_symbol = NULL;
       
 11193 
       
 11194         {
       
 11195             identifier_c param_name("IN");
       
 11196             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11197             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11198             
       
 11199             /* Get the value from a foo(<param_value>) style call */
       
 11200             if (IN_param_value == NULL)
       
 11201               IN_param_value = function_call_param_iterator.next();
       
 11202             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11203             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11204             
       
 11205             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11206             {
       
 11207         
       
 11208                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
 11209                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11210                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 11211                 function_type_prefix = return_type_symbol;
       
 11212                 break;
       
 11213                 
       
 11214             }
       
 11215             
       
 11216             
       
 11217             ERROR;
       
 11218         }
       
 11219         
       
 11220     }/*function_bool_to_date*/
       
 11221     break;
       
 11222 
       
 11223 /****
       
 11224  *BOOL_TO_DWORD
       
 11225  */
       
 11226     case function_bool_to_dword :
       
 11227     {
       
 11228         symbol_c *last_type_symbol = NULL;
       
 11229 
       
 11230         {
       
 11231             identifier_c param_name("IN");
       
 11232             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11233             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11234             
       
 11235             /* Get the value from a foo(<param_value>) style call */
       
 11236             if (IN_param_value == NULL)
       
 11237               IN_param_value = function_call_param_iterator.next();
       
 11238             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11239             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11240             
       
 11241             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11242             {
       
 11243         
       
 11244                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11245                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 11246                 function_type_prefix = return_type_symbol;
       
 11247                 break;
       
 11248                 
       
 11249             }
       
 11250             
       
 11251             
       
 11252             ERROR;
       
 11253         }
       
 11254         
       
 11255     }/*function_bool_to_dword*/
       
 11256     break;
       
 11257 
       
 11258 /****
       
 11259  *BOOL_TO_DT
       
 11260  */
       
 11261     case function_bool_to_dt :
       
 11262     {
       
 11263         symbol_c *last_type_symbol = NULL;
       
 11264 
       
 11265         {
       
 11266             identifier_c param_name("IN");
       
 11267             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11268             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11269             
       
 11270             /* Get the value from a foo(<param_value>) style call */
       
 11271             if (IN_param_value == NULL)
       
 11272               IN_param_value = function_call_param_iterator.next();
       
 11273             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11274             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11275             
       
 11276             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11277             {
       
 11278         
       
 11279                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
 11280                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11281                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 11282                 function_type_prefix = return_type_symbol;
       
 11283                 break;
       
 11284                 
       
 11285             }
       
 11286             
       
 11287             
       
 11288             ERROR;
       
 11289         }
       
 11290         
       
 11291     }/*function_bool_to_dt*/
       
 11292     break;
       
 11293 
       
 11294 /****
       
 11295  *BOOL_TO_TOD
       
 11296  */
       
 11297     case function_bool_to_tod :
       
 11298     {
       
 11299         symbol_c *last_type_symbol = NULL;
       
 11300 
       
 11301         {
       
 11302             identifier_c param_name("IN");
       
 11303             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11304             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11305             
       
 11306             /* Get the value from a foo(<param_value>) style call */
       
 11307             if (IN_param_value == NULL)
       
 11308               IN_param_value = function_call_param_iterator.next();
       
 11309             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11310             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11311             
       
 11312             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11313             {
       
 11314         
       
 11315                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
 11316                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11317                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 11318                 function_type_prefix = return_type_symbol;
       
 11319                 break;
       
 11320                 
       
 11321             }
       
 11322             
       
 11323             
       
 11324             ERROR;
       
 11325         }
       
 11326         
       
 11327     }/*function_bool_to_tod*/
       
 11328     break;
       
 11329 
       
 11330 /****
       
 11331  *BOOL_TO_UDINT
       
 11332  */
       
 11333     case function_bool_to_udint :
       
 11334     {
       
 11335         symbol_c *last_type_symbol = NULL;
       
 11336 
       
 11337         {
       
 11338             identifier_c param_name("IN");
       
 11339             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11340             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11341             
       
 11342             /* Get the value from a foo(<param_value>) style call */
       
 11343             if (IN_param_value == NULL)
       
 11344               IN_param_value = function_call_param_iterator.next();
       
 11345             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11346             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11347             
       
 11348             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11349             {
       
 11350         
       
 11351                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11352                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 11353                 function_type_prefix = return_type_symbol;
       
 11354                 break;
       
 11355                 
       
 11356             }
       
 11357             
       
 11358             
       
 11359             ERROR;
       
 11360         }
       
 11361         
       
 11362     }/*function_bool_to_udint*/
       
 11363     break;
       
 11364 
       
 11365 /****
       
 11366  *BOOL_TO_WORD
       
 11367  */
       
 11368     case function_bool_to_word :
       
 11369     {
       
 11370         symbol_c *last_type_symbol = NULL;
       
 11371 
       
 11372         {
       
 11373             identifier_c param_name("IN");
       
 11374             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11375             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11376             
       
 11377             /* Get the value from a foo(<param_value>) style call */
       
 11378             if (IN_param_value == NULL)
       
 11379               IN_param_value = function_call_param_iterator.next();
       
 11380             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11381             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11382             
       
 11383             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11384             {
       
 11385         
       
 11386                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11387                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 11388                 function_type_prefix = return_type_symbol;
       
 11389                 break;
       
 11390                 
       
 11391             }
       
 11392             
       
 11393             
       
 11394             ERROR;
       
 11395         }
       
 11396         
       
 11397     }/*function_bool_to_word*/
       
 11398     break;
       
 11399 
       
 11400 /****
       
 11401  *BOOL_TO_STRING
       
 11402  */
       
 11403     case function_bool_to_string :
       
 11404     {
       
 11405         symbol_c *last_type_symbol = NULL;
       
 11406 
       
 11407         {
       
 11408             identifier_c param_name("IN");
       
 11409             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11410             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11411             
       
 11412             /* Get the value from a foo(<param_value>) style call */
       
 11413             if (IN_param_value == NULL)
       
 11414               IN_param_value = function_call_param_iterator.next();
       
 11415             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11416             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11417             
       
 11418             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11419             {
       
 11420         
       
 11421                 function_name = (symbol_c*)(new pragma_c("__bool_to_string"));
       
 11422                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11423                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 11424                 function_type_prefix = return_type_symbol;
       
 11425                 break;
       
 11426                 
       
 11427             }
       
 11428             
       
 11429             
       
 11430             ERROR;
       
 11431         }
       
 11432         
       
 11433     }/*function_bool_to_string*/
       
 11434     break;
       
 11435 
       
 11436 /****
       
 11437  *BOOL_TO_LWORD
       
 11438  */
       
 11439     case function_bool_to_lword :
       
 11440     {
       
 11441         symbol_c *last_type_symbol = NULL;
       
 11442 
       
 11443         {
       
 11444             identifier_c param_name("IN");
       
 11445             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11446             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11447             
       
 11448             /* Get the value from a foo(<param_value>) style call */
       
 11449             if (IN_param_value == NULL)
       
 11450               IN_param_value = function_call_param_iterator.next();
       
 11451             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11452             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11453             
       
 11454             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11455             {
       
 11456         
       
 11457                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11458                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 11459                 function_type_prefix = return_type_symbol;
       
 11460                 break;
       
 11461                 
       
 11462             }
       
 11463             
       
 11464             
       
 11465             ERROR;
       
 11466         }
       
 11467         
       
 11468     }/*function_bool_to_lword*/
       
 11469     break;
       
 11470 
       
 11471 /****
       
 11472  *BOOL_TO_UINT
       
 11473  */
       
 11474     case function_bool_to_uint :
       
 11475     {
       
 11476         symbol_c *last_type_symbol = NULL;
       
 11477 
       
 11478         {
       
 11479             identifier_c param_name("IN");
       
 11480             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11481             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11482             
       
 11483             /* Get the value from a foo(<param_value>) style call */
       
 11484             if (IN_param_value == NULL)
       
 11485               IN_param_value = function_call_param_iterator.next();
       
 11486             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11487             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11488             
       
 11489             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11490             {
       
 11491         
       
 11492                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11493                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 11494                 function_type_prefix = return_type_symbol;
       
 11495                 break;
       
 11496                 
       
 11497             }
       
 11498             
       
 11499             
       
 11500             ERROR;
       
 11501         }
       
 11502         
       
 11503     }/*function_bool_to_uint*/
       
 11504     break;
       
 11505 
       
 11506 /****
       
 11507  *BOOL_TO_LREAL
       
 11508  */
       
 11509     case function_bool_to_lreal :
       
 11510     {
       
 11511         symbol_c *last_type_symbol = NULL;
       
 11512 
       
 11513         {
       
 11514             identifier_c param_name("IN");
       
 11515             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11516             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11517             
       
 11518             /* Get the value from a foo(<param_value>) style call */
       
 11519             if (IN_param_value == NULL)
       
 11520               IN_param_value = function_call_param_iterator.next();
       
 11521             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11522             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11523             
       
 11524             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11525             {
       
 11526         
       
 11527                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11528                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 11529                 function_type_prefix = return_type_symbol;
       
 11530                 break;
       
 11531                 
       
 11532             }
       
 11533             
       
 11534             
       
 11535             ERROR;
       
 11536         }
       
 11537         
       
 11538     }/*function_bool_to_lreal*/
       
 11539     break;
       
 11540 
       
 11541 /****
       
 11542  *BOOL_TO_BYTE
       
 11543  */
       
 11544     case function_bool_to_byte :
       
 11545     {
       
 11546         symbol_c *last_type_symbol = NULL;
       
 11547 
       
 11548         {
       
 11549             identifier_c param_name("IN");
       
 11550             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11551             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11552             
       
 11553             /* Get the value from a foo(<param_value>) style call */
       
 11554             if (IN_param_value == NULL)
       
 11555               IN_param_value = function_call_param_iterator.next();
       
 11556             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11557             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11558             
       
 11559             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11560             {
       
 11561         
       
 11562                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11563                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 11564                 function_type_prefix = return_type_symbol;
       
 11565                 break;
       
 11566                 
       
 11567             }
       
 11568             
       
 11569             
       
 11570             ERROR;
       
 11571         }
       
 11572         
       
 11573     }/*function_bool_to_byte*/
       
 11574     break;
       
 11575 
       
 11576 /****
       
 11577  *BOOL_TO_USINT
       
 11578  */
       
 11579     case function_bool_to_usint :
       
 11580     {
       
 11581         symbol_c *last_type_symbol = NULL;
       
 11582 
       
 11583         {
       
 11584             identifier_c param_name("IN");
       
 11585             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11586             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11587             
       
 11588             /* Get the value from a foo(<param_value>) style call */
       
 11589             if (IN_param_value == NULL)
       
 11590               IN_param_value = function_call_param_iterator.next();
       
 11591             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11592             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11593             
       
 11594             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11595             {
       
 11596         
       
 11597                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11598                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 11599                 function_type_prefix = return_type_symbol;
       
 11600                 break;
       
 11601                 
       
 11602             }
       
 11603             
       
 11604             
       
 11605             ERROR;
       
 11606         }
       
 11607         
       
 11608     }/*function_bool_to_usint*/
       
 11609     break;
       
 11610 
       
 11611 /****
       
 11612  *BOOL_TO_ULINT
       
 11613  */
       
 11614     case function_bool_to_ulint :
       
 11615     {
       
 11616         symbol_c *last_type_symbol = NULL;
       
 11617 
       
 11618         {
       
 11619             identifier_c param_name("IN");
       
 11620             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11621             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11622             
       
 11623             /* Get the value from a foo(<param_value>) style call */
       
 11624             if (IN_param_value == NULL)
       
 11625               IN_param_value = function_call_param_iterator.next();
       
 11626             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11627             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11628             
       
 11629             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11630             {
       
 11631         
       
 11632                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11633                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 11634                 function_type_prefix = return_type_symbol;
       
 11635                 break;
       
 11636                 
       
 11637             }
       
 11638             
       
 11639             
       
 11640             ERROR;
       
 11641         }
       
 11642         
       
 11643     }/*function_bool_to_ulint*/
       
 11644     break;
       
 11645 
       
 11646 /****
       
 11647  *BOOL_TO_TIME
       
 11648  */
       
 11649     case function_bool_to_time :
       
 11650     {
       
 11651         symbol_c *last_type_symbol = NULL;
       
 11652 
       
 11653         {
       
 11654             identifier_c param_name("IN");
       
 11655             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11656             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11657             
       
 11658             /* Get the value from a foo(<param_value>) style call */
       
 11659             if (IN_param_value == NULL)
       
 11660               IN_param_value = function_call_param_iterator.next();
       
 11661             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11662             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11663             
       
 11664             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
 11665             {
       
 11666         
       
 11667                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
 11668                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11669                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 11670                 function_type_prefix = return_type_symbol;
       
 11671                 break;
       
 11672                 
       
 11673             }
       
 11674             
       
 11675             
       
 11676             ERROR;
       
 11677         }
       
 11678         
       
 11679     }/*function_bool_to_time*/
       
 11680     break;
       
 11681 
       
 11682 /****
    69  *BOOL_TO_INT
 11683  *BOOL_TO_INT
    70  */
 11684  */
    71     case function_bool_to_int :
 11685     case function_bool_to_int :
    72     {
 11686     {
    73         symbol_c *last_type_symbol = NULL;
 11687         symbol_c *last_type_symbol = NULL;
    84             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 11698             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
    85             
 11699             
    86             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
 11700             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
    87             {
 11701             {
    88         
 11702         
       
 11703                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
    89                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
 11704                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
    90                 s4o.print("(");
 11705                 function_type_prefix = return_type_symbol;
    91                 return_type_symbol->accept(*this);
 11706                 break;
    92                 s4o.print(")");
 11707                 
    93                 IN_param_value->accept(*this);
 11708             }
    94                 return NULL;
 11709             
    95                 
       
    96             }
       
    97             
 11710             
    98             ERROR;
 11711             ERROR;
    99         }
 11712         }
   100         
 11713         
   101     }/*function_bool_to_int*/
 11714     }/*function_bool_to_int*/
   102     break;
 11715     break;
   103 
 11716 
   104 /****
 11717 /****
   105  *BOOL_TO_DINT
 11718  *TIME_TO_REAL
   106  */
 11719  */
   107     case function_bool_to_dint :
 11720     case function_time_to_real :
   108     {
 11721     {
   109         symbol_c *last_type_symbol = NULL;
 11722         symbol_c *last_type_symbol = NULL;
   110 
 11723 
   111         {
 11724         {
   112             identifier_c param_name("IN");
 11725             identifier_c param_name("IN");
   113             /* Get the value from a foo(<param_name> = <param_value>) style call */
 11726             /* Get the value from a foo(<param_name> = <param_value>) style call */
   114             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 11727             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   115             
 11728             
   116             /* Get the value from a foo(<param_value>) style call */
 11729             /* Get the value from a foo(<param_value>) style call */
   117             if (IN_param_value == NULL)
 11730             if (IN_param_value == NULL)
   118               IN_param_value = function_call_param_iterator.next();
 11731               IN_param_value = function_call_param_iterator.next();
   119             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 11732             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   120             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 11733             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   121             
 11734             
   122             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
 11735             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
   123             {
 11736             {
   124         
 11737         
       
 11738                 function_name = (symbol_c*)(new pragma_c("__time_to_real"));
       
 11739                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11740                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 11741                 function_type_prefix = return_type_symbol;
       
 11742                 break;
       
 11743                 
       
 11744             }
       
 11745             
       
 11746             
       
 11747             ERROR;
       
 11748         }
       
 11749         
       
 11750     }/*function_time_to_real*/
       
 11751     break;
       
 11752 
       
 11753 /****
       
 11754  *TIME_TO_SINT
       
 11755  */
       
 11756     case function_time_to_sint :
       
 11757     {
       
 11758         symbol_c *last_type_symbol = NULL;
       
 11759 
       
 11760         {
       
 11761             identifier_c param_name("IN");
       
 11762             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11763             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11764             
       
 11765             /* Get the value from a foo(<param_value>) style call */
       
 11766             if (IN_param_value == NULL)
       
 11767               IN_param_value = function_call_param_iterator.next();
       
 11768             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11769             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11770             
       
 11771             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 11772             {
       
 11773         
       
 11774                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
 11775                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11776                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 11777                 function_type_prefix = return_type_symbol;
       
 11778                 break;
       
 11779                 
       
 11780             }
       
 11781             
       
 11782             
       
 11783             ERROR;
       
 11784         }
       
 11785         
       
 11786     }/*function_time_to_sint*/
       
 11787     break;
       
 11788 
       
 11789 /****
       
 11790  *TIME_TO_LINT
       
 11791  */
       
 11792     case function_time_to_lint :
       
 11793     {
       
 11794         symbol_c *last_type_symbol = NULL;
       
 11795 
       
 11796         {
       
 11797             identifier_c param_name("IN");
       
 11798             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11799             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11800             
       
 11801             /* Get the value from a foo(<param_value>) style call */
       
 11802             if (IN_param_value == NULL)
       
 11803               IN_param_value = function_call_param_iterator.next();
       
 11804             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11805             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11806             
       
 11807             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 11808             {
       
 11809         
       
 11810                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
 11811                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11812                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 11813                 function_type_prefix = return_type_symbol;
       
 11814                 break;
       
 11815                 
       
 11816             }
       
 11817             
       
 11818             
       
 11819             ERROR;
       
 11820         }
       
 11821         
       
 11822     }/*function_time_to_lint*/
       
 11823     break;
       
 11824 
       
 11825 /****
       
 11826  *TIME_TO_DINT
       
 11827  */
       
 11828     case function_time_to_dint :
       
 11829     {
       
 11830         symbol_c *last_type_symbol = NULL;
       
 11831 
       
 11832         {
       
 11833             identifier_c param_name("IN");
       
 11834             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11835             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11836             
       
 11837             /* Get the value from a foo(<param_value>) style call */
       
 11838             if (IN_param_value == NULL)
       
 11839               IN_param_value = function_call_param_iterator.next();
       
 11840             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11841             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11842             
       
 11843             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 11844             {
       
 11845         
       
 11846                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
 11847                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
   125                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
 11848                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
   126                 s4o.print("(");
 11849                 function_type_prefix = return_type_symbol;
   127                 return_type_symbol->accept(*this);
 11850                 break;
   128                 s4o.print(")");
 11851                 
   129                 IN_param_value->accept(*this);
 11852             }
   130                 return NULL;
 11853             
   131                 
 11854             
   132             }
 11855             ERROR;
   133             
 11856         }
   134             ERROR;
 11857         
   135         }
 11858     }/*function_time_to_dint*/
   136         
 11859     break;
   137     }/*function_bool_to_dint*/
 11860 
   138     break;
 11861 /****
   139 
 11862  *TIME_TO_DWORD
   140 /****
 11863  */
   141  *BOOL_TO_LINT
 11864     case function_time_to_dword :
   142  */
 11865     {
   143     case function_bool_to_lint :
 11866         symbol_c *last_type_symbol = NULL;
   144     {
 11867 
   145         symbol_c *last_type_symbol = NULL;
 11868         {
   146 
 11869             identifier_c param_name("IN");
   147         {
 11870             /* Get the value from a foo(<param_name> = <param_value>) style call */
   148             identifier_c param_name("IN");
 11871             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   149             /* Get the value from a foo(<param_name> = <param_value>) style call */
 11872             
   150             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 11873             /* Get the value from a foo(<param_value>) style call */
   151             
 11874             if (IN_param_value == NULL)
   152             /* Get the value from a foo(<param_value>) style call */
 11875               IN_param_value = function_call_param_iterator.next();
   153             if (IN_param_value == NULL)
 11876             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   154               IN_param_value = function_call_param_iterator.next();
 11877             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   155             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 11878             
   156             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 11879             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
   157             
 11880             {
   158             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
 11881         
   159             {
 11882                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
   160         
 11883                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11884                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 11885                 function_type_prefix = return_type_symbol;
       
 11886                 break;
       
 11887                 
       
 11888             }
       
 11889             
       
 11890             
       
 11891             ERROR;
       
 11892         }
       
 11893         
       
 11894     }/*function_time_to_dword*/
       
 11895     break;
       
 11896 
       
 11897 /****
       
 11898  *TIME_TO_UDINT
       
 11899  */
       
 11900     case function_time_to_udint :
       
 11901     {
       
 11902         symbol_c *last_type_symbol = NULL;
       
 11903 
       
 11904         {
       
 11905             identifier_c param_name("IN");
       
 11906             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11907             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11908             
       
 11909             /* Get the value from a foo(<param_value>) style call */
       
 11910             if (IN_param_value == NULL)
       
 11911               IN_param_value = function_call_param_iterator.next();
       
 11912             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11913             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11914             
       
 11915             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 11916             {
       
 11917         
       
 11918                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
 11919                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11920                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 11921                 function_type_prefix = return_type_symbol;
       
 11922                 break;
       
 11923                 
       
 11924             }
       
 11925             
       
 11926             
       
 11927             ERROR;
       
 11928         }
       
 11929         
       
 11930     }/*function_time_to_udint*/
       
 11931     break;
       
 11932 
       
 11933 /****
       
 11934  *TIME_TO_WORD
       
 11935  */
       
 11936     case function_time_to_word :
       
 11937     {
       
 11938         symbol_c *last_type_symbol = NULL;
       
 11939 
       
 11940         {
       
 11941             identifier_c param_name("IN");
       
 11942             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11943             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11944             
       
 11945             /* Get the value from a foo(<param_value>) style call */
       
 11946             if (IN_param_value == NULL)
       
 11947               IN_param_value = function_call_param_iterator.next();
       
 11948             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11949             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11950             
       
 11951             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 11952             {
       
 11953         
       
 11954                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
 11955                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11956                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 11957                 function_type_prefix = return_type_symbol;
       
 11958                 break;
       
 11959                 
       
 11960             }
       
 11961             
       
 11962             
       
 11963             ERROR;
       
 11964         }
       
 11965         
       
 11966     }/*function_time_to_word*/
       
 11967     break;
       
 11968 
       
 11969 /****
       
 11970  *TIME_TO_STRING
       
 11971  */
       
 11972     case function_time_to_string :
       
 11973     {
       
 11974         symbol_c *last_type_symbol = NULL;
       
 11975 
       
 11976         {
       
 11977             identifier_c param_name("IN");
       
 11978             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11979             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11980             
       
 11981             /* Get the value from a foo(<param_value>) style call */
       
 11982             if (IN_param_value == NULL)
       
 11983               IN_param_value = function_call_param_iterator.next();
       
 11984             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11985             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11986             
       
 11987             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 11988             {
       
 11989         
       
 11990                 function_name = (symbol_c*)(new pragma_c("__time_to_string"));
       
 11991                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 11992                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 11993                 function_type_prefix = return_type_symbol;
       
 11994                 break;
       
 11995                 
       
 11996             }
       
 11997             
       
 11998             
       
 11999             ERROR;
       
 12000         }
       
 12001         
       
 12002     }/*function_time_to_string*/
       
 12003     break;
       
 12004 
       
 12005 /****
       
 12006  *TIME_TO_LWORD
       
 12007  */
       
 12008     case function_time_to_lword :
       
 12009     {
       
 12010         symbol_c *last_type_symbol = NULL;
       
 12011 
       
 12012         {
       
 12013             identifier_c param_name("IN");
       
 12014             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12015             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12016             
       
 12017             /* Get the value from a foo(<param_value>) style call */
       
 12018             if (IN_param_value == NULL)
       
 12019               IN_param_value = function_call_param_iterator.next();
       
 12020             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12021             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12022             
       
 12023             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 12024             {
       
 12025         
       
 12026                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
 12027                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12028                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 12029                 function_type_prefix = return_type_symbol;
       
 12030                 break;
       
 12031                 
       
 12032             }
       
 12033             
       
 12034             
       
 12035             ERROR;
       
 12036         }
       
 12037         
       
 12038     }/*function_time_to_lword*/
       
 12039     break;
       
 12040 
       
 12041 /****
       
 12042  *TIME_TO_UINT
       
 12043  */
       
 12044     case function_time_to_uint :
       
 12045     {
       
 12046         symbol_c *last_type_symbol = NULL;
       
 12047 
       
 12048         {
       
 12049             identifier_c param_name("IN");
       
 12050             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12051             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12052             
       
 12053             /* Get the value from a foo(<param_value>) style call */
       
 12054             if (IN_param_value == NULL)
       
 12055               IN_param_value = function_call_param_iterator.next();
       
 12056             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12057             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12058             
       
 12059             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 12060             {
       
 12061         
       
 12062                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
 12063                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12064                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 12065                 function_type_prefix = return_type_symbol;
       
 12066                 break;
       
 12067                 
       
 12068             }
       
 12069             
       
 12070             
       
 12071             ERROR;
       
 12072         }
       
 12073         
       
 12074     }/*function_time_to_uint*/
       
 12075     break;
       
 12076 
       
 12077 /****
       
 12078  *TIME_TO_LREAL
       
 12079  */
       
 12080     case function_time_to_lreal :
       
 12081     {
       
 12082         symbol_c *last_type_symbol = NULL;
       
 12083 
       
 12084         {
       
 12085             identifier_c param_name("IN");
       
 12086             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12087             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12088             
       
 12089             /* Get the value from a foo(<param_value>) style call */
       
 12090             if (IN_param_value == NULL)
       
 12091               IN_param_value = function_call_param_iterator.next();
       
 12092             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12093             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12094             
       
 12095             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 12096             {
       
 12097         
       
 12098                 function_name = (symbol_c*)(new pragma_c("__time_to_real"));
       
 12099                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12100                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 12101                 function_type_prefix = return_type_symbol;
       
 12102                 break;
       
 12103                 
       
 12104             }
       
 12105             
       
 12106             
       
 12107             ERROR;
       
 12108         }
       
 12109         
       
 12110     }/*function_time_to_lreal*/
       
 12111     break;
       
 12112 
       
 12113 /****
       
 12114  *TIME_TO_BYTE
       
 12115  */
       
 12116     case function_time_to_byte :
       
 12117     {
       
 12118         symbol_c *last_type_symbol = NULL;
       
 12119 
       
 12120         {
       
 12121             identifier_c param_name("IN");
       
 12122             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12123             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12124             
       
 12125             /* Get the value from a foo(<param_value>) style call */
       
 12126             if (IN_param_value == NULL)
       
 12127               IN_param_value = function_call_param_iterator.next();
       
 12128             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12129             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12130             
       
 12131             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 12132             {
       
 12133         
       
 12134                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
 12135                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12136                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 12137                 function_type_prefix = return_type_symbol;
       
 12138                 break;
       
 12139                 
       
 12140             }
       
 12141             
       
 12142             
       
 12143             ERROR;
       
 12144         }
       
 12145         
       
 12146     }/*function_time_to_byte*/
       
 12147     break;
       
 12148 
       
 12149 /****
       
 12150  *TIME_TO_USINT
       
 12151  */
       
 12152     case function_time_to_usint :
       
 12153     {
       
 12154         symbol_c *last_type_symbol = NULL;
       
 12155 
       
 12156         {
       
 12157             identifier_c param_name("IN");
       
 12158             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12159             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12160             
       
 12161             /* Get the value from a foo(<param_value>) style call */
       
 12162             if (IN_param_value == NULL)
       
 12163               IN_param_value = function_call_param_iterator.next();
       
 12164             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12165             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12166             
       
 12167             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 12168             {
       
 12169         
       
 12170                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
 12171                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12172                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 12173                 function_type_prefix = return_type_symbol;
       
 12174                 break;
       
 12175                 
       
 12176             }
       
 12177             
       
 12178             
       
 12179             ERROR;
       
 12180         }
       
 12181         
       
 12182     }/*function_time_to_usint*/
       
 12183     break;
       
 12184 
       
 12185 /****
       
 12186  *TIME_TO_ULINT
       
 12187  */
       
 12188     case function_time_to_ulint :
       
 12189     {
       
 12190         symbol_c *last_type_symbol = NULL;
       
 12191 
       
 12192         {
       
 12193             identifier_c param_name("IN");
       
 12194             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12195             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12196             
       
 12197             /* Get the value from a foo(<param_value>) style call */
       
 12198             if (IN_param_value == NULL)
       
 12199               IN_param_value = function_call_param_iterator.next();
       
 12200             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12201             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12202             
       
 12203             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 12204             {
       
 12205         
       
 12206                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
 12207                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12208                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 12209                 function_type_prefix = return_type_symbol;
       
 12210                 break;
       
 12211                 
       
 12212             }
       
 12213             
       
 12214             
       
 12215             ERROR;
       
 12216         }
       
 12217         
       
 12218     }/*function_time_to_ulint*/
       
 12219     break;
       
 12220 
       
 12221 /****
       
 12222  *TIME_TO_INT
       
 12223  */
       
 12224     case function_time_to_int :
       
 12225     {
       
 12226         symbol_c *last_type_symbol = NULL;
       
 12227 
       
 12228         {
       
 12229             identifier_c param_name("IN");
       
 12230             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12231             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12232             
       
 12233             /* Get the value from a foo(<param_value>) style call */
       
 12234             if (IN_param_value == NULL)
       
 12235               IN_param_value = function_call_param_iterator.next();
       
 12236             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12237             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12238             
       
 12239             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
 12240             {
       
 12241         
       
 12242                 function_name = (symbol_c*)(new pragma_c("__time_to_int"));
       
 12243                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12244                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 12245                 function_type_prefix = return_type_symbol;
       
 12246                 break;
       
 12247                 
       
 12248             }
       
 12249             
       
 12250             
       
 12251             ERROR;
       
 12252         }
       
 12253         
       
 12254     }/*function_time_to_int*/
       
 12255     break;
       
 12256 
       
 12257 /****
       
 12258  *INT_TO_REAL
       
 12259  */
       
 12260     case function_int_to_real :
       
 12261     {
       
 12262         symbol_c *last_type_symbol = NULL;
       
 12263 
       
 12264         {
       
 12265             identifier_c param_name("IN");
       
 12266             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12267             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12268             
       
 12269             /* Get the value from a foo(<param_value>) style call */
       
 12270             if (IN_param_value == NULL)
       
 12271               IN_param_value = function_call_param_iterator.next();
       
 12272             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12273             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12274             
       
 12275             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12276             {
       
 12277         
       
 12278                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12279                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 12280                 function_type_prefix = return_type_symbol;
       
 12281                 break;
       
 12282                 
       
 12283             }
       
 12284             
       
 12285             
       
 12286             ERROR;
       
 12287         }
       
 12288         
       
 12289     }/*function_int_to_real*/
       
 12290     break;
       
 12291 
       
 12292 /****
       
 12293  *INT_TO_SINT
       
 12294  */
       
 12295     case function_int_to_sint :
       
 12296     {
       
 12297         symbol_c *last_type_symbol = NULL;
       
 12298 
       
 12299         {
       
 12300             identifier_c param_name("IN");
       
 12301             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12302             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12303             
       
 12304             /* Get the value from a foo(<param_value>) style call */
       
 12305             if (IN_param_value == NULL)
       
 12306               IN_param_value = function_call_param_iterator.next();
       
 12307             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12308             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12309             
       
 12310             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12311             {
       
 12312         
       
 12313                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12314                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 12315                 function_type_prefix = return_type_symbol;
       
 12316                 break;
       
 12317                 
       
 12318             }
       
 12319             
       
 12320             
       
 12321             ERROR;
       
 12322         }
       
 12323         
       
 12324     }/*function_int_to_sint*/
       
 12325     break;
       
 12326 
       
 12327 /****
       
 12328  *INT_TO_LINT
       
 12329  */
       
 12330     case function_int_to_lint :
       
 12331     {
       
 12332         symbol_c *last_type_symbol = NULL;
       
 12333 
       
 12334         {
       
 12335             identifier_c param_name("IN");
       
 12336             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12337             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12338             
       
 12339             /* Get the value from a foo(<param_value>) style call */
       
 12340             if (IN_param_value == NULL)
       
 12341               IN_param_value = function_call_param_iterator.next();
       
 12342             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12343             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12344             
       
 12345             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12346             {
       
 12347         
       
 12348                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
   161                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
 12349                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
   162                 s4o.print("(");
 12350                 function_type_prefix = return_type_symbol;
   163                 return_type_symbol->accept(*this);
 12351                 break;
   164                 s4o.print(")");
 12352                 
   165                 IN_param_value->accept(*this);
 12353             }
   166                 return NULL;
 12354             
   167                 
 12355             
   168             }
 12356             ERROR;
   169             
 12357         }
   170             ERROR;
 12358         
   171         }
 12359     }/*function_int_to_lint*/
   172         
 12360     break;
   173     }/*function_bool_to_lint*/
 12361 
   174     break;
 12362 /****
   175 
 12363  *INT_TO_DINT
   176 /****
 12364  */
   177  *BOOL_TO_USINT
 12365     case function_int_to_dint :
   178  */
 12366     {
   179     case function_bool_to_usint :
 12367         symbol_c *last_type_symbol = NULL;
   180     {
 12368 
   181         symbol_c *last_type_symbol = NULL;
 12369         {
   182 
 12370             identifier_c param_name("IN");
   183         {
 12371             /* Get the value from a foo(<param_name> = <param_value>) style call */
   184             identifier_c param_name("IN");
 12372             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   185             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12373             
   186             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12374             /* Get the value from a foo(<param_value>) style call */
   187             
 12375             if (IN_param_value == NULL)
   188             /* Get the value from a foo(<param_value>) style call */
 12376               IN_param_value = function_call_param_iterator.next();
   189             if (IN_param_value == NULL)
 12377             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   190               IN_param_value = function_call_param_iterator.next();
 12378             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   191             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12379             
   192             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12380             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
   193             
 12381             {
   194             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
 12382         
   195             {
 12383                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
   196         
 12384                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 12385                 function_type_prefix = return_type_symbol;
       
 12386                 break;
       
 12387                 
       
 12388             }
       
 12389             
       
 12390             
       
 12391             ERROR;
       
 12392         }
       
 12393         
       
 12394     }/*function_int_to_dint*/
       
 12395     break;
       
 12396 
       
 12397 /****
       
 12398  *INT_TO_DATE
       
 12399  */
       
 12400     case function_int_to_date :
       
 12401     {
       
 12402         symbol_c *last_type_symbol = NULL;
       
 12403 
       
 12404         {
       
 12405             identifier_c param_name("IN");
       
 12406             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12407             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12408             
       
 12409             /* Get the value from a foo(<param_value>) style call */
       
 12410             if (IN_param_value == NULL)
       
 12411               IN_param_value = function_call_param_iterator.next();
       
 12412             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12413             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12414             
       
 12415             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12416             {
       
 12417         
       
 12418                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
 12419                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12420                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 12421                 function_type_prefix = return_type_symbol;
       
 12422                 break;
       
 12423                 
       
 12424             }
       
 12425             
       
 12426             
       
 12427             ERROR;
       
 12428         }
       
 12429         
       
 12430     }/*function_int_to_date*/
       
 12431     break;
       
 12432 
       
 12433 /****
       
 12434  *INT_TO_DWORD
       
 12435  */
       
 12436     case function_int_to_dword :
       
 12437     {
       
 12438         symbol_c *last_type_symbol = NULL;
       
 12439 
       
 12440         {
       
 12441             identifier_c param_name("IN");
       
 12442             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12443             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12444             
       
 12445             /* Get the value from a foo(<param_value>) style call */
       
 12446             if (IN_param_value == NULL)
       
 12447               IN_param_value = function_call_param_iterator.next();
       
 12448             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12449             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12450             
       
 12451             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12452             {
       
 12453         
       
 12454                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12455                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 12456                 function_type_prefix = return_type_symbol;
       
 12457                 break;
       
 12458                 
       
 12459             }
       
 12460             
       
 12461             
       
 12462             ERROR;
       
 12463         }
       
 12464         
       
 12465     }/*function_int_to_dword*/
       
 12466     break;
       
 12467 
       
 12468 /****
       
 12469  *INT_TO_DT
       
 12470  */
       
 12471     case function_int_to_dt :
       
 12472     {
       
 12473         symbol_c *last_type_symbol = NULL;
       
 12474 
       
 12475         {
       
 12476             identifier_c param_name("IN");
       
 12477             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12478             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12479             
       
 12480             /* Get the value from a foo(<param_value>) style call */
       
 12481             if (IN_param_value == NULL)
       
 12482               IN_param_value = function_call_param_iterator.next();
       
 12483             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12484             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12485             
       
 12486             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12487             {
       
 12488         
       
 12489                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
 12490                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12491                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 12492                 function_type_prefix = return_type_symbol;
       
 12493                 break;
       
 12494                 
       
 12495             }
       
 12496             
       
 12497             
       
 12498             ERROR;
       
 12499         }
       
 12500         
       
 12501     }/*function_int_to_dt*/
       
 12502     break;
       
 12503 
       
 12504 /****
       
 12505  *INT_TO_TOD
       
 12506  */
       
 12507     case function_int_to_tod :
       
 12508     {
       
 12509         symbol_c *last_type_symbol = NULL;
       
 12510 
       
 12511         {
       
 12512             identifier_c param_name("IN");
       
 12513             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12514             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12515             
       
 12516             /* Get the value from a foo(<param_value>) style call */
       
 12517             if (IN_param_value == NULL)
       
 12518               IN_param_value = function_call_param_iterator.next();
       
 12519             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12520             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12521             
       
 12522             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12523             {
       
 12524         
       
 12525                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
 12526                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12527                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 12528                 function_type_prefix = return_type_symbol;
       
 12529                 break;
       
 12530                 
       
 12531             }
       
 12532             
       
 12533             
       
 12534             ERROR;
       
 12535         }
       
 12536         
       
 12537     }/*function_int_to_tod*/
       
 12538     break;
       
 12539 
       
 12540 /****
       
 12541  *INT_TO_UDINT
       
 12542  */
       
 12543     case function_int_to_udint :
       
 12544     {
       
 12545         symbol_c *last_type_symbol = NULL;
       
 12546 
       
 12547         {
       
 12548             identifier_c param_name("IN");
       
 12549             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12550             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12551             
       
 12552             /* Get the value from a foo(<param_value>) style call */
       
 12553             if (IN_param_value == NULL)
       
 12554               IN_param_value = function_call_param_iterator.next();
       
 12555             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12556             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12557             
       
 12558             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12559             {
       
 12560         
       
 12561                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12562                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 12563                 function_type_prefix = return_type_symbol;
       
 12564                 break;
       
 12565                 
       
 12566             }
       
 12567             
       
 12568             
       
 12569             ERROR;
       
 12570         }
       
 12571         
       
 12572     }/*function_int_to_udint*/
       
 12573     break;
       
 12574 
       
 12575 /****
       
 12576  *INT_TO_WORD
       
 12577  */
       
 12578     case function_int_to_word :
       
 12579     {
       
 12580         symbol_c *last_type_symbol = NULL;
       
 12581 
       
 12582         {
       
 12583             identifier_c param_name("IN");
       
 12584             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12585             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12586             
       
 12587             /* Get the value from a foo(<param_value>) style call */
       
 12588             if (IN_param_value == NULL)
       
 12589               IN_param_value = function_call_param_iterator.next();
       
 12590             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12591             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12592             
       
 12593             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12594             {
       
 12595         
       
 12596                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12597                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 12598                 function_type_prefix = return_type_symbol;
       
 12599                 break;
       
 12600                 
       
 12601             }
       
 12602             
       
 12603             
       
 12604             ERROR;
       
 12605         }
       
 12606         
       
 12607     }/*function_int_to_word*/
       
 12608     break;
       
 12609 
       
 12610 /****
       
 12611  *INT_TO_STRING
       
 12612  */
       
 12613     case function_int_to_string :
       
 12614     {
       
 12615         symbol_c *last_type_symbol = NULL;
       
 12616 
       
 12617         {
       
 12618             identifier_c param_name("IN");
       
 12619             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12620             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12621             
       
 12622             /* Get the value from a foo(<param_value>) style call */
       
 12623             if (IN_param_value == NULL)
       
 12624               IN_param_value = function_call_param_iterator.next();
       
 12625             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12626             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12627             
       
 12628             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12629             {
       
 12630         
       
 12631                 function_name = (symbol_c*)(new pragma_c("__sint_to_string"));
       
 12632                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12633                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 12634                 function_type_prefix = return_type_symbol;
       
 12635                 break;
       
 12636                 
       
 12637             }
       
 12638             
       
 12639             
       
 12640             ERROR;
       
 12641         }
       
 12642         
       
 12643     }/*function_int_to_string*/
       
 12644     break;
       
 12645 
       
 12646 /****
       
 12647  *INT_TO_LWORD
       
 12648  */
       
 12649     case function_int_to_lword :
       
 12650     {
       
 12651         symbol_c *last_type_symbol = NULL;
       
 12652 
       
 12653         {
       
 12654             identifier_c param_name("IN");
       
 12655             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12656             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12657             
       
 12658             /* Get the value from a foo(<param_value>) style call */
       
 12659             if (IN_param_value == NULL)
       
 12660               IN_param_value = function_call_param_iterator.next();
       
 12661             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12662             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12663             
       
 12664             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12665             {
       
 12666         
       
 12667                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12668                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 12669                 function_type_prefix = return_type_symbol;
       
 12670                 break;
       
 12671                 
       
 12672             }
       
 12673             
       
 12674             
       
 12675             ERROR;
       
 12676         }
       
 12677         
       
 12678     }/*function_int_to_lword*/
       
 12679     break;
       
 12680 
       
 12681 /****
       
 12682  *INT_TO_UINT
       
 12683  */
       
 12684     case function_int_to_uint :
       
 12685     {
       
 12686         symbol_c *last_type_symbol = NULL;
       
 12687 
       
 12688         {
       
 12689             identifier_c param_name("IN");
       
 12690             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12691             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12692             
       
 12693             /* Get the value from a foo(<param_value>) style call */
       
 12694             if (IN_param_value == NULL)
       
 12695               IN_param_value = function_call_param_iterator.next();
       
 12696             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12697             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12698             
       
 12699             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12700             {
       
 12701         
       
 12702                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12703                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 12704                 function_type_prefix = return_type_symbol;
       
 12705                 break;
       
 12706                 
       
 12707             }
       
 12708             
       
 12709             
       
 12710             ERROR;
       
 12711         }
       
 12712         
       
 12713     }/*function_int_to_uint*/
       
 12714     break;
       
 12715 
       
 12716 /****
       
 12717  *INT_TO_LREAL
       
 12718  */
       
 12719     case function_int_to_lreal :
       
 12720     {
       
 12721         symbol_c *last_type_symbol = NULL;
       
 12722 
       
 12723         {
       
 12724             identifier_c param_name("IN");
       
 12725             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12726             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12727             
       
 12728             /* Get the value from a foo(<param_value>) style call */
       
 12729             if (IN_param_value == NULL)
       
 12730               IN_param_value = function_call_param_iterator.next();
       
 12731             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12732             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12733             
       
 12734             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12735             {
       
 12736         
       
 12737                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12738                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 12739                 function_type_prefix = return_type_symbol;
       
 12740                 break;
       
 12741                 
       
 12742             }
       
 12743             
       
 12744             
       
 12745             ERROR;
       
 12746         }
       
 12747         
       
 12748     }/*function_int_to_lreal*/
       
 12749     break;
       
 12750 
       
 12751 /****
       
 12752  *INT_TO_BYTE
       
 12753  */
       
 12754     case function_int_to_byte :
       
 12755     {
       
 12756         symbol_c *last_type_symbol = NULL;
       
 12757 
       
 12758         {
       
 12759             identifier_c param_name("IN");
       
 12760             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12761             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12762             
       
 12763             /* Get the value from a foo(<param_value>) style call */
       
 12764             if (IN_param_value == NULL)
       
 12765               IN_param_value = function_call_param_iterator.next();
       
 12766             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12767             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12768             
       
 12769             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12770             {
       
 12771         
       
 12772                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12773                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 12774                 function_type_prefix = return_type_symbol;
       
 12775                 break;
       
 12776                 
       
 12777             }
       
 12778             
       
 12779             
       
 12780             ERROR;
       
 12781         }
       
 12782         
       
 12783     }/*function_int_to_byte*/
       
 12784     break;
       
 12785 
       
 12786 /****
       
 12787  *INT_TO_USINT
       
 12788  */
       
 12789     case function_int_to_usint :
       
 12790     {
       
 12791         symbol_c *last_type_symbol = NULL;
       
 12792 
       
 12793         {
       
 12794             identifier_c param_name("IN");
       
 12795             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12796             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12797             
       
 12798             /* Get the value from a foo(<param_value>) style call */
       
 12799             if (IN_param_value == NULL)
       
 12800               IN_param_value = function_call_param_iterator.next();
       
 12801             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12802             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12803             
       
 12804             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12805             {
       
 12806         
       
 12807                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
   197                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
 12808                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
   198                 s4o.print("(");
 12809                 function_type_prefix = return_type_symbol;
   199                 return_type_symbol->accept(*this);
 12810                 break;
   200                 s4o.print(")");
 12811                 
   201                 IN_param_value->accept(*this);
 12812             }
   202                 return NULL;
 12813             
   203                 
 12814             
   204             }
 12815             ERROR;
   205             
 12816         }
   206             ERROR;
 12817         
   207         }
 12818     }/*function_int_to_usint*/
   208         
 12819     break;
   209     }/*function_bool_to_usint*/
 12820 
   210     break;
 12821 /****
   211 
 12822  *INT_TO_ULINT
   212 /****
 12823  */
   213  *BOOL_TO_UINT
 12824     case function_int_to_ulint :
   214  */
 12825     {
   215     case function_bool_to_uint :
 12826         symbol_c *last_type_symbol = NULL;
   216     {
 12827 
   217         symbol_c *last_type_symbol = NULL;
 12828         {
   218 
 12829             identifier_c param_name("IN");
   219         {
 12830             /* Get the value from a foo(<param_name> = <param_value>) style call */
   220             identifier_c param_name("IN");
 12831             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   221             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12832             
   222             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12833             /* Get the value from a foo(<param_value>) style call */
   223             
 12834             if (IN_param_value == NULL)
   224             /* Get the value from a foo(<param_value>) style call */
 12835               IN_param_value = function_call_param_iterator.next();
   225             if (IN_param_value == NULL)
 12836             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   226               IN_param_value = function_call_param_iterator.next();
 12837             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   227             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12838             
   228             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12839             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
   229             
 12840             {
   230             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
 12841         
   231             {
 12842                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
   232         
 12843                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 12844                 function_type_prefix = return_type_symbol;
       
 12845                 break;
       
 12846                 
       
 12847             }
       
 12848             
       
 12849             
       
 12850             ERROR;
       
 12851         }
       
 12852         
       
 12853     }/*function_int_to_ulint*/
       
 12854     break;
       
 12855 
       
 12856 /****
       
 12857  *INT_TO_BOOL
       
 12858  */
       
 12859     case function_int_to_bool :
       
 12860     {
       
 12861         symbol_c *last_type_symbol = NULL;
       
 12862 
       
 12863         {
       
 12864             identifier_c param_name("IN");
       
 12865             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12866             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12867             
       
 12868             /* Get the value from a foo(<param_value>) style call */
       
 12869             if (IN_param_value == NULL)
       
 12870               IN_param_value = function_call_param_iterator.next();
       
 12871             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12872             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12873             
       
 12874             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12875             {
       
 12876         
       
 12877                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12878                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 12879                 function_type_prefix = return_type_symbol;
       
 12880                 break;
       
 12881                 
       
 12882             }
       
 12883             
       
 12884             
       
 12885             ERROR;
       
 12886         }
       
 12887         
       
 12888     }/*function_int_to_bool*/
       
 12889     break;
       
 12890 
       
 12891 /****
       
 12892  *INT_TO_TIME
       
 12893  */
       
 12894     case function_int_to_time :
       
 12895     {
       
 12896         symbol_c *last_type_symbol = NULL;
       
 12897 
       
 12898         {
       
 12899             identifier_c param_name("IN");
       
 12900             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12901             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12902             
       
 12903             /* Get the value from a foo(<param_value>) style call */
       
 12904             if (IN_param_value == NULL)
       
 12905               IN_param_value = function_call_param_iterator.next();
       
 12906             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12907             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12908             
       
 12909             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
 12910             {
       
 12911         
       
 12912                 function_name = (symbol_c*)(new pragma_c("__int_to_time"));
       
 12913                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12914                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 12915                 function_type_prefix = return_type_symbol;
       
 12916                 break;
       
 12917                 
       
 12918             }
       
 12919             
       
 12920             
       
 12921             ERROR;
       
 12922         }
       
 12923         
       
 12924     }/*function_int_to_time*/
       
 12925     break;
       
 12926 
       
 12927 /****
       
 12928  *TRUNC
       
 12929  */
       
 12930     case function_trunc :
       
 12931     {
       
 12932         symbol_c *last_type_symbol = NULL;
       
 12933 
       
 12934         {
       
 12935             identifier_c param_name("IN");
       
 12936             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12937             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12938             
       
 12939             /* Get the value from a foo(<param_value>) style call */
       
 12940             if (IN_param_value == NULL)
       
 12941               IN_param_value = function_call_param_iterator.next();
       
 12942             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12943             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12944             
       
 12945             if(search_expression_type->is_real_type(IN_type_symbol))
       
 12946             {
       
 12947         
       
 12948                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12949                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
       
 12950                 function_type_prefix = (symbol_c*)(new pragma_c("int"));
       
 12951                 break;
       
 12952                 
       
 12953             }
       
 12954             
       
 12955             
       
 12956             ERROR;
       
 12957         }
       
 12958         
       
 12959     }/*function_trunc*/
       
 12960     break;
       
 12961 
       
 12962 /****
       
 12963  *BCD_TO_UDINT
       
 12964  */
       
 12965     case function_bcd_to_udint :
       
 12966     {
       
 12967         symbol_c *last_type_symbol = NULL;
       
 12968 
       
 12969         {
       
 12970             identifier_c param_name("IN");
       
 12971             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12972             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12973             
       
 12974             /* Get the value from a foo(<param_value>) style call */
       
 12975             if (IN_param_value == NULL)
       
 12976               IN_param_value = function_call_param_iterator.next();
       
 12977             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12978             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12979             
       
 12980             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12981             {
       
 12982         
       
 12983                 function_name = (symbol_c*)(new pragma_c("__bcd_to_uint"));
       
 12984                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 12985                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 12986                 function_type_prefix = return_type_symbol;
       
 12987                 break;
       
 12988                 
       
 12989             }
       
 12990             
       
 12991             
       
 12992             ERROR;
       
 12993         }
       
 12994         
       
 12995     }/*function_bcd_to_udint*/
       
 12996     break;
       
 12997 
       
 12998 /****
       
 12999  *BCD_TO_UINT
       
 13000  */
       
 13001     case function_bcd_to_uint :
       
 13002     {
       
 13003         symbol_c *last_type_symbol = NULL;
       
 13004 
       
 13005         {
       
 13006             identifier_c param_name("IN");
       
 13007             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13008             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13009             
       
 13010             /* Get the value from a foo(<param_value>) style call */
       
 13011             if (IN_param_value == NULL)
       
 13012               IN_param_value = function_call_param_iterator.next();
       
 13013             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13014             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13015             
       
 13016             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 13017             {
       
 13018         
       
 13019                 function_name = (symbol_c*)(new pragma_c("__bcd_to_uint"));
       
 13020                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
   233                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
 13021                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
   234                 s4o.print("(");
 13022                 function_type_prefix = return_type_symbol;
   235                 return_type_symbol->accept(*this);
 13023                 break;
   236                 s4o.print(")");
 13024                 
   237                 IN_param_value->accept(*this);
 13025             }
   238                 return NULL;
 13026             
   239                 
 13027             
   240             }
 13028             ERROR;
   241             
 13029         }
   242             ERROR;
 13030         
   243         }
 13031     }/*function_bcd_to_uint*/
   244         
 13032     break;
   245     }/*function_bool_to_uint*/
 13033 
   246     break;
 13034 /****
   247 
 13035  *BCD_TO_ULINT
   248 /****
 13036  */
   249  *BOOL_TO_UDINT
 13037     case function_bcd_to_ulint :
   250  */
 13038     {
   251     case function_bool_to_udint :
 13039         symbol_c *last_type_symbol = NULL;
   252     {
 13040 
   253         symbol_c *last_type_symbol = NULL;
 13041         {
   254 
 13042             identifier_c param_name("IN");
   255         {
 13043             /* Get the value from a foo(<param_name> = <param_value>) style call */
   256             identifier_c param_name("IN");
 13044             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   257             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13045             
   258             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13046             /* Get the value from a foo(<param_value>) style call */
   259             
 13047             if (IN_param_value == NULL)
   260             /* Get the value from a foo(<param_value>) style call */
 13048               IN_param_value = function_call_param_iterator.next();
   261             if (IN_param_value == NULL)
 13049             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   262               IN_param_value = function_call_param_iterator.next();
 13050             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   263             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13051             
   264             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13052             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
   265             
 13053             {
   266             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
 13054         
   267             {
 13055                 function_name = (symbol_c*)(new pragma_c("__bcd_to_uint"));
   268         
 13056                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
   269                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
   270                 s4o.print("(");
       
   271                 return_type_symbol->accept(*this);
       
   272                 s4o.print(")");
       
   273                 IN_param_value->accept(*this);
       
   274                 return NULL;
       
   275                 
       
   276             }
       
   277             
       
   278             ERROR;
       
   279         }
       
   280         
       
   281     }/*function_bool_to_udint*/
       
   282     break;
       
   283 
       
   284 /****
       
   285  *BOOL_TO_ULINT
       
   286  */
       
   287     case function_bool_to_ulint :
       
   288     {
       
   289         symbol_c *last_type_symbol = NULL;
       
   290 
       
   291         {
       
   292             identifier_c param_name("IN");
       
   293             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   294             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   295             
       
   296             /* Get the value from a foo(<param_value>) style call */
       
   297             if (IN_param_value == NULL)
       
   298               IN_param_value = function_call_param_iterator.next();
       
   299             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   300             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   301             
       
   302             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
   303             {
       
   304         
       
   305                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
 13057                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
   306                 s4o.print("(");
 13058                 function_type_prefix = return_type_symbol;
   307                 return_type_symbol->accept(*this);
 13059                 break;
   308                 s4o.print(")");
 13060                 
   309                 IN_param_value->accept(*this);
 13061             }
   310                 return NULL;
 13062             
   311                 
 13063             
   312             }
 13064             ERROR;
   313             
 13065         }
   314             ERROR;
 13066         
   315         }
 13067     }/*function_bcd_to_ulint*/
   316         
 13068     break;
   317     }/*function_bool_to_ulint*/
 13069 
   318     break;
 13070 /****
   319 
 13071  *BCD_TO_USINT
   320 /****
 13072  */
   321  *BOOL_TO_REAL
 13073     case function_bcd_to_usint :
   322  */
 13074     {
   323     case function_bool_to_real :
 13075         symbol_c *last_type_symbol = NULL;
   324     {
 13076 
   325         symbol_c *last_type_symbol = NULL;
 13077         {
   326 
 13078             identifier_c param_name("IN");
   327         {
 13079             /* Get the value from a foo(<param_name> = <param_value>) style call */
   328             identifier_c param_name("IN");
 13080             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   329             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13081             
   330             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13082             /* Get the value from a foo(<param_value>) style call */
   331             
 13083             if (IN_param_value == NULL)
   332             /* Get the value from a foo(<param_value>) style call */
 13084               IN_param_value = function_call_param_iterator.next();
   333             if (IN_param_value == NULL)
 13085             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   334               IN_param_value = function_call_param_iterator.next();
 13086             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   335             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13087             
   336             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13088             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
   337             
 13089             {
   338             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
 13090         
   339             {
 13091                 function_name = (symbol_c*)(new pragma_c("__bcd_to_uint"));
   340         
 13092                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
   341                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
 13093                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
   342                 s4o.print("(");
 13094                 function_type_prefix = return_type_symbol;
   343                 return_type_symbol->accept(*this);
 13095                 break;
   344                 s4o.print(")");
 13096                 
   345                 IN_param_value->accept(*this);
 13097             }
   346                 return NULL;
 13098             
   347                 
 13099             
   348             }
 13100             ERROR;
   349             
 13101         }
   350             ERROR;
 13102         
   351         }
 13103     }/*function_bcd_to_usint*/
   352         
 13104     break;
   353     }/*function_bool_to_real*/
 13105 
   354     break;
 13106 /****
   355 
 13107  *UDINT_TO_BCD
   356 /****
 13108  */
   357  *BOOL_TO_LREAL
 13109     case function_udint_to_bcd :
   358  */
 13110     {
   359     case function_bool_to_lreal :
 13111         symbol_c *last_type_symbol = NULL;
   360     {
 13112 
   361         symbol_c *last_type_symbol = NULL;
 13113         {
   362 
 13114             identifier_c param_name("IN");
   363         {
 13115             /* Get the value from a foo(<param_name> = <param_value>) style call */
   364             identifier_c param_name("IN");
 13116             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   365             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13117             
   366             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13118             /* Get the value from a foo(<param_value>) style call */
   367             
 13119             if (IN_param_value == NULL)
   368             /* Get the value from a foo(<param_value>) style call */
 13120               IN_param_value = function_call_param_iterator.next();
   369             if (IN_param_value == NULL)
 13121             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   370               IN_param_value = function_call_param_iterator.next();
 13122             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   371             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13123             
   372             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13124             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
   373             
 13125             {
   374             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
 13126         
   375             {
 13127                 function_name = (symbol_c*)(new pragma_c("__uint_to_bcd"));
   376         
 13128                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
   377                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
 13129                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
   378                 s4o.print("(");
 13130                 function_type_prefix = return_type_symbol;
   379                 return_type_symbol->accept(*this);
 13131                 break;
   380                 s4o.print(")");
 13132                 
   381                 IN_param_value->accept(*this);
 13133             }
   382                 return NULL;
 13134             
   383                 
 13135             
   384             }
 13136             ERROR;
   385             
 13137         }
   386             ERROR;
 13138         
   387         }
 13139     }/*function_udint_to_bcd*/
   388         
 13140     break;
   389     }/*function_bool_to_lreal*/
 13141 
   390     break;
 13142 /****
   391 
 13143  *UINT_TO_BCD
   392 /****
 13144  */
   393  *BOOL_TO_TIME
 13145     case function_uint_to_bcd :
   394  */
 13146     {
   395     case function_bool_to_time :
 13147         symbol_c *last_type_symbol = NULL;
   396     {
 13148 
   397         symbol_c *last_type_symbol = NULL;
 13149         {
   398 
 13150             identifier_c param_name("IN");
   399         {
 13151             /* Get the value from a foo(<param_name> = <param_value>) style call */
   400             identifier_c param_name("IN");
 13152             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   401             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13153             
   402             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13154             /* Get the value from a foo(<param_value>) style call */
   403             
 13155             if (IN_param_value == NULL)
   404             /* Get the value from a foo(<param_value>) style call */
 13156               IN_param_value = function_call_param_iterator.next();
   405             if (IN_param_value == NULL)
 13157             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   406               IN_param_value = function_call_param_iterator.next();
 13158             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   407             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13159             
   408             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13160             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
   409             
 13161             {
   410             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
 13162         
   411             {
 13163                 function_name = (symbol_c*)(new pragma_c("__uint_to_bcd"));
   412         
 13164                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
   413                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 13165                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
   414                 s4o.print("(");
 13166                 function_type_prefix = return_type_symbol;
   415                 return_type_symbol->accept(*this);
 13167                 break;
   416                 s4o.print(")__int_to_time(");
 13168                 
   417                 IN_param_value->accept(*this);
 13169             }
   418                 s4o.print(")");
 13170             
   419                 return NULL;
 13171             
   420                 
 13172             ERROR;
   421             }
 13173         }
   422             
 13174         
   423             ERROR;
 13175     }/*function_uint_to_bcd*/
   424         }
 13176     break;
   425         
 13177 
   426     }/*function_bool_to_time*/
 13178 /****
   427     break;
 13179  *USINT_TO_BCD
   428 
 13180  */
   429 /****
 13181     case function_usint_to_bcd :
   430  *BOOL_TO_DATE
 13182     {
   431  */
 13183         symbol_c *last_type_symbol = NULL;
   432     case function_bool_to_date :
 13184 
   433     {
 13185         {
   434         symbol_c *last_type_symbol = NULL;
 13186             identifier_c param_name("IN");
   435 
 13187             /* Get the value from a foo(<param_name> = <param_value>) style call */
   436         {
 13188             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   437             identifier_c param_name("IN");
 13189             
   438             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13190             /* Get the value from a foo(<param_value>) style call */
   439             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13191             if (IN_param_value == NULL)
   440             
 13192               IN_param_value = function_call_param_iterator.next();
   441             /* Get the value from a foo(<param_value>) style call */
 13193             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   442             if (IN_param_value == NULL)
 13194             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   443               IN_param_value = function_call_param_iterator.next();
 13195             
   444             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13196             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
   445             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13197             {
   446             
 13198         
   447             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
 13199                 function_name = (symbol_c*)(new pragma_c("__uint_to_bcd"));
   448             {
 13200                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
   449         
 13201                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
       
 13202                 function_type_prefix = return_type_symbol;
       
 13203                 break;
       
 13204                 
       
 13205             }
       
 13206             
       
 13207             
       
 13208             ERROR;
       
 13209         }
       
 13210         
       
 13211     }/*function_usint_to_bcd*/
       
 13212     break;
       
 13213 
       
 13214 /****
       
 13215  *ULINT_TO_BCD
       
 13216  */
       
 13217     case function_ulint_to_bcd :
       
 13218     {
       
 13219         symbol_c *last_type_symbol = NULL;
       
 13220 
       
 13221         {
       
 13222             identifier_c param_name("IN");
       
 13223             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13224             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13225             
       
 13226             /* Get the value from a foo(<param_value>) style call */
       
 13227             if (IN_param_value == NULL)
       
 13228               IN_param_value = function_call_param_iterator.next();
       
 13229             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13230             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13231             
       
 13232             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 13233             {
       
 13234         
       
 13235                 function_name = (symbol_c*)(new pragma_c("__uint_to_bcd"));
       
 13236                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 13237                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
       
 13238                 function_type_prefix = return_type_symbol;
       
 13239                 break;
       
 13240                 
       
 13241             }
       
 13242             
       
 13243             
       
 13244             ERROR;
       
 13245         }
       
 13246         
       
 13247     }/*function_ulint_to_bcd*/
       
 13248     break;
       
 13249 
       
 13250 /****
       
 13251  *DATE_AND_TIME_TO_TIME_OF_DAY
       
 13252  */
       
 13253     case function_date_and_time_to_time_of_day :
       
 13254     {
       
 13255         symbol_c *last_type_symbol = NULL;
       
 13256 
       
 13257         {
       
 13258             identifier_c param_name("IN");
       
 13259             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13260             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13261             
       
 13262             /* Get the value from a foo(<param_value>) style call */
       
 13263             if (IN_param_value == NULL)
       
 13264               IN_param_value = function_call_param_iterator.next();
       
 13265             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13266             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13267             
       
 13268             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
 13269             {
       
 13270         
       
 13271                 function_name = (symbol_c*)(new pragma_c("__date_and_time_to_time_of_day"));
       
 13272                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 13273                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 13274                 break;
       
 13275                 
       
 13276             }
       
 13277             
       
 13278             
       
 13279             ERROR;
       
 13280         }
       
 13281         
       
 13282     }/*function_date_and_time_to_time_of_day*/
       
 13283     break;
       
 13284 
       
 13285 /****
       
 13286  *DATE_AND_TIME_TO_DATE
       
 13287  */
       
 13288     case function_date_and_time_to_date :
       
 13289     {
       
 13290         symbol_c *last_type_symbol = NULL;
       
 13291 
       
 13292         {
       
 13293             identifier_c param_name("IN");
       
 13294             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13295             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13296             
       
 13297             /* Get the value from a foo(<param_value>) style call */
       
 13298             if (IN_param_value == NULL)
       
 13299               IN_param_value = function_call_param_iterator.next();
       
 13300             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13301             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13302             
       
 13303             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
 13304             {
       
 13305         
       
 13306                 function_name = (symbol_c*)(new pragma_c("__date_and_time_to_date"));
       
 13307                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
   450                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
 13308                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
   451                 s4o.print("(");
 13309                 break;
   452                 return_type_symbol->accept(*this);
 13310                 
   453                 s4o.print(")__int_to_time(");
 13311             }
   454                 IN_param_value->accept(*this);
 13312             
   455                 s4o.print(")");
 13313             
   456                 return NULL;
 13314             ERROR;
   457                 
 13315         }
   458             }
 13316         
   459             
 13317     }/*function_date_and_time_to_date*/
   460             ERROR;
 13318     break;
   461         }
 13319 
   462         
 13320 /****
   463     }/*function_bool_to_date*/
 13321  *ABS
   464     break;
 13322  */
   465 
 13323     case function_abs :
   466 /****
 13324     {
   467  *BOOL_TO_TOD
 13325         symbol_c *last_type_symbol = NULL;
   468  */
 13326 
   469     case function_bool_to_tod :
 13327         {
   470     {
 13328             identifier_c param_name("IN");
   471         symbol_c *last_type_symbol = NULL;
 13329             /* Get the value from a foo(<param_name> = <param_value>) style call */
   472 
 13330             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   473         {
 13331             
   474             identifier_c param_name("IN");
 13332             /* Get the value from a foo(<param_value>) style call */
   475             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13333             if (IN_param_value == NULL)
   476             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13334               IN_param_value = function_call_param_iterator.next();
   477             
 13335             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   478             /* Get the value from a foo(<param_value>) style call */
 13336             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   479             if (IN_param_value == NULL)
 13337             
   480               IN_param_value = function_call_param_iterator.next();
 13338             if(search_expression_type->is_num_type(IN_type_symbol))
   481             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13339             {
   482             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13340         
   483             
 13341                 function_name = (symbol_c*)(new pragma_c("__abs_"));
   484             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
 13342                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
   485             {
 13343                 symbol_c * return_type_symbol = IN_type_symbol;
   486         
 13344                 function_type_suffix = IN_type_symbol;
   487                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
 13345                 break;
   488                 s4o.print("(");
 13346                 
   489                 return_type_symbol->accept(*this);
 13347             }
   490                 s4o.print(")__int_to_time(");
 13348             
   491                 IN_param_value->accept(*this);
 13349             
   492                 s4o.print(")");
 13350             ERROR;
   493                 return NULL;
 13351         }
   494                 
 13352         
   495             }
 13353     }/*function_abs*/
   496             
 13354     break;
   497             ERROR;
 13355 
   498         }
 13356 /****
   499         
 13357  *SQRT
   500     }/*function_bool_to_tod*/
 13358  */
   501     break;
 13359     case function_sqrt :
   502 
       
   503 /****
       
   504  *BOOL_TO_DT
       
   505  */
       
   506     case function_bool_to_dt :
       
   507     {
       
   508         symbol_c *last_type_symbol = NULL;
       
   509 
       
   510         {
       
   511             identifier_c param_name("IN");
       
   512             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   513             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   514             
       
   515             /* Get the value from a foo(<param_value>) style call */
       
   516             if (IN_param_value == NULL)
       
   517               IN_param_value = function_call_param_iterator.next();
       
   518             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   519             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   520             
       
   521             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
   522             {
       
   523         
       
   524                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
   525                 s4o.print("(");
       
   526                 return_type_symbol->accept(*this);
       
   527                 s4o.print(")__int_to_time(");
       
   528                 IN_param_value->accept(*this);
       
   529                 s4o.print(")");
       
   530                 return NULL;
       
   531                 
       
   532             }
       
   533             
       
   534             ERROR;
       
   535         }
       
   536         
       
   537     }/*function_bool_to_dt*/
       
   538     break;
       
   539 
       
   540 /****
       
   541  *BOOL_TO_STRING
       
   542  */
       
   543     case function_bool_to_string :
       
   544     {
       
   545         symbol_c *last_type_symbol = NULL;
       
   546 
       
   547         {
       
   548             identifier_c param_name("IN");
       
   549             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   550             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   551             
       
   552             /* Get the value from a foo(<param_value>) style call */
       
   553             if (IN_param_value == NULL)
       
   554               IN_param_value = function_call_param_iterator.next();
       
   555             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   556             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   557             
       
   558             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
   559             {
       
   560         
       
   561                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
   562                 s4o.print("(");
       
   563                 return_type_symbol->accept(*this);
       
   564                 s4o.print(")__bool_to_string(");
       
   565                 IN_param_value->accept(*this);
       
   566                 s4o.print(")");
       
   567                 return NULL;
       
   568                 
       
   569             }
       
   570             
       
   571             ERROR;
       
   572         }
       
   573         
       
   574     }/*function_bool_to_string*/
       
   575     break;
       
   576 
       
   577 /****
       
   578  *BOOL_TO_BYTE
       
   579  */
       
   580     case function_bool_to_byte :
       
   581     {
       
   582         symbol_c *last_type_symbol = NULL;
       
   583 
       
   584         {
       
   585             identifier_c param_name("IN");
       
   586             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   587             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   588             
       
   589             /* Get the value from a foo(<param_value>) style call */
       
   590             if (IN_param_value == NULL)
       
   591               IN_param_value = function_call_param_iterator.next();
       
   592             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   593             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   594             
       
   595             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
   596             {
       
   597         
       
   598                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
   599                 s4o.print("(");
       
   600                 return_type_symbol->accept(*this);
       
   601                 s4o.print(")");
       
   602                 IN_param_value->accept(*this);
       
   603                 return NULL;
       
   604                 
       
   605             }
       
   606             
       
   607             ERROR;
       
   608         }
       
   609         
       
   610     }/*function_bool_to_byte*/
       
   611     break;
       
   612 
       
   613 /****
       
   614  *BOOL_TO_WORD
       
   615  */
       
   616     case function_bool_to_word :
       
   617     {
       
   618         symbol_c *last_type_symbol = NULL;
       
   619 
       
   620         {
       
   621             identifier_c param_name("IN");
       
   622             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   623             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   624             
       
   625             /* Get the value from a foo(<param_value>) style call */
       
   626             if (IN_param_value == NULL)
       
   627               IN_param_value = function_call_param_iterator.next();
       
   628             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   629             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   630             
       
   631             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
   632             {
       
   633         
       
   634                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
   635                 s4o.print("(");
       
   636                 return_type_symbol->accept(*this);
       
   637                 s4o.print(")");
       
   638                 IN_param_value->accept(*this);
       
   639                 return NULL;
       
   640                 
       
   641             }
       
   642             
       
   643             ERROR;
       
   644         }
       
   645         
       
   646     }/*function_bool_to_word*/
       
   647     break;
       
   648 
       
   649 /****
       
   650  *BOOL_TO_DWORD
       
   651  */
       
   652     case function_bool_to_dword :
       
   653     {
       
   654         symbol_c *last_type_symbol = NULL;
       
   655 
       
   656         {
       
   657             identifier_c param_name("IN");
       
   658             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   659             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   660             
       
   661             /* Get the value from a foo(<param_value>) style call */
       
   662             if (IN_param_value == NULL)
       
   663               IN_param_value = function_call_param_iterator.next();
       
   664             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   665             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   666             
       
   667             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
   668             {
       
   669         
       
   670                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
   671                 s4o.print("(");
       
   672                 return_type_symbol->accept(*this);
       
   673                 s4o.print(")");
       
   674                 IN_param_value->accept(*this);
       
   675                 return NULL;
       
   676                 
       
   677             }
       
   678             
       
   679             ERROR;
       
   680         }
       
   681         
       
   682     }/*function_bool_to_dword*/
       
   683     break;
       
   684 
       
   685 /****
       
   686  *BOOL_TO_LWORD
       
   687  */
       
   688     case function_bool_to_lword :
       
   689     {
       
   690         symbol_c *last_type_symbol = NULL;
       
   691 
       
   692         {
       
   693             identifier_c param_name("IN");
       
   694             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   695             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   696             
       
   697             /* Get the value from a foo(<param_value>) style call */
       
   698             if (IN_param_value == NULL)
       
   699               IN_param_value = function_call_param_iterator.next();
       
   700             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   701             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   702             
       
   703             if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
       
   704             {
       
   705         
       
   706                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
   707                 s4o.print("(");
       
   708                 return_type_symbol->accept(*this);
       
   709                 s4o.print(")");
       
   710                 IN_param_value->accept(*this);
       
   711                 return NULL;
       
   712                 
       
   713             }
       
   714             
       
   715             ERROR;
       
   716         }
       
   717         
       
   718     }/*function_bool_to_lword*/
       
   719     break;
       
   720 
       
   721 /****
       
   722  *SINT_TO_BOOL
       
   723  */
       
   724     case function_sint_to_bool :
       
   725     {
       
   726         symbol_c *last_type_symbol = NULL;
       
   727 
       
   728         {
       
   729             identifier_c param_name("IN");
       
   730             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   731             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   732             
       
   733             /* Get the value from a foo(<param_value>) style call */
       
   734             if (IN_param_value == NULL)
       
   735               IN_param_value = function_call_param_iterator.next();
       
   736             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   737             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   738             
       
   739             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   740             {
       
   741         
       
   742                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
   743                 s4o.print("(");
       
   744                 return_type_symbol->accept(*this);
       
   745                 s4o.print(")");
       
   746                 IN_param_value->accept(*this);
       
   747                 return NULL;
       
   748                 
       
   749             }
       
   750             
       
   751             ERROR;
       
   752         }
       
   753         
       
   754     }/*function_sint_to_bool*/
       
   755     break;
       
   756 
       
   757 /****
       
   758  *SINT_TO_INT
       
   759  */
       
   760     case function_sint_to_int :
       
   761     {
       
   762         symbol_c *last_type_symbol = NULL;
       
   763 
       
   764         {
       
   765             identifier_c param_name("IN");
       
   766             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   767             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   768             
       
   769             /* Get the value from a foo(<param_value>) style call */
       
   770             if (IN_param_value == NULL)
       
   771               IN_param_value = function_call_param_iterator.next();
       
   772             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   773             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   774             
       
   775             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   776             {
       
   777         
       
   778                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
   779                 s4o.print("(");
       
   780                 return_type_symbol->accept(*this);
       
   781                 s4o.print(")");
       
   782                 IN_param_value->accept(*this);
       
   783                 return NULL;
       
   784                 
       
   785             }
       
   786             
       
   787             ERROR;
       
   788         }
       
   789         
       
   790     }/*function_sint_to_int*/
       
   791     break;
       
   792 
       
   793 /****
       
   794  *SINT_TO_DINT
       
   795  */
       
   796     case function_sint_to_dint :
       
   797     {
       
   798         symbol_c *last_type_symbol = NULL;
       
   799 
       
   800         {
       
   801             identifier_c param_name("IN");
       
   802             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   803             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   804             
       
   805             /* Get the value from a foo(<param_value>) style call */
       
   806             if (IN_param_value == NULL)
       
   807               IN_param_value = function_call_param_iterator.next();
       
   808             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   809             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   810             
       
   811             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   812             {
       
   813         
       
   814                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
   815                 s4o.print("(");
       
   816                 return_type_symbol->accept(*this);
       
   817                 s4o.print(")");
       
   818                 IN_param_value->accept(*this);
       
   819                 return NULL;
       
   820                 
       
   821             }
       
   822             
       
   823             ERROR;
       
   824         }
       
   825         
       
   826     }/*function_sint_to_dint*/
       
   827     break;
       
   828 
       
   829 /****
       
   830  *SINT_TO_LINT
       
   831  */
       
   832     case function_sint_to_lint :
       
   833     {
       
   834         symbol_c *last_type_symbol = NULL;
       
   835 
       
   836         {
       
   837             identifier_c param_name("IN");
       
   838             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   839             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   840             
       
   841             /* Get the value from a foo(<param_value>) style call */
       
   842             if (IN_param_value == NULL)
       
   843               IN_param_value = function_call_param_iterator.next();
       
   844             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   845             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   846             
       
   847             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   848             {
       
   849         
       
   850                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
   851                 s4o.print("(");
       
   852                 return_type_symbol->accept(*this);
       
   853                 s4o.print(")");
       
   854                 IN_param_value->accept(*this);
       
   855                 return NULL;
       
   856                 
       
   857             }
       
   858             
       
   859             ERROR;
       
   860         }
       
   861         
       
   862     }/*function_sint_to_lint*/
       
   863     break;
       
   864 
       
   865 /****
       
   866  *SINT_TO_USINT
       
   867  */
       
   868     case function_sint_to_usint :
       
   869     {
       
   870         symbol_c *last_type_symbol = NULL;
       
   871 
       
   872         {
       
   873             identifier_c param_name("IN");
       
   874             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   875             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   876             
       
   877             /* Get the value from a foo(<param_value>) style call */
       
   878             if (IN_param_value == NULL)
       
   879               IN_param_value = function_call_param_iterator.next();
       
   880             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   881             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   882             
       
   883             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   884             {
       
   885         
       
   886                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
   887                 s4o.print("(");
       
   888                 return_type_symbol->accept(*this);
       
   889                 s4o.print(")");
       
   890                 IN_param_value->accept(*this);
       
   891                 return NULL;
       
   892                 
       
   893             }
       
   894             
       
   895             ERROR;
       
   896         }
       
   897         
       
   898     }/*function_sint_to_usint*/
       
   899     break;
       
   900 
       
   901 /****
       
   902  *SINT_TO_UINT
       
   903  */
       
   904     case function_sint_to_uint :
       
   905     {
       
   906         symbol_c *last_type_symbol = NULL;
       
   907 
       
   908         {
       
   909             identifier_c param_name("IN");
       
   910             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   911             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   912             
       
   913             /* Get the value from a foo(<param_value>) style call */
       
   914             if (IN_param_value == NULL)
       
   915               IN_param_value = function_call_param_iterator.next();
       
   916             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   917             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   918             
       
   919             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   920             {
       
   921         
       
   922                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
   923                 s4o.print("(");
       
   924                 return_type_symbol->accept(*this);
       
   925                 s4o.print(")");
       
   926                 IN_param_value->accept(*this);
       
   927                 return NULL;
       
   928                 
       
   929             }
       
   930             
       
   931             ERROR;
       
   932         }
       
   933         
       
   934     }/*function_sint_to_uint*/
       
   935     break;
       
   936 
       
   937 /****
       
   938  *SINT_TO_UDINT
       
   939  */
       
   940     case function_sint_to_udint :
       
   941     {
       
   942         symbol_c *last_type_symbol = NULL;
       
   943 
       
   944         {
       
   945             identifier_c param_name("IN");
       
   946             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   947             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   948             
       
   949             /* Get the value from a foo(<param_value>) style call */
       
   950             if (IN_param_value == NULL)
       
   951               IN_param_value = function_call_param_iterator.next();
       
   952             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   953             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   954             
       
   955             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   956             {
       
   957         
       
   958                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
   959                 s4o.print("(");
       
   960                 return_type_symbol->accept(*this);
       
   961                 s4o.print(")");
       
   962                 IN_param_value->accept(*this);
       
   963                 return NULL;
       
   964                 
       
   965             }
       
   966             
       
   967             ERROR;
       
   968         }
       
   969         
       
   970     }/*function_sint_to_udint*/
       
   971     break;
       
   972 
       
   973 /****
       
   974  *SINT_TO_ULINT
       
   975  */
       
   976     case function_sint_to_ulint :
       
   977     {
       
   978         symbol_c *last_type_symbol = NULL;
       
   979 
       
   980         {
       
   981             identifier_c param_name("IN");
       
   982             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   983             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   984             
       
   985             /* Get the value from a foo(<param_value>) style call */
       
   986             if (IN_param_value == NULL)
       
   987               IN_param_value = function_call_param_iterator.next();
       
   988             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   989             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   990             
       
   991             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
   992             {
       
   993         
       
   994                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
   995                 s4o.print("(");
       
   996                 return_type_symbol->accept(*this);
       
   997                 s4o.print(")");
       
   998                 IN_param_value->accept(*this);
       
   999                 return NULL;
       
  1000                 
       
  1001             }
       
  1002             
       
  1003             ERROR;
       
  1004         }
       
  1005         
       
  1006     }/*function_sint_to_ulint*/
       
  1007     break;
       
  1008 
       
  1009 /****
       
  1010  *SINT_TO_REAL
       
  1011  */
       
  1012     case function_sint_to_real :
       
  1013     {
       
  1014         symbol_c *last_type_symbol = NULL;
       
  1015 
       
  1016         {
       
  1017             identifier_c param_name("IN");
       
  1018             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1019             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1020             
       
  1021             /* Get the value from a foo(<param_value>) style call */
       
  1022             if (IN_param_value == NULL)
       
  1023               IN_param_value = function_call_param_iterator.next();
       
  1024             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1025             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1026             
       
  1027             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1028             {
       
  1029         
       
  1030                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  1031                 s4o.print("(");
       
  1032                 return_type_symbol->accept(*this);
       
  1033                 s4o.print(")");
       
  1034                 IN_param_value->accept(*this);
       
  1035                 return NULL;
       
  1036                 
       
  1037             }
       
  1038             
       
  1039             ERROR;
       
  1040         }
       
  1041         
       
  1042     }/*function_sint_to_real*/
       
  1043     break;
       
  1044 
       
  1045 /****
       
  1046  *SINT_TO_LREAL
       
  1047  */
       
  1048     case function_sint_to_lreal :
       
  1049     {
       
  1050         symbol_c *last_type_symbol = NULL;
       
  1051 
       
  1052         {
       
  1053             identifier_c param_name("IN");
       
  1054             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1055             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1056             
       
  1057             /* Get the value from a foo(<param_value>) style call */
       
  1058             if (IN_param_value == NULL)
       
  1059               IN_param_value = function_call_param_iterator.next();
       
  1060             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1061             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1062             
       
  1063             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1064             {
       
  1065         
       
  1066                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  1067                 s4o.print("(");
       
  1068                 return_type_symbol->accept(*this);
       
  1069                 s4o.print(")");
       
  1070                 IN_param_value->accept(*this);
       
  1071                 return NULL;
       
  1072                 
       
  1073             }
       
  1074             
       
  1075             ERROR;
       
  1076         }
       
  1077         
       
  1078     }/*function_sint_to_lreal*/
       
  1079     break;
       
  1080 
       
  1081 /****
       
  1082  *SINT_TO_TIME
       
  1083  */
       
  1084     case function_sint_to_time :
       
  1085     {
       
  1086         symbol_c *last_type_symbol = NULL;
       
  1087 
       
  1088         {
       
  1089             identifier_c param_name("IN");
       
  1090             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1091             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1092             
       
  1093             /* Get the value from a foo(<param_value>) style call */
       
  1094             if (IN_param_value == NULL)
       
  1095               IN_param_value = function_call_param_iterator.next();
       
  1096             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1097             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1098             
       
  1099             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1100             {
       
  1101         
       
  1102                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  1103                 s4o.print("(");
       
  1104                 return_type_symbol->accept(*this);
       
  1105                 s4o.print(")__int_to_time(");
       
  1106                 IN_param_value->accept(*this);
       
  1107                 s4o.print(")");
       
  1108                 return NULL;
       
  1109                 
       
  1110             }
       
  1111             
       
  1112             ERROR;
       
  1113         }
       
  1114         
       
  1115     }/*function_sint_to_time*/
       
  1116     break;
       
  1117 
       
  1118 /****
       
  1119  *SINT_TO_DATE
       
  1120  */
       
  1121     case function_sint_to_date :
       
  1122     {
       
  1123         symbol_c *last_type_symbol = NULL;
       
  1124 
       
  1125         {
       
  1126             identifier_c param_name("IN");
       
  1127             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1128             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1129             
       
  1130             /* Get the value from a foo(<param_value>) style call */
       
  1131             if (IN_param_value == NULL)
       
  1132               IN_param_value = function_call_param_iterator.next();
       
  1133             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1134             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1135             
       
  1136             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1137             {
       
  1138         
       
  1139                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  1140                 s4o.print("(");
       
  1141                 return_type_symbol->accept(*this);
       
  1142                 s4o.print(")__int_to_time(");
       
  1143                 IN_param_value->accept(*this);
       
  1144                 s4o.print(")");
       
  1145                 return NULL;
       
  1146                 
       
  1147             }
       
  1148             
       
  1149             ERROR;
       
  1150         }
       
  1151         
       
  1152     }/*function_sint_to_date*/
       
  1153     break;
       
  1154 
       
  1155 /****
       
  1156  *SINT_TO_TOD
       
  1157  */
       
  1158     case function_sint_to_tod :
       
  1159     {
       
  1160         symbol_c *last_type_symbol = NULL;
       
  1161 
       
  1162         {
       
  1163             identifier_c param_name("IN");
       
  1164             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1165             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1166             
       
  1167             /* Get the value from a foo(<param_value>) style call */
       
  1168             if (IN_param_value == NULL)
       
  1169               IN_param_value = function_call_param_iterator.next();
       
  1170             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1171             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1172             
       
  1173             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1174             {
       
  1175         
       
  1176                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  1177                 s4o.print("(");
       
  1178                 return_type_symbol->accept(*this);
       
  1179                 s4o.print(")__int_to_time(");
       
  1180                 IN_param_value->accept(*this);
       
  1181                 s4o.print(")");
       
  1182                 return NULL;
       
  1183                 
       
  1184             }
       
  1185             
       
  1186             ERROR;
       
  1187         }
       
  1188         
       
  1189     }/*function_sint_to_tod*/
       
  1190     break;
       
  1191 
       
  1192 /****
       
  1193  *SINT_TO_DT
       
  1194  */
       
  1195     case function_sint_to_dt :
       
  1196     {
       
  1197         symbol_c *last_type_symbol = NULL;
       
  1198 
       
  1199         {
       
  1200             identifier_c param_name("IN");
       
  1201             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1202             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1203             
       
  1204             /* Get the value from a foo(<param_value>) style call */
       
  1205             if (IN_param_value == NULL)
       
  1206               IN_param_value = function_call_param_iterator.next();
       
  1207             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1208             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1209             
       
  1210             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1211             {
       
  1212         
       
  1213                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  1214                 s4o.print("(");
       
  1215                 return_type_symbol->accept(*this);
       
  1216                 s4o.print(")__int_to_time(");
       
  1217                 IN_param_value->accept(*this);
       
  1218                 s4o.print(")");
       
  1219                 return NULL;
       
  1220                 
       
  1221             }
       
  1222             
       
  1223             ERROR;
       
  1224         }
       
  1225         
       
  1226     }/*function_sint_to_dt*/
       
  1227     break;
       
  1228 
       
  1229 /****
       
  1230  *SINT_TO_STRING
       
  1231  */
       
  1232     case function_sint_to_string :
       
  1233     {
       
  1234         symbol_c *last_type_symbol = NULL;
       
  1235 
       
  1236         {
       
  1237             identifier_c param_name("IN");
       
  1238             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1239             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1240             
       
  1241             /* Get the value from a foo(<param_value>) style call */
       
  1242             if (IN_param_value == NULL)
       
  1243               IN_param_value = function_call_param_iterator.next();
       
  1244             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1245             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1246             
       
  1247             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1248             {
       
  1249         
       
  1250                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  1251                 s4o.print("(");
       
  1252                 return_type_symbol->accept(*this);
       
  1253                 s4o.print(")__sint_to_string(");
       
  1254                 IN_param_value->accept(*this);
       
  1255                 s4o.print(")");
       
  1256                 return NULL;
       
  1257                 
       
  1258             }
       
  1259             
       
  1260             ERROR;
       
  1261         }
       
  1262         
       
  1263     }/*function_sint_to_string*/
       
  1264     break;
       
  1265 
       
  1266 /****
       
  1267  *SINT_TO_BYTE
       
  1268  */
       
  1269     case function_sint_to_byte :
       
  1270     {
       
  1271         symbol_c *last_type_symbol = NULL;
       
  1272 
       
  1273         {
       
  1274             identifier_c param_name("IN");
       
  1275             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1276             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1277             
       
  1278             /* Get the value from a foo(<param_value>) style call */
       
  1279             if (IN_param_value == NULL)
       
  1280               IN_param_value = function_call_param_iterator.next();
       
  1281             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1282             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1283             
       
  1284             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1285             {
       
  1286         
       
  1287                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  1288                 s4o.print("(");
       
  1289                 return_type_symbol->accept(*this);
       
  1290                 s4o.print(")");
       
  1291                 IN_param_value->accept(*this);
       
  1292                 return NULL;
       
  1293                 
       
  1294             }
       
  1295             
       
  1296             ERROR;
       
  1297         }
       
  1298         
       
  1299     }/*function_sint_to_byte*/
       
  1300     break;
       
  1301 
       
  1302 /****
       
  1303  *SINT_TO_WORD
       
  1304  */
       
  1305     case function_sint_to_word :
       
  1306     {
       
  1307         symbol_c *last_type_symbol = NULL;
       
  1308 
       
  1309         {
       
  1310             identifier_c param_name("IN");
       
  1311             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1312             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1313             
       
  1314             /* Get the value from a foo(<param_value>) style call */
       
  1315             if (IN_param_value == NULL)
       
  1316               IN_param_value = function_call_param_iterator.next();
       
  1317             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1318             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1319             
       
  1320             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1321             {
       
  1322         
       
  1323                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  1324                 s4o.print("(");
       
  1325                 return_type_symbol->accept(*this);
       
  1326                 s4o.print(")");
       
  1327                 IN_param_value->accept(*this);
       
  1328                 return NULL;
       
  1329                 
       
  1330             }
       
  1331             
       
  1332             ERROR;
       
  1333         }
       
  1334         
       
  1335     }/*function_sint_to_word*/
       
  1336     break;
       
  1337 
       
  1338 /****
       
  1339  *SINT_TO_DWORD
       
  1340  */
       
  1341     case function_sint_to_dword :
       
  1342     {
       
  1343         symbol_c *last_type_symbol = NULL;
       
  1344 
       
  1345         {
       
  1346             identifier_c param_name("IN");
       
  1347             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1348             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1349             
       
  1350             /* Get the value from a foo(<param_value>) style call */
       
  1351             if (IN_param_value == NULL)
       
  1352               IN_param_value = function_call_param_iterator.next();
       
  1353             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1354             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1355             
       
  1356             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1357             {
       
  1358         
       
  1359                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  1360                 s4o.print("(");
       
  1361                 return_type_symbol->accept(*this);
       
  1362                 s4o.print(")");
       
  1363                 IN_param_value->accept(*this);
       
  1364                 return NULL;
       
  1365                 
       
  1366             }
       
  1367             
       
  1368             ERROR;
       
  1369         }
       
  1370         
       
  1371     }/*function_sint_to_dword*/
       
  1372     break;
       
  1373 
       
  1374 /****
       
  1375  *SINT_TO_LWORD
       
  1376  */
       
  1377     case function_sint_to_lword :
       
  1378     {
       
  1379         symbol_c *last_type_symbol = NULL;
       
  1380 
       
  1381         {
       
  1382             identifier_c param_name("IN");
       
  1383             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1384             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1385             
       
  1386             /* Get the value from a foo(<param_value>) style call */
       
  1387             if (IN_param_value == NULL)
       
  1388               IN_param_value = function_call_param_iterator.next();
       
  1389             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1390             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1391             
       
  1392             if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
       
  1393             {
       
  1394         
       
  1395                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  1396                 s4o.print("(");
       
  1397                 return_type_symbol->accept(*this);
       
  1398                 s4o.print(")");
       
  1399                 IN_param_value->accept(*this);
       
  1400                 return NULL;
       
  1401                 
       
  1402             }
       
  1403             
       
  1404             ERROR;
       
  1405         }
       
  1406         
       
  1407     }/*function_sint_to_lword*/
       
  1408     break;
       
  1409 
       
  1410 /****
       
  1411  *INT_TO_BOOL
       
  1412  */
       
  1413     case function_int_to_bool :
       
  1414     {
       
  1415         symbol_c *last_type_symbol = NULL;
       
  1416 
       
  1417         {
       
  1418             identifier_c param_name("IN");
       
  1419             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1420             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1421             
       
  1422             /* Get the value from a foo(<param_value>) style call */
       
  1423             if (IN_param_value == NULL)
       
  1424               IN_param_value = function_call_param_iterator.next();
       
  1425             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1426             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1427             
       
  1428             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1429             {
       
  1430         
       
  1431                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  1432                 s4o.print("(");
       
  1433                 return_type_symbol->accept(*this);
       
  1434                 s4o.print(")");
       
  1435                 IN_param_value->accept(*this);
       
  1436                 return NULL;
       
  1437                 
       
  1438             }
       
  1439             
       
  1440             ERROR;
       
  1441         }
       
  1442         
       
  1443     }/*function_int_to_bool*/
       
  1444     break;
       
  1445 
       
  1446 /****
       
  1447  *INT_TO_SINT
       
  1448  */
       
  1449     case function_int_to_sint :
       
  1450     {
       
  1451         symbol_c *last_type_symbol = NULL;
       
  1452 
       
  1453         {
       
  1454             identifier_c param_name("IN");
       
  1455             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1456             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1457             
       
  1458             /* Get the value from a foo(<param_value>) style call */
       
  1459             if (IN_param_value == NULL)
       
  1460               IN_param_value = function_call_param_iterator.next();
       
  1461             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1462             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1463             
       
  1464             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1465             {
       
  1466         
       
  1467                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  1468                 s4o.print("(");
       
  1469                 return_type_symbol->accept(*this);
       
  1470                 s4o.print(")");
       
  1471                 IN_param_value->accept(*this);
       
  1472                 return NULL;
       
  1473                 
       
  1474             }
       
  1475             
       
  1476             ERROR;
       
  1477         }
       
  1478         
       
  1479     }/*function_int_to_sint*/
       
  1480     break;
       
  1481 
       
  1482 /****
       
  1483  *INT_TO_DINT
       
  1484  */
       
  1485     case function_int_to_dint :
       
  1486     {
       
  1487         symbol_c *last_type_symbol = NULL;
       
  1488 
       
  1489         {
       
  1490             identifier_c param_name("IN");
       
  1491             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1492             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1493             
       
  1494             /* Get the value from a foo(<param_value>) style call */
       
  1495             if (IN_param_value == NULL)
       
  1496               IN_param_value = function_call_param_iterator.next();
       
  1497             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1498             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1499             
       
  1500             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1501             {
       
  1502         
       
  1503                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  1504                 s4o.print("(");
       
  1505                 return_type_symbol->accept(*this);
       
  1506                 s4o.print(")");
       
  1507                 IN_param_value->accept(*this);
       
  1508                 return NULL;
       
  1509                 
       
  1510             }
       
  1511             
       
  1512             ERROR;
       
  1513         }
       
  1514         
       
  1515     }/*function_int_to_dint*/
       
  1516     break;
       
  1517 
       
  1518 /****
       
  1519  *INT_TO_LINT
       
  1520  */
       
  1521     case function_int_to_lint :
       
  1522     {
       
  1523         symbol_c *last_type_symbol = NULL;
       
  1524 
       
  1525         {
       
  1526             identifier_c param_name("IN");
       
  1527             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1528             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1529             
       
  1530             /* Get the value from a foo(<param_value>) style call */
       
  1531             if (IN_param_value == NULL)
       
  1532               IN_param_value = function_call_param_iterator.next();
       
  1533             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1534             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1535             
       
  1536             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1537             {
       
  1538         
       
  1539                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  1540                 s4o.print("(");
       
  1541                 return_type_symbol->accept(*this);
       
  1542                 s4o.print(")");
       
  1543                 IN_param_value->accept(*this);
       
  1544                 return NULL;
       
  1545                 
       
  1546             }
       
  1547             
       
  1548             ERROR;
       
  1549         }
       
  1550         
       
  1551     }/*function_int_to_lint*/
       
  1552     break;
       
  1553 
       
  1554 /****
       
  1555  *INT_TO_USINT
       
  1556  */
       
  1557     case function_int_to_usint :
       
  1558     {
       
  1559         symbol_c *last_type_symbol = NULL;
       
  1560 
       
  1561         {
       
  1562             identifier_c param_name("IN");
       
  1563             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1564             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1565             
       
  1566             /* Get the value from a foo(<param_value>) style call */
       
  1567             if (IN_param_value == NULL)
       
  1568               IN_param_value = function_call_param_iterator.next();
       
  1569             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1570             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1571             
       
  1572             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1573             {
       
  1574         
       
  1575                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  1576                 s4o.print("(");
       
  1577                 return_type_symbol->accept(*this);
       
  1578                 s4o.print(")");
       
  1579                 IN_param_value->accept(*this);
       
  1580                 return NULL;
       
  1581                 
       
  1582             }
       
  1583             
       
  1584             ERROR;
       
  1585         }
       
  1586         
       
  1587     }/*function_int_to_usint*/
       
  1588     break;
       
  1589 
       
  1590 /****
       
  1591  *INT_TO_UINT
       
  1592  */
       
  1593     case function_int_to_uint :
       
  1594     {
       
  1595         symbol_c *last_type_symbol = NULL;
       
  1596 
       
  1597         {
       
  1598             identifier_c param_name("IN");
       
  1599             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1600             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1601             
       
  1602             /* Get the value from a foo(<param_value>) style call */
       
  1603             if (IN_param_value == NULL)
       
  1604               IN_param_value = function_call_param_iterator.next();
       
  1605             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1606             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1607             
       
  1608             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1609             {
       
  1610         
       
  1611                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  1612                 s4o.print("(");
       
  1613                 return_type_symbol->accept(*this);
       
  1614                 s4o.print(")");
       
  1615                 IN_param_value->accept(*this);
       
  1616                 return NULL;
       
  1617                 
       
  1618             }
       
  1619             
       
  1620             ERROR;
       
  1621         }
       
  1622         
       
  1623     }/*function_int_to_uint*/
       
  1624     break;
       
  1625 
       
  1626 /****
       
  1627  *INT_TO_UDINT
       
  1628  */
       
  1629     case function_int_to_udint :
       
  1630     {
       
  1631         symbol_c *last_type_symbol = NULL;
       
  1632 
       
  1633         {
       
  1634             identifier_c param_name("IN");
       
  1635             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1636             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1637             
       
  1638             /* Get the value from a foo(<param_value>) style call */
       
  1639             if (IN_param_value == NULL)
       
  1640               IN_param_value = function_call_param_iterator.next();
       
  1641             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1642             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1643             
       
  1644             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1645             {
       
  1646         
       
  1647                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  1648                 s4o.print("(");
       
  1649                 return_type_symbol->accept(*this);
       
  1650                 s4o.print(")");
       
  1651                 IN_param_value->accept(*this);
       
  1652                 return NULL;
       
  1653                 
       
  1654             }
       
  1655             
       
  1656             ERROR;
       
  1657         }
       
  1658         
       
  1659     }/*function_int_to_udint*/
       
  1660     break;
       
  1661 
       
  1662 /****
       
  1663  *INT_TO_ULINT
       
  1664  */
       
  1665     case function_int_to_ulint :
       
  1666     {
       
  1667         symbol_c *last_type_symbol = NULL;
       
  1668 
       
  1669         {
       
  1670             identifier_c param_name("IN");
       
  1671             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1672             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1673             
       
  1674             /* Get the value from a foo(<param_value>) style call */
       
  1675             if (IN_param_value == NULL)
       
  1676               IN_param_value = function_call_param_iterator.next();
       
  1677             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1678             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1679             
       
  1680             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1681             {
       
  1682         
       
  1683                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  1684                 s4o.print("(");
       
  1685                 return_type_symbol->accept(*this);
       
  1686                 s4o.print(")");
       
  1687                 IN_param_value->accept(*this);
       
  1688                 return NULL;
       
  1689                 
       
  1690             }
       
  1691             
       
  1692             ERROR;
       
  1693         }
       
  1694         
       
  1695     }/*function_int_to_ulint*/
       
  1696     break;
       
  1697 
       
  1698 /****
       
  1699  *INT_TO_REAL
       
  1700  */
       
  1701     case function_int_to_real :
       
  1702     {
       
  1703         symbol_c *last_type_symbol = NULL;
       
  1704 
       
  1705         {
       
  1706             identifier_c param_name("IN");
       
  1707             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1708             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1709             
       
  1710             /* Get the value from a foo(<param_value>) style call */
       
  1711             if (IN_param_value == NULL)
       
  1712               IN_param_value = function_call_param_iterator.next();
       
  1713             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1714             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1715             
       
  1716             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1717             {
       
  1718         
       
  1719                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  1720                 s4o.print("(");
       
  1721                 return_type_symbol->accept(*this);
       
  1722                 s4o.print(")");
       
  1723                 IN_param_value->accept(*this);
       
  1724                 return NULL;
       
  1725                 
       
  1726             }
       
  1727             
       
  1728             ERROR;
       
  1729         }
       
  1730         
       
  1731     }/*function_int_to_real*/
       
  1732     break;
       
  1733 
       
  1734 /****
       
  1735  *INT_TO_LREAL
       
  1736  */
       
  1737     case function_int_to_lreal :
       
  1738     {
       
  1739         symbol_c *last_type_symbol = NULL;
       
  1740 
       
  1741         {
       
  1742             identifier_c param_name("IN");
       
  1743             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1744             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1745             
       
  1746             /* Get the value from a foo(<param_value>) style call */
       
  1747             if (IN_param_value == NULL)
       
  1748               IN_param_value = function_call_param_iterator.next();
       
  1749             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1750             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1751             
       
  1752             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1753             {
       
  1754         
       
  1755                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  1756                 s4o.print("(");
       
  1757                 return_type_symbol->accept(*this);
       
  1758                 s4o.print(")");
       
  1759                 IN_param_value->accept(*this);
       
  1760                 return NULL;
       
  1761                 
       
  1762             }
       
  1763             
       
  1764             ERROR;
       
  1765         }
       
  1766         
       
  1767     }/*function_int_to_lreal*/
       
  1768     break;
       
  1769 
       
  1770 /****
       
  1771  *INT_TO_TIME
       
  1772  */
       
  1773     case function_int_to_time :
       
  1774     {
       
  1775         symbol_c *last_type_symbol = NULL;
       
  1776 
       
  1777         {
       
  1778             identifier_c param_name("IN");
       
  1779             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1780             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1781             
       
  1782             /* Get the value from a foo(<param_value>) style call */
       
  1783             if (IN_param_value == NULL)
       
  1784               IN_param_value = function_call_param_iterator.next();
       
  1785             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1786             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1787             
       
  1788             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1789             {
       
  1790         
       
  1791                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  1792                 s4o.print("(");
       
  1793                 return_type_symbol->accept(*this);
       
  1794                 s4o.print(")__int_to_time(");
       
  1795                 IN_param_value->accept(*this);
       
  1796                 s4o.print(")");
       
  1797                 return NULL;
       
  1798                 
       
  1799             }
       
  1800             
       
  1801             ERROR;
       
  1802         }
       
  1803         
       
  1804     }/*function_int_to_time*/
       
  1805     break;
       
  1806 
       
  1807 /****
       
  1808  *INT_TO_DATE
       
  1809  */
       
  1810     case function_int_to_date :
       
  1811     {
       
  1812         symbol_c *last_type_symbol = NULL;
       
  1813 
       
  1814         {
       
  1815             identifier_c param_name("IN");
       
  1816             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1817             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1818             
       
  1819             /* Get the value from a foo(<param_value>) style call */
       
  1820             if (IN_param_value == NULL)
       
  1821               IN_param_value = function_call_param_iterator.next();
       
  1822             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1823             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1824             
       
  1825             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1826             {
       
  1827         
       
  1828                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  1829                 s4o.print("(");
       
  1830                 return_type_symbol->accept(*this);
       
  1831                 s4o.print(")__int_to_time(");
       
  1832                 IN_param_value->accept(*this);
       
  1833                 s4o.print(")");
       
  1834                 return NULL;
       
  1835                 
       
  1836             }
       
  1837             
       
  1838             ERROR;
       
  1839         }
       
  1840         
       
  1841     }/*function_int_to_date*/
       
  1842     break;
       
  1843 
       
  1844 /****
       
  1845  *INT_TO_TOD
       
  1846  */
       
  1847     case function_int_to_tod :
       
  1848     {
       
  1849         symbol_c *last_type_symbol = NULL;
       
  1850 
       
  1851         {
       
  1852             identifier_c param_name("IN");
       
  1853             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1854             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1855             
       
  1856             /* Get the value from a foo(<param_value>) style call */
       
  1857             if (IN_param_value == NULL)
       
  1858               IN_param_value = function_call_param_iterator.next();
       
  1859             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1860             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1861             
       
  1862             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1863             {
       
  1864         
       
  1865                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  1866                 s4o.print("(");
       
  1867                 return_type_symbol->accept(*this);
       
  1868                 s4o.print(")__int_to_time(");
       
  1869                 IN_param_value->accept(*this);
       
  1870                 s4o.print(")");
       
  1871                 return NULL;
       
  1872                 
       
  1873             }
       
  1874             
       
  1875             ERROR;
       
  1876         }
       
  1877         
       
  1878     }/*function_int_to_tod*/
       
  1879     break;
       
  1880 
       
  1881 /****
       
  1882  *INT_TO_DT
       
  1883  */
       
  1884     case function_int_to_dt :
       
  1885     {
       
  1886         symbol_c *last_type_symbol = NULL;
       
  1887 
       
  1888         {
       
  1889             identifier_c param_name("IN");
       
  1890             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1891             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1892             
       
  1893             /* Get the value from a foo(<param_value>) style call */
       
  1894             if (IN_param_value == NULL)
       
  1895               IN_param_value = function_call_param_iterator.next();
       
  1896             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1897             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1898             
       
  1899             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1900             {
       
  1901         
       
  1902                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  1903                 s4o.print("(");
       
  1904                 return_type_symbol->accept(*this);
       
  1905                 s4o.print(")__int_to_time(");
       
  1906                 IN_param_value->accept(*this);
       
  1907                 s4o.print(")");
       
  1908                 return NULL;
       
  1909                 
       
  1910             }
       
  1911             
       
  1912             ERROR;
       
  1913         }
       
  1914         
       
  1915     }/*function_int_to_dt*/
       
  1916     break;
       
  1917 
       
  1918 /****
       
  1919  *INT_TO_STRING
       
  1920  */
       
  1921     case function_int_to_string :
       
  1922     {
       
  1923         symbol_c *last_type_symbol = NULL;
       
  1924 
       
  1925         {
       
  1926             identifier_c param_name("IN");
       
  1927             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1928             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1929             
       
  1930             /* Get the value from a foo(<param_value>) style call */
       
  1931             if (IN_param_value == NULL)
       
  1932               IN_param_value = function_call_param_iterator.next();
       
  1933             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1934             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1935             
       
  1936             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1937             {
       
  1938         
       
  1939                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  1940                 s4o.print("(");
       
  1941                 return_type_symbol->accept(*this);
       
  1942                 s4o.print(")__sint_to_string(");
       
  1943                 IN_param_value->accept(*this);
       
  1944                 s4o.print(")");
       
  1945                 return NULL;
       
  1946                 
       
  1947             }
       
  1948             
       
  1949             ERROR;
       
  1950         }
       
  1951         
       
  1952     }/*function_int_to_string*/
       
  1953     break;
       
  1954 
       
  1955 /****
       
  1956  *INT_TO_BYTE
       
  1957  */
       
  1958     case function_int_to_byte :
       
  1959     {
       
  1960         symbol_c *last_type_symbol = NULL;
       
  1961 
       
  1962         {
       
  1963             identifier_c param_name("IN");
       
  1964             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1965             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1966             
       
  1967             /* Get the value from a foo(<param_value>) style call */
       
  1968             if (IN_param_value == NULL)
       
  1969               IN_param_value = function_call_param_iterator.next();
       
  1970             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1971             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1972             
       
  1973             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  1974             {
       
  1975         
       
  1976                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  1977                 s4o.print("(");
       
  1978                 return_type_symbol->accept(*this);
       
  1979                 s4o.print(")");
       
  1980                 IN_param_value->accept(*this);
       
  1981                 return NULL;
       
  1982                 
       
  1983             }
       
  1984             
       
  1985             ERROR;
       
  1986         }
       
  1987         
       
  1988     }/*function_int_to_byte*/
       
  1989     break;
       
  1990 
       
  1991 /****
       
  1992  *INT_TO_WORD
       
  1993  */
       
  1994     case function_int_to_word :
       
  1995     {
       
  1996         symbol_c *last_type_symbol = NULL;
       
  1997 
       
  1998         {
       
  1999             identifier_c param_name("IN");
       
  2000             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2001             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2002             
       
  2003             /* Get the value from a foo(<param_value>) style call */
       
  2004             if (IN_param_value == NULL)
       
  2005               IN_param_value = function_call_param_iterator.next();
       
  2006             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2007             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2008             
       
  2009             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  2010             {
       
  2011         
       
  2012                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  2013                 s4o.print("(");
       
  2014                 return_type_symbol->accept(*this);
       
  2015                 s4o.print(")");
       
  2016                 IN_param_value->accept(*this);
       
  2017                 return NULL;
       
  2018                 
       
  2019             }
       
  2020             
       
  2021             ERROR;
       
  2022         }
       
  2023         
       
  2024     }/*function_int_to_word*/
       
  2025     break;
       
  2026 
       
  2027 /****
       
  2028  *INT_TO_DWORD
       
  2029  */
       
  2030     case function_int_to_dword :
       
  2031     {
       
  2032         symbol_c *last_type_symbol = NULL;
       
  2033 
       
  2034         {
       
  2035             identifier_c param_name("IN");
       
  2036             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2037             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2038             
       
  2039             /* Get the value from a foo(<param_value>) style call */
       
  2040             if (IN_param_value == NULL)
       
  2041               IN_param_value = function_call_param_iterator.next();
       
  2042             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2043             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2044             
       
  2045             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  2046             {
       
  2047         
       
  2048                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  2049                 s4o.print("(");
       
  2050                 return_type_symbol->accept(*this);
       
  2051                 s4o.print(")");
       
  2052                 IN_param_value->accept(*this);
       
  2053                 return NULL;
       
  2054                 
       
  2055             }
       
  2056             
       
  2057             ERROR;
       
  2058         }
       
  2059         
       
  2060     }/*function_int_to_dword*/
       
  2061     break;
       
  2062 
       
  2063 /****
       
  2064  *INT_TO_LWORD
       
  2065  */
       
  2066     case function_int_to_lword :
       
  2067     {
       
  2068         symbol_c *last_type_symbol = NULL;
       
  2069 
       
  2070         {
       
  2071             identifier_c param_name("IN");
       
  2072             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2073             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2074             
       
  2075             /* Get the value from a foo(<param_value>) style call */
       
  2076             if (IN_param_value == NULL)
       
  2077               IN_param_value = function_call_param_iterator.next();
       
  2078             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2079             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2080             
       
  2081             if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
       
  2082             {
       
  2083         
       
  2084                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  2085                 s4o.print("(");
       
  2086                 return_type_symbol->accept(*this);
       
  2087                 s4o.print(")");
       
  2088                 IN_param_value->accept(*this);
       
  2089                 return NULL;
       
  2090                 
       
  2091             }
       
  2092             
       
  2093             ERROR;
       
  2094         }
       
  2095         
       
  2096     }/*function_int_to_lword*/
       
  2097     break;
       
  2098 
       
  2099 /****
       
  2100  *DINT_TO_BOOL
       
  2101  */
       
  2102     case function_dint_to_bool :
       
  2103     {
       
  2104         symbol_c *last_type_symbol = NULL;
       
  2105 
       
  2106         {
       
  2107             identifier_c param_name("IN");
       
  2108             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2109             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2110             
       
  2111             /* Get the value from a foo(<param_value>) style call */
       
  2112             if (IN_param_value == NULL)
       
  2113               IN_param_value = function_call_param_iterator.next();
       
  2114             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2115             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2116             
       
  2117             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2118             {
       
  2119         
       
  2120                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  2121                 s4o.print("(");
       
  2122                 return_type_symbol->accept(*this);
       
  2123                 s4o.print(")");
       
  2124                 IN_param_value->accept(*this);
       
  2125                 return NULL;
       
  2126                 
       
  2127             }
       
  2128             
       
  2129             ERROR;
       
  2130         }
       
  2131         
       
  2132     }/*function_dint_to_bool*/
       
  2133     break;
       
  2134 
       
  2135 /****
       
  2136  *DINT_TO_SINT
       
  2137  */
       
  2138     case function_dint_to_sint :
       
  2139     {
       
  2140         symbol_c *last_type_symbol = NULL;
       
  2141 
       
  2142         {
       
  2143             identifier_c param_name("IN");
       
  2144             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2145             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2146             
       
  2147             /* Get the value from a foo(<param_value>) style call */
       
  2148             if (IN_param_value == NULL)
       
  2149               IN_param_value = function_call_param_iterator.next();
       
  2150             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2151             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2152             
       
  2153             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2154             {
       
  2155         
       
  2156                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  2157                 s4o.print("(");
       
  2158                 return_type_symbol->accept(*this);
       
  2159                 s4o.print(")");
       
  2160                 IN_param_value->accept(*this);
       
  2161                 return NULL;
       
  2162                 
       
  2163             }
       
  2164             
       
  2165             ERROR;
       
  2166         }
       
  2167         
       
  2168     }/*function_dint_to_sint*/
       
  2169     break;
       
  2170 
       
  2171 /****
       
  2172  *DINT_TO_INT
       
  2173  */
       
  2174     case function_dint_to_int :
       
  2175     {
       
  2176         symbol_c *last_type_symbol = NULL;
       
  2177 
       
  2178         {
       
  2179             identifier_c param_name("IN");
       
  2180             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2181             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2182             
       
  2183             /* Get the value from a foo(<param_value>) style call */
       
  2184             if (IN_param_value == NULL)
       
  2185               IN_param_value = function_call_param_iterator.next();
       
  2186             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2187             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2188             
       
  2189             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2190             {
       
  2191         
       
  2192                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  2193                 s4o.print("(");
       
  2194                 return_type_symbol->accept(*this);
       
  2195                 s4o.print(")");
       
  2196                 IN_param_value->accept(*this);
       
  2197                 return NULL;
       
  2198                 
       
  2199             }
       
  2200             
       
  2201             ERROR;
       
  2202         }
       
  2203         
       
  2204     }/*function_dint_to_int*/
       
  2205     break;
       
  2206 
       
  2207 /****
       
  2208  *DINT_TO_LINT
       
  2209  */
       
  2210     case function_dint_to_lint :
       
  2211     {
       
  2212         symbol_c *last_type_symbol = NULL;
       
  2213 
       
  2214         {
       
  2215             identifier_c param_name("IN");
       
  2216             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2217             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2218             
       
  2219             /* Get the value from a foo(<param_value>) style call */
       
  2220             if (IN_param_value == NULL)
       
  2221               IN_param_value = function_call_param_iterator.next();
       
  2222             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2223             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2224             
       
  2225             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2226             {
       
  2227         
       
  2228                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  2229                 s4o.print("(");
       
  2230                 return_type_symbol->accept(*this);
       
  2231                 s4o.print(")");
       
  2232                 IN_param_value->accept(*this);
       
  2233                 return NULL;
       
  2234                 
       
  2235             }
       
  2236             
       
  2237             ERROR;
       
  2238         }
       
  2239         
       
  2240     }/*function_dint_to_lint*/
       
  2241     break;
       
  2242 
       
  2243 /****
       
  2244  *DINT_TO_USINT
       
  2245  */
       
  2246     case function_dint_to_usint :
       
  2247     {
       
  2248         symbol_c *last_type_symbol = NULL;
       
  2249 
       
  2250         {
       
  2251             identifier_c param_name("IN");
       
  2252             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2253             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2254             
       
  2255             /* Get the value from a foo(<param_value>) style call */
       
  2256             if (IN_param_value == NULL)
       
  2257               IN_param_value = function_call_param_iterator.next();
       
  2258             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2259             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2260             
       
  2261             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2262             {
       
  2263         
       
  2264                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  2265                 s4o.print("(");
       
  2266                 return_type_symbol->accept(*this);
       
  2267                 s4o.print(")");
       
  2268                 IN_param_value->accept(*this);
       
  2269                 return NULL;
       
  2270                 
       
  2271             }
       
  2272             
       
  2273             ERROR;
       
  2274         }
       
  2275         
       
  2276     }/*function_dint_to_usint*/
       
  2277     break;
       
  2278 
       
  2279 /****
       
  2280  *DINT_TO_UINT
       
  2281  */
       
  2282     case function_dint_to_uint :
       
  2283     {
       
  2284         symbol_c *last_type_symbol = NULL;
       
  2285 
       
  2286         {
       
  2287             identifier_c param_name("IN");
       
  2288             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2289             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2290             
       
  2291             /* Get the value from a foo(<param_value>) style call */
       
  2292             if (IN_param_value == NULL)
       
  2293               IN_param_value = function_call_param_iterator.next();
       
  2294             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2295             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2296             
       
  2297             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2298             {
       
  2299         
       
  2300                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  2301                 s4o.print("(");
       
  2302                 return_type_symbol->accept(*this);
       
  2303                 s4o.print(")");
       
  2304                 IN_param_value->accept(*this);
       
  2305                 return NULL;
       
  2306                 
       
  2307             }
       
  2308             
       
  2309             ERROR;
       
  2310         }
       
  2311         
       
  2312     }/*function_dint_to_uint*/
       
  2313     break;
       
  2314 
       
  2315 /****
       
  2316  *DINT_TO_UDINT
       
  2317  */
       
  2318     case function_dint_to_udint :
       
  2319     {
       
  2320         symbol_c *last_type_symbol = NULL;
       
  2321 
       
  2322         {
       
  2323             identifier_c param_name("IN");
       
  2324             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2325             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2326             
       
  2327             /* Get the value from a foo(<param_value>) style call */
       
  2328             if (IN_param_value == NULL)
       
  2329               IN_param_value = function_call_param_iterator.next();
       
  2330             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2331             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2332             
       
  2333             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2334             {
       
  2335         
       
  2336                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  2337                 s4o.print("(");
       
  2338                 return_type_symbol->accept(*this);
       
  2339                 s4o.print(")");
       
  2340                 IN_param_value->accept(*this);
       
  2341                 return NULL;
       
  2342                 
       
  2343             }
       
  2344             
       
  2345             ERROR;
       
  2346         }
       
  2347         
       
  2348     }/*function_dint_to_udint*/
       
  2349     break;
       
  2350 
       
  2351 /****
       
  2352  *DINT_TO_ULINT
       
  2353  */
       
  2354     case function_dint_to_ulint :
       
  2355     {
       
  2356         symbol_c *last_type_symbol = NULL;
       
  2357 
       
  2358         {
       
  2359             identifier_c param_name("IN");
       
  2360             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2361             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2362             
       
  2363             /* Get the value from a foo(<param_value>) style call */
       
  2364             if (IN_param_value == NULL)
       
  2365               IN_param_value = function_call_param_iterator.next();
       
  2366             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2367             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2368             
       
  2369             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2370             {
       
  2371         
       
  2372                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  2373                 s4o.print("(");
       
  2374                 return_type_symbol->accept(*this);
       
  2375                 s4o.print(")");
       
  2376                 IN_param_value->accept(*this);
       
  2377                 return NULL;
       
  2378                 
       
  2379             }
       
  2380             
       
  2381             ERROR;
       
  2382         }
       
  2383         
       
  2384     }/*function_dint_to_ulint*/
       
  2385     break;
       
  2386 
       
  2387 /****
       
  2388  *DINT_TO_REAL
       
  2389  */
       
  2390     case function_dint_to_real :
       
  2391     {
       
  2392         symbol_c *last_type_symbol = NULL;
       
  2393 
       
  2394         {
       
  2395             identifier_c param_name("IN");
       
  2396             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2397             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2398             
       
  2399             /* Get the value from a foo(<param_value>) style call */
       
  2400             if (IN_param_value == NULL)
       
  2401               IN_param_value = function_call_param_iterator.next();
       
  2402             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2403             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2404             
       
  2405             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2406             {
       
  2407         
       
  2408                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  2409                 s4o.print("(");
       
  2410                 return_type_symbol->accept(*this);
       
  2411                 s4o.print(")");
       
  2412                 IN_param_value->accept(*this);
       
  2413                 return NULL;
       
  2414                 
       
  2415             }
       
  2416             
       
  2417             ERROR;
       
  2418         }
       
  2419         
       
  2420     }/*function_dint_to_real*/
       
  2421     break;
       
  2422 
       
  2423 /****
       
  2424  *DINT_TO_LREAL
       
  2425  */
       
  2426     case function_dint_to_lreal :
       
  2427     {
       
  2428         symbol_c *last_type_symbol = NULL;
       
  2429 
       
  2430         {
       
  2431             identifier_c param_name("IN");
       
  2432             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2433             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2434             
       
  2435             /* Get the value from a foo(<param_value>) style call */
       
  2436             if (IN_param_value == NULL)
       
  2437               IN_param_value = function_call_param_iterator.next();
       
  2438             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2439             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2440             
       
  2441             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2442             {
       
  2443         
       
  2444                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  2445                 s4o.print("(");
       
  2446                 return_type_symbol->accept(*this);
       
  2447                 s4o.print(")");
       
  2448                 IN_param_value->accept(*this);
       
  2449                 return NULL;
       
  2450                 
       
  2451             }
       
  2452             
       
  2453             ERROR;
       
  2454         }
       
  2455         
       
  2456     }/*function_dint_to_lreal*/
       
  2457     break;
       
  2458 
       
  2459 /****
       
  2460  *DINT_TO_TIME
       
  2461  */
       
  2462     case function_dint_to_time :
       
  2463     {
       
  2464         symbol_c *last_type_symbol = NULL;
       
  2465 
       
  2466         {
       
  2467             identifier_c param_name("IN");
       
  2468             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2469             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2470             
       
  2471             /* Get the value from a foo(<param_value>) style call */
       
  2472             if (IN_param_value == NULL)
       
  2473               IN_param_value = function_call_param_iterator.next();
       
  2474             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2475             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2476             
       
  2477             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2478             {
       
  2479         
       
  2480                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  2481                 s4o.print("(");
       
  2482                 return_type_symbol->accept(*this);
       
  2483                 s4o.print(")__int_to_time(");
       
  2484                 IN_param_value->accept(*this);
       
  2485                 s4o.print(")");
       
  2486                 return NULL;
       
  2487                 
       
  2488             }
       
  2489             
       
  2490             ERROR;
       
  2491         }
       
  2492         
       
  2493     }/*function_dint_to_time*/
       
  2494     break;
       
  2495 
       
  2496 /****
       
  2497  *DINT_TO_DATE
       
  2498  */
       
  2499     case function_dint_to_date :
       
  2500     {
       
  2501         symbol_c *last_type_symbol = NULL;
       
  2502 
       
  2503         {
       
  2504             identifier_c param_name("IN");
       
  2505             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2506             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2507             
       
  2508             /* Get the value from a foo(<param_value>) style call */
       
  2509             if (IN_param_value == NULL)
       
  2510               IN_param_value = function_call_param_iterator.next();
       
  2511             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2512             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2513             
       
  2514             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2515             {
       
  2516         
       
  2517                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  2518                 s4o.print("(");
       
  2519                 return_type_symbol->accept(*this);
       
  2520                 s4o.print(")__int_to_time(");
       
  2521                 IN_param_value->accept(*this);
       
  2522                 s4o.print(")");
       
  2523                 return NULL;
       
  2524                 
       
  2525             }
       
  2526             
       
  2527             ERROR;
       
  2528         }
       
  2529         
       
  2530     }/*function_dint_to_date*/
       
  2531     break;
       
  2532 
       
  2533 /****
       
  2534  *DINT_TO_TOD
       
  2535  */
       
  2536     case function_dint_to_tod :
       
  2537     {
       
  2538         symbol_c *last_type_symbol = NULL;
       
  2539 
       
  2540         {
       
  2541             identifier_c param_name("IN");
       
  2542             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2543             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2544             
       
  2545             /* Get the value from a foo(<param_value>) style call */
       
  2546             if (IN_param_value == NULL)
       
  2547               IN_param_value = function_call_param_iterator.next();
       
  2548             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2549             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2550             
       
  2551             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2552             {
       
  2553         
       
  2554                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  2555                 s4o.print("(");
       
  2556                 return_type_symbol->accept(*this);
       
  2557                 s4o.print(")__int_to_time(");
       
  2558                 IN_param_value->accept(*this);
       
  2559                 s4o.print(")");
       
  2560                 return NULL;
       
  2561                 
       
  2562             }
       
  2563             
       
  2564             ERROR;
       
  2565         }
       
  2566         
       
  2567     }/*function_dint_to_tod*/
       
  2568     break;
       
  2569 
       
  2570 /****
       
  2571  *DINT_TO_DT
       
  2572  */
       
  2573     case function_dint_to_dt :
       
  2574     {
       
  2575         symbol_c *last_type_symbol = NULL;
       
  2576 
       
  2577         {
       
  2578             identifier_c param_name("IN");
       
  2579             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2580             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2581             
       
  2582             /* Get the value from a foo(<param_value>) style call */
       
  2583             if (IN_param_value == NULL)
       
  2584               IN_param_value = function_call_param_iterator.next();
       
  2585             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2586             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2587             
       
  2588             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2589             {
       
  2590         
       
  2591                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  2592                 s4o.print("(");
       
  2593                 return_type_symbol->accept(*this);
       
  2594                 s4o.print(")__int_to_time(");
       
  2595                 IN_param_value->accept(*this);
       
  2596                 s4o.print(")");
       
  2597                 return NULL;
       
  2598                 
       
  2599             }
       
  2600             
       
  2601             ERROR;
       
  2602         }
       
  2603         
       
  2604     }/*function_dint_to_dt*/
       
  2605     break;
       
  2606 
       
  2607 /****
       
  2608  *DINT_TO_STRING
       
  2609  */
       
  2610     case function_dint_to_string :
       
  2611     {
       
  2612         symbol_c *last_type_symbol = NULL;
       
  2613 
       
  2614         {
       
  2615             identifier_c param_name("IN");
       
  2616             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2617             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2618             
       
  2619             /* Get the value from a foo(<param_value>) style call */
       
  2620             if (IN_param_value == NULL)
       
  2621               IN_param_value = function_call_param_iterator.next();
       
  2622             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2623             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2624             
       
  2625             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2626             {
       
  2627         
       
  2628                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  2629                 s4o.print("(");
       
  2630                 return_type_symbol->accept(*this);
       
  2631                 s4o.print(")__sint_to_string(");
       
  2632                 IN_param_value->accept(*this);
       
  2633                 s4o.print(")");
       
  2634                 return NULL;
       
  2635                 
       
  2636             }
       
  2637             
       
  2638             ERROR;
       
  2639         }
       
  2640         
       
  2641     }/*function_dint_to_string*/
       
  2642     break;
       
  2643 
       
  2644 /****
       
  2645  *DINT_TO_BYTE
       
  2646  */
       
  2647     case function_dint_to_byte :
       
  2648     {
       
  2649         symbol_c *last_type_symbol = NULL;
       
  2650 
       
  2651         {
       
  2652             identifier_c param_name("IN");
       
  2653             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2654             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2655             
       
  2656             /* Get the value from a foo(<param_value>) style call */
       
  2657             if (IN_param_value == NULL)
       
  2658               IN_param_value = function_call_param_iterator.next();
       
  2659             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2660             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2661             
       
  2662             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2663             {
       
  2664         
       
  2665                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  2666                 s4o.print("(");
       
  2667                 return_type_symbol->accept(*this);
       
  2668                 s4o.print(")");
       
  2669                 IN_param_value->accept(*this);
       
  2670                 return NULL;
       
  2671                 
       
  2672             }
       
  2673             
       
  2674             ERROR;
       
  2675         }
       
  2676         
       
  2677     }/*function_dint_to_byte*/
       
  2678     break;
       
  2679 
       
  2680 /****
       
  2681  *DINT_TO_WORD
       
  2682  */
       
  2683     case function_dint_to_word :
       
  2684     {
       
  2685         symbol_c *last_type_symbol = NULL;
       
  2686 
       
  2687         {
       
  2688             identifier_c param_name("IN");
       
  2689             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2690             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2691             
       
  2692             /* Get the value from a foo(<param_value>) style call */
       
  2693             if (IN_param_value == NULL)
       
  2694               IN_param_value = function_call_param_iterator.next();
       
  2695             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2696             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2697             
       
  2698             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2699             {
       
  2700         
       
  2701                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  2702                 s4o.print("(");
       
  2703                 return_type_symbol->accept(*this);
       
  2704                 s4o.print(")");
       
  2705                 IN_param_value->accept(*this);
       
  2706                 return NULL;
       
  2707                 
       
  2708             }
       
  2709             
       
  2710             ERROR;
       
  2711         }
       
  2712         
       
  2713     }/*function_dint_to_word*/
       
  2714     break;
       
  2715 
       
  2716 /****
       
  2717  *DINT_TO_DWORD
       
  2718  */
       
  2719     case function_dint_to_dword :
       
  2720     {
       
  2721         symbol_c *last_type_symbol = NULL;
       
  2722 
       
  2723         {
       
  2724             identifier_c param_name("IN");
       
  2725             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2726             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2727             
       
  2728             /* Get the value from a foo(<param_value>) style call */
       
  2729             if (IN_param_value == NULL)
       
  2730               IN_param_value = function_call_param_iterator.next();
       
  2731             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2732             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2733             
       
  2734             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2735             {
       
  2736         
       
  2737                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  2738                 s4o.print("(");
       
  2739                 return_type_symbol->accept(*this);
       
  2740                 s4o.print(")");
       
  2741                 IN_param_value->accept(*this);
       
  2742                 return NULL;
       
  2743                 
       
  2744             }
       
  2745             
       
  2746             ERROR;
       
  2747         }
       
  2748         
       
  2749     }/*function_dint_to_dword*/
       
  2750     break;
       
  2751 
       
  2752 /****
       
  2753  *DINT_TO_LWORD
       
  2754  */
       
  2755     case function_dint_to_lword :
       
  2756     {
       
  2757         symbol_c *last_type_symbol = NULL;
       
  2758 
       
  2759         {
       
  2760             identifier_c param_name("IN");
       
  2761             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2762             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2763             
       
  2764             /* Get the value from a foo(<param_value>) style call */
       
  2765             if (IN_param_value == NULL)
       
  2766               IN_param_value = function_call_param_iterator.next();
       
  2767             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2768             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2769             
       
  2770             if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
       
  2771             {
       
  2772         
       
  2773                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  2774                 s4o.print("(");
       
  2775                 return_type_symbol->accept(*this);
       
  2776                 s4o.print(")");
       
  2777                 IN_param_value->accept(*this);
       
  2778                 return NULL;
       
  2779                 
       
  2780             }
       
  2781             
       
  2782             ERROR;
       
  2783         }
       
  2784         
       
  2785     }/*function_dint_to_lword*/
       
  2786     break;
       
  2787 
       
  2788 /****
       
  2789  *LINT_TO_BOOL
       
  2790  */
       
  2791     case function_lint_to_bool :
       
  2792     {
       
  2793         symbol_c *last_type_symbol = NULL;
       
  2794 
       
  2795         {
       
  2796             identifier_c param_name("IN");
       
  2797             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2798             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2799             
       
  2800             /* Get the value from a foo(<param_value>) style call */
       
  2801             if (IN_param_value == NULL)
       
  2802               IN_param_value = function_call_param_iterator.next();
       
  2803             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2804             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2805             
       
  2806             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  2807             {
       
  2808         
       
  2809                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  2810                 s4o.print("(");
       
  2811                 return_type_symbol->accept(*this);
       
  2812                 s4o.print(")");
       
  2813                 IN_param_value->accept(*this);
       
  2814                 return NULL;
       
  2815                 
       
  2816             }
       
  2817             
       
  2818             ERROR;
       
  2819         }
       
  2820         
       
  2821     }/*function_lint_to_bool*/
       
  2822     break;
       
  2823 
       
  2824 /****
       
  2825  *LINT_TO_SINT
       
  2826  */
       
  2827     case function_lint_to_sint :
       
  2828     {
       
  2829         symbol_c *last_type_symbol = NULL;
       
  2830 
       
  2831         {
       
  2832             identifier_c param_name("IN");
       
  2833             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2834             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2835             
       
  2836             /* Get the value from a foo(<param_value>) style call */
       
  2837             if (IN_param_value == NULL)
       
  2838               IN_param_value = function_call_param_iterator.next();
       
  2839             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2840             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2841             
       
  2842             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  2843             {
       
  2844         
       
  2845                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  2846                 s4o.print("(");
       
  2847                 return_type_symbol->accept(*this);
       
  2848                 s4o.print(")");
       
  2849                 IN_param_value->accept(*this);
       
  2850                 return NULL;
       
  2851                 
       
  2852             }
       
  2853             
       
  2854             ERROR;
       
  2855         }
       
  2856         
       
  2857     }/*function_lint_to_sint*/
       
  2858     break;
       
  2859 
       
  2860 /****
       
  2861  *LINT_TO_INT
       
  2862  */
       
  2863     case function_lint_to_int :
       
  2864     {
       
  2865         symbol_c *last_type_symbol = NULL;
       
  2866 
       
  2867         {
       
  2868             identifier_c param_name("IN");
       
  2869             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2870             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2871             
       
  2872             /* Get the value from a foo(<param_value>) style call */
       
  2873             if (IN_param_value == NULL)
       
  2874               IN_param_value = function_call_param_iterator.next();
       
  2875             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2876             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2877             
       
  2878             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  2879             {
       
  2880         
       
  2881                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  2882                 s4o.print("(");
       
  2883                 return_type_symbol->accept(*this);
       
  2884                 s4o.print(")");
       
  2885                 IN_param_value->accept(*this);
       
  2886                 return NULL;
       
  2887                 
       
  2888             }
       
  2889             
       
  2890             ERROR;
       
  2891         }
       
  2892         
       
  2893     }/*function_lint_to_int*/
       
  2894     break;
       
  2895 
       
  2896 /****
       
  2897  *LINT_TO_DINT
       
  2898  */
       
  2899     case function_lint_to_dint :
       
  2900     {
       
  2901         symbol_c *last_type_symbol = NULL;
       
  2902 
       
  2903         {
       
  2904             identifier_c param_name("IN");
       
  2905             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2906             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2907             
       
  2908             /* Get the value from a foo(<param_value>) style call */
       
  2909             if (IN_param_value == NULL)
       
  2910               IN_param_value = function_call_param_iterator.next();
       
  2911             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2912             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2913             
       
  2914             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  2915             {
       
  2916         
       
  2917                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  2918                 s4o.print("(");
       
  2919                 return_type_symbol->accept(*this);
       
  2920                 s4o.print(")");
       
  2921                 IN_param_value->accept(*this);
       
  2922                 return NULL;
       
  2923                 
       
  2924             }
       
  2925             
       
  2926             ERROR;
       
  2927         }
       
  2928         
       
  2929     }/*function_lint_to_dint*/
       
  2930     break;
       
  2931 
       
  2932 /****
       
  2933  *LINT_TO_USINT
       
  2934  */
       
  2935     case function_lint_to_usint :
       
  2936     {
       
  2937         symbol_c *last_type_symbol = NULL;
       
  2938 
       
  2939         {
       
  2940             identifier_c param_name("IN");
       
  2941             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2942             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2943             
       
  2944             /* Get the value from a foo(<param_value>) style call */
       
  2945             if (IN_param_value == NULL)
       
  2946               IN_param_value = function_call_param_iterator.next();
       
  2947             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2948             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2949             
       
  2950             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  2951             {
       
  2952         
       
  2953                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  2954                 s4o.print("(");
       
  2955                 return_type_symbol->accept(*this);
       
  2956                 s4o.print(")");
       
  2957                 IN_param_value->accept(*this);
       
  2958                 return NULL;
       
  2959                 
       
  2960             }
       
  2961             
       
  2962             ERROR;
       
  2963         }
       
  2964         
       
  2965     }/*function_lint_to_usint*/
       
  2966     break;
       
  2967 
       
  2968 /****
       
  2969  *LINT_TO_UINT
       
  2970  */
       
  2971     case function_lint_to_uint :
       
  2972     {
       
  2973         symbol_c *last_type_symbol = NULL;
       
  2974 
       
  2975         {
       
  2976             identifier_c param_name("IN");
       
  2977             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2978             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2979             
       
  2980             /* Get the value from a foo(<param_value>) style call */
       
  2981             if (IN_param_value == NULL)
       
  2982               IN_param_value = function_call_param_iterator.next();
       
  2983             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2984             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2985             
       
  2986             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  2987             {
       
  2988         
       
  2989                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  2990                 s4o.print("(");
       
  2991                 return_type_symbol->accept(*this);
       
  2992                 s4o.print(")");
       
  2993                 IN_param_value->accept(*this);
       
  2994                 return NULL;
       
  2995                 
       
  2996             }
       
  2997             
       
  2998             ERROR;
       
  2999         }
       
  3000         
       
  3001     }/*function_lint_to_uint*/
       
  3002     break;
       
  3003 
       
  3004 /****
       
  3005  *LINT_TO_UDINT
       
  3006  */
       
  3007     case function_lint_to_udint :
       
  3008     {
       
  3009         symbol_c *last_type_symbol = NULL;
       
  3010 
       
  3011         {
       
  3012             identifier_c param_name("IN");
       
  3013             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3014             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3015             
       
  3016             /* Get the value from a foo(<param_value>) style call */
       
  3017             if (IN_param_value == NULL)
       
  3018               IN_param_value = function_call_param_iterator.next();
       
  3019             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3020             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3021             
       
  3022             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  3023             {
       
  3024         
       
  3025                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  3026                 s4o.print("(");
       
  3027                 return_type_symbol->accept(*this);
       
  3028                 s4o.print(")");
       
  3029                 IN_param_value->accept(*this);
       
  3030                 return NULL;
       
  3031                 
       
  3032             }
       
  3033             
       
  3034             ERROR;
       
  3035         }
       
  3036         
       
  3037     }/*function_lint_to_udint*/
       
  3038     break;
       
  3039 
       
  3040 /****
       
  3041  *LINT_TO_ULINT
       
  3042  */
       
  3043     case function_lint_to_ulint :
       
  3044     {
       
  3045         symbol_c *last_type_symbol = NULL;
       
  3046 
       
  3047         {
       
  3048             identifier_c param_name("IN");
       
  3049             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3050             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3051             
       
  3052             /* Get the value from a foo(<param_value>) style call */
       
  3053             if (IN_param_value == NULL)
       
  3054               IN_param_value = function_call_param_iterator.next();
       
  3055             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3056             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3057             
       
  3058             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  3059             {
       
  3060         
       
  3061                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  3062                 s4o.print("(");
       
  3063                 return_type_symbol->accept(*this);
       
  3064                 s4o.print(")");
       
  3065                 IN_param_value->accept(*this);
       
  3066                 return NULL;
       
  3067                 
       
  3068             }
       
  3069             
       
  3070             ERROR;
       
  3071         }
       
  3072         
       
  3073     }/*function_lint_to_ulint*/
       
  3074     break;
       
  3075 
       
  3076 /****
       
  3077  *LINT_TO_REAL
       
  3078  */
       
  3079     case function_lint_to_real :
       
  3080     {
       
  3081         symbol_c *last_type_symbol = NULL;
       
  3082 
       
  3083         {
       
  3084             identifier_c param_name("IN");
       
  3085             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3086             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3087             
       
  3088             /* Get the value from a foo(<param_value>) style call */
       
  3089             if (IN_param_value == NULL)
       
  3090               IN_param_value = function_call_param_iterator.next();
       
  3091             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3092             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3093             
       
  3094             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  3095             {
       
  3096         
       
  3097                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  3098                 s4o.print("(");
       
  3099                 return_type_symbol->accept(*this);
       
  3100                 s4o.print(")");
       
  3101                 IN_param_value->accept(*this);
       
  3102                 return NULL;
       
  3103                 
       
  3104             }
       
  3105             
       
  3106             ERROR;
       
  3107         }
       
  3108         
       
  3109     }/*function_lint_to_real*/
       
  3110     break;
       
  3111 
       
  3112 /****
       
  3113  *LINT_TO_LREAL
       
  3114  */
       
  3115     case function_lint_to_lreal :
       
  3116     {
       
  3117         symbol_c *last_type_symbol = NULL;
       
  3118 
       
  3119         {
       
  3120             identifier_c param_name("IN");
       
  3121             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3122             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3123             
       
  3124             /* Get the value from a foo(<param_value>) style call */
       
  3125             if (IN_param_value == NULL)
       
  3126               IN_param_value = function_call_param_iterator.next();
       
  3127             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3128             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3129             
       
  3130             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  3131             {
       
  3132         
       
  3133                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  3134                 s4o.print("(");
       
  3135                 return_type_symbol->accept(*this);
       
  3136                 s4o.print(")");
       
  3137                 IN_param_value->accept(*this);
       
  3138                 return NULL;
       
  3139                 
       
  3140             }
       
  3141             
       
  3142             ERROR;
       
  3143         }
       
  3144         
       
  3145     }/*function_lint_to_lreal*/
       
  3146     break;
       
  3147 
       
  3148 /****
       
  3149  *LINT_TO_TIME
       
  3150  */
       
  3151     case function_lint_to_time :
       
  3152     {
       
  3153         symbol_c *last_type_symbol = NULL;
       
  3154 
       
  3155         {
       
  3156             identifier_c param_name("IN");
       
  3157             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3158             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3159             
       
  3160             /* Get the value from a foo(<param_value>) style call */
       
  3161             if (IN_param_value == NULL)
       
  3162               IN_param_value = function_call_param_iterator.next();
       
  3163             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3164             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3165             
       
  3166             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  3167             {
       
  3168         
       
  3169                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  3170                 s4o.print("(");
       
  3171                 return_type_symbol->accept(*this);
       
  3172                 s4o.print(")__int_to_time(");
       
  3173                 IN_param_value->accept(*this);
       
  3174                 s4o.print(")");
       
  3175                 return NULL;
       
  3176                 
       
  3177             }
       
  3178             
       
  3179             ERROR;
       
  3180         }
       
  3181         
       
  3182     }/*function_lint_to_time*/
       
  3183     break;
       
  3184 
       
  3185 /****
       
  3186  *LINT_TO_DATE
       
  3187  */
       
  3188     case function_lint_to_date :
       
  3189     {
       
  3190         symbol_c *last_type_symbol = NULL;
       
  3191 
       
  3192         {
       
  3193             identifier_c param_name("IN");
       
  3194             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3195             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3196             
       
  3197             /* Get the value from a foo(<param_value>) style call */
       
  3198             if (IN_param_value == NULL)
       
  3199               IN_param_value = function_call_param_iterator.next();
       
  3200             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3201             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3202             
       
  3203             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  3204             {
       
  3205         
       
  3206                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  3207                 s4o.print("(");
       
  3208                 return_type_symbol->accept(*this);
       
  3209                 s4o.print(")__int_to_time(");
       
  3210                 IN_param_value->accept(*this);
       
  3211                 s4o.print(")");
       
  3212                 return NULL;
       
  3213                 
       
  3214             }
       
  3215             
       
  3216             ERROR;
       
  3217         }
       
  3218         
       
  3219     }/*function_lint_to_date*/
       
  3220     break;
       
  3221 
       
  3222 /****
       
  3223  *LINT_TO_TOD
       
  3224  */
       
  3225     case function_lint_to_tod :
       
  3226     {
       
  3227         symbol_c *last_type_symbol = NULL;
       
  3228 
       
  3229         {
       
  3230             identifier_c param_name("IN");
       
  3231             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3232             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3233             
       
  3234             /* Get the value from a foo(<param_value>) style call */
       
  3235             if (IN_param_value == NULL)
       
  3236               IN_param_value = function_call_param_iterator.next();
       
  3237             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3238             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3239             
       
  3240             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  3241             {
       
  3242         
       
  3243                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  3244                 s4o.print("(");
       
  3245                 return_type_symbol->accept(*this);
       
  3246                 s4o.print(")__int_to_time(");
       
  3247                 IN_param_value->accept(*this);
       
  3248                 s4o.print(")");
       
  3249                 return NULL;
       
  3250                 
       
  3251             }
       
  3252             
       
  3253             ERROR;
       
  3254         }
       
  3255         
       
  3256     }/*function_lint_to_tod*/
       
  3257     break;
       
  3258 
       
  3259 /****
       
  3260  *LINT_TO_DT
       
  3261  */
       
  3262     case function_lint_to_dt :
       
  3263     {
       
  3264         symbol_c *last_type_symbol = NULL;
       
  3265 
       
  3266         {
       
  3267             identifier_c param_name("IN");
       
  3268             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3269             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3270             
       
  3271             /* Get the value from a foo(<param_value>) style call */
       
  3272             if (IN_param_value == NULL)
       
  3273               IN_param_value = function_call_param_iterator.next();
       
  3274             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3275             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3276             
       
  3277             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  3278             {
       
  3279         
       
  3280                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  3281                 s4o.print("(");
       
  3282                 return_type_symbol->accept(*this);
       
  3283                 s4o.print(")__int_to_time(");
       
  3284                 IN_param_value->accept(*this);
       
  3285                 s4o.print(")");
       
  3286                 return NULL;
       
  3287                 
       
  3288             }
       
  3289             
       
  3290             ERROR;
       
  3291         }
       
  3292         
       
  3293     }/*function_lint_to_dt*/
       
  3294     break;
       
  3295 
       
  3296 /****
       
  3297  *LINT_TO_STRING
       
  3298  */
       
  3299     case function_lint_to_string :
       
  3300     {
       
  3301         symbol_c *last_type_symbol = NULL;
       
  3302 
       
  3303         {
       
  3304             identifier_c param_name("IN");
       
  3305             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3306             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3307             
       
  3308             /* Get the value from a foo(<param_value>) style call */
       
  3309             if (IN_param_value == NULL)
       
  3310               IN_param_value = function_call_param_iterator.next();
       
  3311             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3312             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3313             
       
  3314             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  3315             {
       
  3316         
       
  3317                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  3318                 s4o.print("(");
       
  3319                 return_type_symbol->accept(*this);
       
  3320                 s4o.print(")__sint_to_string(");
       
  3321                 IN_param_value->accept(*this);
       
  3322                 s4o.print(")");
       
  3323                 return NULL;
       
  3324                 
       
  3325             }
       
  3326             
       
  3327             ERROR;
       
  3328         }
       
  3329         
       
  3330     }/*function_lint_to_string*/
       
  3331     break;
       
  3332 
       
  3333 /****
       
  3334  *LINT_TO_BYTE
       
  3335  */
       
  3336     case function_lint_to_byte :
       
  3337     {
       
  3338         symbol_c *last_type_symbol = NULL;
       
  3339 
       
  3340         {
       
  3341             identifier_c param_name("IN");
       
  3342             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3343             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3344             
       
  3345             /* Get the value from a foo(<param_value>) style call */
       
  3346             if (IN_param_value == NULL)
       
  3347               IN_param_value = function_call_param_iterator.next();
       
  3348             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3349             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3350             
       
  3351             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  3352             {
       
  3353         
       
  3354                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  3355                 s4o.print("(");
       
  3356                 return_type_symbol->accept(*this);
       
  3357                 s4o.print(")");
       
  3358                 IN_param_value->accept(*this);
       
  3359                 return NULL;
       
  3360                 
       
  3361             }
       
  3362             
       
  3363             ERROR;
       
  3364         }
       
  3365         
       
  3366     }/*function_lint_to_byte*/
       
  3367     break;
       
  3368 
       
  3369 /****
       
  3370  *LINT_TO_WORD
       
  3371  */
       
  3372     case function_lint_to_word :
       
  3373     {
       
  3374         symbol_c *last_type_symbol = NULL;
       
  3375 
       
  3376         {
       
  3377             identifier_c param_name("IN");
       
  3378             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3379             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3380             
       
  3381             /* Get the value from a foo(<param_value>) style call */
       
  3382             if (IN_param_value == NULL)
       
  3383               IN_param_value = function_call_param_iterator.next();
       
  3384             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3385             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3386             
       
  3387             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  3388             {
       
  3389         
       
  3390                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  3391                 s4o.print("(");
       
  3392                 return_type_symbol->accept(*this);
       
  3393                 s4o.print(")");
       
  3394                 IN_param_value->accept(*this);
       
  3395                 return NULL;
       
  3396                 
       
  3397             }
       
  3398             
       
  3399             ERROR;
       
  3400         }
       
  3401         
       
  3402     }/*function_lint_to_word*/
       
  3403     break;
       
  3404 
       
  3405 /****
       
  3406  *LINT_TO_DWORD
       
  3407  */
       
  3408     case function_lint_to_dword :
       
  3409     {
       
  3410         symbol_c *last_type_symbol = NULL;
       
  3411 
       
  3412         {
       
  3413             identifier_c param_name("IN");
       
  3414             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3415             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3416             
       
  3417             /* Get the value from a foo(<param_value>) style call */
       
  3418             if (IN_param_value == NULL)
       
  3419               IN_param_value = function_call_param_iterator.next();
       
  3420             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3421             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3422             
       
  3423             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  3424             {
       
  3425         
       
  3426                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  3427                 s4o.print("(");
       
  3428                 return_type_symbol->accept(*this);
       
  3429                 s4o.print(")");
       
  3430                 IN_param_value->accept(*this);
       
  3431                 return NULL;
       
  3432                 
       
  3433             }
       
  3434             
       
  3435             ERROR;
       
  3436         }
       
  3437         
       
  3438     }/*function_lint_to_dword*/
       
  3439     break;
       
  3440 
       
  3441 /****
       
  3442  *LINT_TO_LWORD
       
  3443  */
       
  3444     case function_lint_to_lword :
       
  3445     {
       
  3446         symbol_c *last_type_symbol = NULL;
       
  3447 
       
  3448         {
       
  3449             identifier_c param_name("IN");
       
  3450             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3451             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3452             
       
  3453             /* Get the value from a foo(<param_value>) style call */
       
  3454             if (IN_param_value == NULL)
       
  3455               IN_param_value = function_call_param_iterator.next();
       
  3456             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3457             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3458             
       
  3459             if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
       
  3460             {
       
  3461         
       
  3462                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  3463                 s4o.print("(");
       
  3464                 return_type_symbol->accept(*this);
       
  3465                 s4o.print(")");
       
  3466                 IN_param_value->accept(*this);
       
  3467                 return NULL;
       
  3468                 
       
  3469             }
       
  3470             
       
  3471             ERROR;
       
  3472         }
       
  3473         
       
  3474     }/*function_lint_to_lword*/
       
  3475     break;
       
  3476 
       
  3477 /****
       
  3478  *USINT_TO_BOOL
       
  3479  */
       
  3480     case function_usint_to_bool :
       
  3481     {
       
  3482         symbol_c *last_type_symbol = NULL;
       
  3483 
       
  3484         {
       
  3485             identifier_c param_name("IN");
       
  3486             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3487             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3488             
       
  3489             /* Get the value from a foo(<param_value>) style call */
       
  3490             if (IN_param_value == NULL)
       
  3491               IN_param_value = function_call_param_iterator.next();
       
  3492             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3493             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3494             
       
  3495             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  3496             {
       
  3497         
       
  3498                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  3499                 s4o.print("(");
       
  3500                 return_type_symbol->accept(*this);
       
  3501                 s4o.print(")");
       
  3502                 IN_param_value->accept(*this);
       
  3503                 return NULL;
       
  3504                 
       
  3505             }
       
  3506             
       
  3507             ERROR;
       
  3508         }
       
  3509         
       
  3510     }/*function_usint_to_bool*/
       
  3511     break;
       
  3512 
       
  3513 /****
       
  3514  *USINT_TO_SINT
       
  3515  */
       
  3516     case function_usint_to_sint :
       
  3517     {
       
  3518         symbol_c *last_type_symbol = NULL;
       
  3519 
       
  3520         {
       
  3521             identifier_c param_name("IN");
       
  3522             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3523             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3524             
       
  3525             /* Get the value from a foo(<param_value>) style call */
       
  3526             if (IN_param_value == NULL)
       
  3527               IN_param_value = function_call_param_iterator.next();
       
  3528             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3529             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3530             
       
  3531             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  3532             {
       
  3533         
       
  3534                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  3535                 s4o.print("(");
       
  3536                 return_type_symbol->accept(*this);
       
  3537                 s4o.print(")");
       
  3538                 IN_param_value->accept(*this);
       
  3539                 return NULL;
       
  3540                 
       
  3541             }
       
  3542             
       
  3543             ERROR;
       
  3544         }
       
  3545         
       
  3546     }/*function_usint_to_sint*/
       
  3547     break;
       
  3548 
       
  3549 /****
       
  3550  *USINT_TO_INT
       
  3551  */
       
  3552     case function_usint_to_int :
       
  3553     {
       
  3554         symbol_c *last_type_symbol = NULL;
       
  3555 
       
  3556         {
       
  3557             identifier_c param_name("IN");
       
  3558             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3559             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3560             
       
  3561             /* Get the value from a foo(<param_value>) style call */
       
  3562             if (IN_param_value == NULL)
       
  3563               IN_param_value = function_call_param_iterator.next();
       
  3564             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3565             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3566             
       
  3567             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  3568             {
       
  3569         
       
  3570                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  3571                 s4o.print("(");
       
  3572                 return_type_symbol->accept(*this);
       
  3573                 s4o.print(")");
       
  3574                 IN_param_value->accept(*this);
       
  3575                 return NULL;
       
  3576                 
       
  3577             }
       
  3578             
       
  3579             ERROR;
       
  3580         }
       
  3581         
       
  3582     }/*function_usint_to_int*/
       
  3583     break;
       
  3584 
       
  3585 /****
       
  3586  *USINT_TO_DINT
       
  3587  */
       
  3588     case function_usint_to_dint :
       
  3589     {
       
  3590         symbol_c *last_type_symbol = NULL;
       
  3591 
       
  3592         {
       
  3593             identifier_c param_name("IN");
       
  3594             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3595             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3596             
       
  3597             /* Get the value from a foo(<param_value>) style call */
       
  3598             if (IN_param_value == NULL)
       
  3599               IN_param_value = function_call_param_iterator.next();
       
  3600             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3601             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3602             
       
  3603             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  3604             {
       
  3605         
       
  3606                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  3607                 s4o.print("(");
       
  3608                 return_type_symbol->accept(*this);
       
  3609                 s4o.print(")");
       
  3610                 IN_param_value->accept(*this);
       
  3611                 return NULL;
       
  3612                 
       
  3613             }
       
  3614             
       
  3615             ERROR;
       
  3616         }
       
  3617         
       
  3618     }/*function_usint_to_dint*/
       
  3619     break;
       
  3620 
       
  3621 /****
       
  3622  *USINT_TO_LINT
       
  3623  */
       
  3624     case function_usint_to_lint :
       
  3625     {
       
  3626         symbol_c *last_type_symbol = NULL;
       
  3627 
       
  3628         {
       
  3629             identifier_c param_name("IN");
       
  3630             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3631             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3632             
       
  3633             /* Get the value from a foo(<param_value>) style call */
       
  3634             if (IN_param_value == NULL)
       
  3635               IN_param_value = function_call_param_iterator.next();
       
  3636             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3637             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3638             
       
  3639             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  3640             {
       
  3641         
       
  3642                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  3643                 s4o.print("(");
       
  3644                 return_type_symbol->accept(*this);
       
  3645                 s4o.print(")");
       
  3646                 IN_param_value->accept(*this);
       
  3647                 return NULL;
       
  3648                 
       
  3649             }
       
  3650             
       
  3651             ERROR;
       
  3652         }
       
  3653         
       
  3654     }/*function_usint_to_lint*/
       
  3655     break;
       
  3656 
       
  3657 /****
       
  3658  *USINT_TO_UINT
       
  3659  */
       
  3660     case function_usint_to_uint :
       
  3661     {
       
  3662         symbol_c *last_type_symbol = NULL;
       
  3663 
       
  3664         {
       
  3665             identifier_c param_name("IN");
       
  3666             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3667             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3668             
       
  3669             /* Get the value from a foo(<param_value>) style call */
       
  3670             if (IN_param_value == NULL)
       
  3671               IN_param_value = function_call_param_iterator.next();
       
  3672             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3673             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3674             
       
  3675             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  3676             {
       
  3677         
       
  3678                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  3679                 s4o.print("(");
       
  3680                 return_type_symbol->accept(*this);
       
  3681                 s4o.print(")");
       
  3682                 IN_param_value->accept(*this);
       
  3683                 return NULL;
       
  3684                 
       
  3685             }
       
  3686             
       
  3687             ERROR;
       
  3688         }
       
  3689         
       
  3690     }/*function_usint_to_uint*/
       
  3691     break;
       
  3692 
       
  3693 /****
       
  3694  *USINT_TO_UDINT
       
  3695  */
       
  3696     case function_usint_to_udint :
       
  3697     {
       
  3698         symbol_c *last_type_symbol = NULL;
       
  3699 
       
  3700         {
       
  3701             identifier_c param_name("IN");
       
  3702             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3703             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3704             
       
  3705             /* Get the value from a foo(<param_value>) style call */
       
  3706             if (IN_param_value == NULL)
       
  3707               IN_param_value = function_call_param_iterator.next();
       
  3708             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3709             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3710             
       
  3711             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  3712             {
       
  3713         
       
  3714                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  3715                 s4o.print("(");
       
  3716                 return_type_symbol->accept(*this);
       
  3717                 s4o.print(")");
       
  3718                 IN_param_value->accept(*this);
       
  3719                 return NULL;
       
  3720                 
       
  3721             }
       
  3722             
       
  3723             ERROR;
       
  3724         }
       
  3725         
       
  3726     }/*function_usint_to_udint*/
       
  3727     break;
       
  3728 
       
  3729 /****
       
  3730  *USINT_TO_ULINT
       
  3731  */
       
  3732     case function_usint_to_ulint :
       
  3733     {
       
  3734         symbol_c *last_type_symbol = NULL;
       
  3735 
       
  3736         {
       
  3737             identifier_c param_name("IN");
       
  3738             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3739             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3740             
       
  3741             /* Get the value from a foo(<param_value>) style call */
       
  3742             if (IN_param_value == NULL)
       
  3743               IN_param_value = function_call_param_iterator.next();
       
  3744             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3745             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3746             
       
  3747             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  3748             {
       
  3749         
       
  3750                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  3751                 s4o.print("(");
       
  3752                 return_type_symbol->accept(*this);
       
  3753                 s4o.print(")");
       
  3754                 IN_param_value->accept(*this);
       
  3755                 return NULL;
       
  3756                 
       
  3757             }
       
  3758             
       
  3759             ERROR;
       
  3760         }
       
  3761         
       
  3762     }/*function_usint_to_ulint*/
       
  3763     break;
       
  3764 
       
  3765 /****
       
  3766  *USINT_TO_REAL
       
  3767  */
       
  3768     case function_usint_to_real :
       
  3769     {
       
  3770         symbol_c *last_type_symbol = NULL;
       
  3771 
       
  3772         {
       
  3773             identifier_c param_name("IN");
       
  3774             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3775             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3776             
       
  3777             /* Get the value from a foo(<param_value>) style call */
       
  3778             if (IN_param_value == NULL)
       
  3779               IN_param_value = function_call_param_iterator.next();
       
  3780             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3781             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3782             
       
  3783             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  3784             {
       
  3785         
       
  3786                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  3787                 s4o.print("(");
       
  3788                 return_type_symbol->accept(*this);
       
  3789                 s4o.print(")");
       
  3790                 IN_param_value->accept(*this);
       
  3791                 return NULL;
       
  3792                 
       
  3793             }
       
  3794             
       
  3795             ERROR;
       
  3796         }
       
  3797         
       
  3798     }/*function_usint_to_real*/
       
  3799     break;
       
  3800 
       
  3801 /****
       
  3802  *USINT_TO_LREAL
       
  3803  */
       
  3804     case function_usint_to_lreal :
       
  3805     {
       
  3806         symbol_c *last_type_symbol = NULL;
       
  3807 
       
  3808         {
       
  3809             identifier_c param_name("IN");
       
  3810             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3811             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3812             
       
  3813             /* Get the value from a foo(<param_value>) style call */
       
  3814             if (IN_param_value == NULL)
       
  3815               IN_param_value = function_call_param_iterator.next();
       
  3816             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3817             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3818             
       
  3819             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  3820             {
       
  3821         
       
  3822                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  3823                 s4o.print("(");
       
  3824                 return_type_symbol->accept(*this);
       
  3825                 s4o.print(")");
       
  3826                 IN_param_value->accept(*this);
       
  3827                 return NULL;
       
  3828                 
       
  3829             }
       
  3830             
       
  3831             ERROR;
       
  3832         }
       
  3833         
       
  3834     }/*function_usint_to_lreal*/
       
  3835     break;
       
  3836 
       
  3837 /****
       
  3838  *USINT_TO_TIME
       
  3839  */
       
  3840     case function_usint_to_time :
       
  3841     {
       
  3842         symbol_c *last_type_symbol = NULL;
       
  3843 
       
  3844         {
       
  3845             identifier_c param_name("IN");
       
  3846             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3847             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3848             
       
  3849             /* Get the value from a foo(<param_value>) style call */
       
  3850             if (IN_param_value == NULL)
       
  3851               IN_param_value = function_call_param_iterator.next();
       
  3852             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3853             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3854             
       
  3855             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  3856             {
       
  3857         
       
  3858                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  3859                 s4o.print("(");
       
  3860                 return_type_symbol->accept(*this);
       
  3861                 s4o.print(")__int_to_time(");
       
  3862                 IN_param_value->accept(*this);
       
  3863                 s4o.print(")");
       
  3864                 return NULL;
       
  3865                 
       
  3866             }
       
  3867             
       
  3868             ERROR;
       
  3869         }
       
  3870         
       
  3871     }/*function_usint_to_time*/
       
  3872     break;
       
  3873 
       
  3874 /****
       
  3875  *USINT_TO_DATE
       
  3876  */
       
  3877     case function_usint_to_date :
       
  3878     {
       
  3879         symbol_c *last_type_symbol = NULL;
       
  3880 
       
  3881         {
       
  3882             identifier_c param_name("IN");
       
  3883             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3884             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3885             
       
  3886             /* Get the value from a foo(<param_value>) style call */
       
  3887             if (IN_param_value == NULL)
       
  3888               IN_param_value = function_call_param_iterator.next();
       
  3889             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3890             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3891             
       
  3892             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  3893             {
       
  3894         
       
  3895                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  3896                 s4o.print("(");
       
  3897                 return_type_symbol->accept(*this);
       
  3898                 s4o.print(")__int_to_time(");
       
  3899                 IN_param_value->accept(*this);
       
  3900                 s4o.print(")");
       
  3901                 return NULL;
       
  3902                 
       
  3903             }
       
  3904             
       
  3905             ERROR;
       
  3906         }
       
  3907         
       
  3908     }/*function_usint_to_date*/
       
  3909     break;
       
  3910 
       
  3911 /****
       
  3912  *USINT_TO_TOD
       
  3913  */
       
  3914     case function_usint_to_tod :
       
  3915     {
       
  3916         symbol_c *last_type_symbol = NULL;
       
  3917 
       
  3918         {
       
  3919             identifier_c param_name("IN");
       
  3920             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3921             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3922             
       
  3923             /* Get the value from a foo(<param_value>) style call */
       
  3924             if (IN_param_value == NULL)
       
  3925               IN_param_value = function_call_param_iterator.next();
       
  3926             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3927             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3928             
       
  3929             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  3930             {
       
  3931         
       
  3932                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  3933                 s4o.print("(");
       
  3934                 return_type_symbol->accept(*this);
       
  3935                 s4o.print(")__int_to_time(");
       
  3936                 IN_param_value->accept(*this);
       
  3937                 s4o.print(")");
       
  3938                 return NULL;
       
  3939                 
       
  3940             }
       
  3941             
       
  3942             ERROR;
       
  3943         }
       
  3944         
       
  3945     }/*function_usint_to_tod*/
       
  3946     break;
       
  3947 
       
  3948 /****
       
  3949  *USINT_TO_DT
       
  3950  */
       
  3951     case function_usint_to_dt :
       
  3952     {
       
  3953         symbol_c *last_type_symbol = NULL;
       
  3954 
       
  3955         {
       
  3956             identifier_c param_name("IN");
       
  3957             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3958             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3959             
       
  3960             /* Get the value from a foo(<param_value>) style call */
       
  3961             if (IN_param_value == NULL)
       
  3962               IN_param_value = function_call_param_iterator.next();
       
  3963             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3964             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3965             
       
  3966             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  3967             {
       
  3968         
       
  3969                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  3970                 s4o.print("(");
       
  3971                 return_type_symbol->accept(*this);
       
  3972                 s4o.print(")__int_to_time(");
       
  3973                 IN_param_value->accept(*this);
       
  3974                 s4o.print(")");
       
  3975                 return NULL;
       
  3976                 
       
  3977             }
       
  3978             
       
  3979             ERROR;
       
  3980         }
       
  3981         
       
  3982     }/*function_usint_to_dt*/
       
  3983     break;
       
  3984 
       
  3985 /****
       
  3986  *USINT_TO_STRING
       
  3987  */
       
  3988     case function_usint_to_string :
       
  3989     {
       
  3990         symbol_c *last_type_symbol = NULL;
       
  3991 
       
  3992         {
       
  3993             identifier_c param_name("IN");
       
  3994             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3995             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3996             
       
  3997             /* Get the value from a foo(<param_value>) style call */
       
  3998             if (IN_param_value == NULL)
       
  3999               IN_param_value = function_call_param_iterator.next();
       
  4000             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4001             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4002             
       
  4003             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  4004             {
       
  4005         
       
  4006                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  4007                 s4o.print("(");
       
  4008                 return_type_symbol->accept(*this);
       
  4009                 s4o.print(")__uint_to_string(");
       
  4010                 IN_param_value->accept(*this);
       
  4011                 s4o.print(")");
       
  4012                 return NULL;
       
  4013                 
       
  4014             }
       
  4015             
       
  4016             ERROR;
       
  4017         }
       
  4018         
       
  4019     }/*function_usint_to_string*/
       
  4020     break;
       
  4021 
       
  4022 /****
       
  4023  *USINT_TO_BYTE
       
  4024  */
       
  4025     case function_usint_to_byte :
       
  4026     {
       
  4027         symbol_c *last_type_symbol = NULL;
       
  4028 
       
  4029         {
       
  4030             identifier_c param_name("IN");
       
  4031             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4032             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4033             
       
  4034             /* Get the value from a foo(<param_value>) style call */
       
  4035             if (IN_param_value == NULL)
       
  4036               IN_param_value = function_call_param_iterator.next();
       
  4037             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4038             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4039             
       
  4040             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  4041             {
       
  4042         
       
  4043                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  4044                 s4o.print("(");
       
  4045                 return_type_symbol->accept(*this);
       
  4046                 s4o.print(")");
       
  4047                 IN_param_value->accept(*this);
       
  4048                 return NULL;
       
  4049                 
       
  4050             }
       
  4051             
       
  4052             ERROR;
       
  4053         }
       
  4054         
       
  4055     }/*function_usint_to_byte*/
       
  4056     break;
       
  4057 
       
  4058 /****
       
  4059  *USINT_TO_WORD
       
  4060  */
       
  4061     case function_usint_to_word :
       
  4062     {
       
  4063         symbol_c *last_type_symbol = NULL;
       
  4064 
       
  4065         {
       
  4066             identifier_c param_name("IN");
       
  4067             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4068             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4069             
       
  4070             /* Get the value from a foo(<param_value>) style call */
       
  4071             if (IN_param_value == NULL)
       
  4072               IN_param_value = function_call_param_iterator.next();
       
  4073             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4074             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4075             
       
  4076             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  4077             {
       
  4078         
       
  4079                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  4080                 s4o.print("(");
       
  4081                 return_type_symbol->accept(*this);
       
  4082                 s4o.print(")");
       
  4083                 IN_param_value->accept(*this);
       
  4084                 return NULL;
       
  4085                 
       
  4086             }
       
  4087             
       
  4088             ERROR;
       
  4089         }
       
  4090         
       
  4091     }/*function_usint_to_word*/
       
  4092     break;
       
  4093 
       
  4094 /****
       
  4095  *USINT_TO_DWORD
       
  4096  */
       
  4097     case function_usint_to_dword :
       
  4098     {
       
  4099         symbol_c *last_type_symbol = NULL;
       
  4100 
       
  4101         {
       
  4102             identifier_c param_name("IN");
       
  4103             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4104             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4105             
       
  4106             /* Get the value from a foo(<param_value>) style call */
       
  4107             if (IN_param_value == NULL)
       
  4108               IN_param_value = function_call_param_iterator.next();
       
  4109             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4110             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4111             
       
  4112             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  4113             {
       
  4114         
       
  4115                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  4116                 s4o.print("(");
       
  4117                 return_type_symbol->accept(*this);
       
  4118                 s4o.print(")");
       
  4119                 IN_param_value->accept(*this);
       
  4120                 return NULL;
       
  4121                 
       
  4122             }
       
  4123             
       
  4124             ERROR;
       
  4125         }
       
  4126         
       
  4127     }/*function_usint_to_dword*/
       
  4128     break;
       
  4129 
       
  4130 /****
       
  4131  *USINT_TO_LWORD
       
  4132  */
       
  4133     case function_usint_to_lword :
       
  4134     {
       
  4135         symbol_c *last_type_symbol = NULL;
       
  4136 
       
  4137         {
       
  4138             identifier_c param_name("IN");
       
  4139             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4140             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4141             
       
  4142             /* Get the value from a foo(<param_value>) style call */
       
  4143             if (IN_param_value == NULL)
       
  4144               IN_param_value = function_call_param_iterator.next();
       
  4145             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4146             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4147             
       
  4148             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
  4149             {
       
  4150         
       
  4151                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  4152                 s4o.print("(");
       
  4153                 return_type_symbol->accept(*this);
       
  4154                 s4o.print(")");
       
  4155                 IN_param_value->accept(*this);
       
  4156                 return NULL;
       
  4157                 
       
  4158             }
       
  4159             
       
  4160             ERROR;
       
  4161         }
       
  4162         
       
  4163     }/*function_usint_to_lword*/
       
  4164     break;
       
  4165 
       
  4166 /****
       
  4167  *UINT_TO_BOOL
       
  4168  */
       
  4169     case function_uint_to_bool :
       
  4170     {
       
  4171         symbol_c *last_type_symbol = NULL;
       
  4172 
       
  4173         {
       
  4174             identifier_c param_name("IN");
       
  4175             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4176             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4177             
       
  4178             /* Get the value from a foo(<param_value>) style call */
       
  4179             if (IN_param_value == NULL)
       
  4180               IN_param_value = function_call_param_iterator.next();
       
  4181             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4182             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4183             
       
  4184             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4185             {
       
  4186         
       
  4187                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  4188                 s4o.print("(");
       
  4189                 return_type_symbol->accept(*this);
       
  4190                 s4o.print(")");
       
  4191                 IN_param_value->accept(*this);
       
  4192                 return NULL;
       
  4193                 
       
  4194             }
       
  4195             
       
  4196             ERROR;
       
  4197         }
       
  4198         
       
  4199     }/*function_uint_to_bool*/
       
  4200     break;
       
  4201 
       
  4202 /****
       
  4203  *UINT_TO_SINT
       
  4204  */
       
  4205     case function_uint_to_sint :
       
  4206     {
       
  4207         symbol_c *last_type_symbol = NULL;
       
  4208 
       
  4209         {
       
  4210             identifier_c param_name("IN");
       
  4211             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4212             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4213             
       
  4214             /* Get the value from a foo(<param_value>) style call */
       
  4215             if (IN_param_value == NULL)
       
  4216               IN_param_value = function_call_param_iterator.next();
       
  4217             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4218             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4219             
       
  4220             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4221             {
       
  4222         
       
  4223                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  4224                 s4o.print("(");
       
  4225                 return_type_symbol->accept(*this);
       
  4226                 s4o.print(")");
       
  4227                 IN_param_value->accept(*this);
       
  4228                 return NULL;
       
  4229                 
       
  4230             }
       
  4231             
       
  4232             ERROR;
       
  4233         }
       
  4234         
       
  4235     }/*function_uint_to_sint*/
       
  4236     break;
       
  4237 
       
  4238 /****
       
  4239  *UINT_TO_INT
       
  4240  */
       
  4241     case function_uint_to_int :
       
  4242     {
       
  4243         symbol_c *last_type_symbol = NULL;
       
  4244 
       
  4245         {
       
  4246             identifier_c param_name("IN");
       
  4247             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4248             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4249             
       
  4250             /* Get the value from a foo(<param_value>) style call */
       
  4251             if (IN_param_value == NULL)
       
  4252               IN_param_value = function_call_param_iterator.next();
       
  4253             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4254             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4255             
       
  4256             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4257             {
       
  4258         
       
  4259                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  4260                 s4o.print("(");
       
  4261                 return_type_symbol->accept(*this);
       
  4262                 s4o.print(")");
       
  4263                 IN_param_value->accept(*this);
       
  4264                 return NULL;
       
  4265                 
       
  4266             }
       
  4267             
       
  4268             ERROR;
       
  4269         }
       
  4270         
       
  4271     }/*function_uint_to_int*/
       
  4272     break;
       
  4273 
       
  4274 /****
       
  4275  *UINT_TO_DINT
       
  4276  */
       
  4277     case function_uint_to_dint :
       
  4278     {
       
  4279         symbol_c *last_type_symbol = NULL;
       
  4280 
       
  4281         {
       
  4282             identifier_c param_name("IN");
       
  4283             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4284             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4285             
       
  4286             /* Get the value from a foo(<param_value>) style call */
       
  4287             if (IN_param_value == NULL)
       
  4288               IN_param_value = function_call_param_iterator.next();
       
  4289             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4290             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4291             
       
  4292             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4293             {
       
  4294         
       
  4295                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  4296                 s4o.print("(");
       
  4297                 return_type_symbol->accept(*this);
       
  4298                 s4o.print(")");
       
  4299                 IN_param_value->accept(*this);
       
  4300                 return NULL;
       
  4301                 
       
  4302             }
       
  4303             
       
  4304             ERROR;
       
  4305         }
       
  4306         
       
  4307     }/*function_uint_to_dint*/
       
  4308     break;
       
  4309 
       
  4310 /****
       
  4311  *UINT_TO_LINT
       
  4312  */
       
  4313     case function_uint_to_lint :
       
  4314     {
       
  4315         symbol_c *last_type_symbol = NULL;
       
  4316 
       
  4317         {
       
  4318             identifier_c param_name("IN");
       
  4319             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4320             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4321             
       
  4322             /* Get the value from a foo(<param_value>) style call */
       
  4323             if (IN_param_value == NULL)
       
  4324               IN_param_value = function_call_param_iterator.next();
       
  4325             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4326             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4327             
       
  4328             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4329             {
       
  4330         
       
  4331                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  4332                 s4o.print("(");
       
  4333                 return_type_symbol->accept(*this);
       
  4334                 s4o.print(")");
       
  4335                 IN_param_value->accept(*this);
       
  4336                 return NULL;
       
  4337                 
       
  4338             }
       
  4339             
       
  4340             ERROR;
       
  4341         }
       
  4342         
       
  4343     }/*function_uint_to_lint*/
       
  4344     break;
       
  4345 
       
  4346 /****
       
  4347  *UINT_TO_USINT
       
  4348  */
       
  4349     case function_uint_to_usint :
       
  4350     {
       
  4351         symbol_c *last_type_symbol = NULL;
       
  4352 
       
  4353         {
       
  4354             identifier_c param_name("IN");
       
  4355             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4356             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4357             
       
  4358             /* Get the value from a foo(<param_value>) style call */
       
  4359             if (IN_param_value == NULL)
       
  4360               IN_param_value = function_call_param_iterator.next();
       
  4361             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4362             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4363             
       
  4364             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4365             {
       
  4366         
       
  4367                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  4368                 s4o.print("(");
       
  4369                 return_type_symbol->accept(*this);
       
  4370                 s4o.print(")");
       
  4371                 IN_param_value->accept(*this);
       
  4372                 return NULL;
       
  4373                 
       
  4374             }
       
  4375             
       
  4376             ERROR;
       
  4377         }
       
  4378         
       
  4379     }/*function_uint_to_usint*/
       
  4380     break;
       
  4381 
       
  4382 /****
       
  4383  *UINT_TO_UDINT
       
  4384  */
       
  4385     case function_uint_to_udint :
       
  4386     {
       
  4387         symbol_c *last_type_symbol = NULL;
       
  4388 
       
  4389         {
       
  4390             identifier_c param_name("IN");
       
  4391             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4392             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4393             
       
  4394             /* Get the value from a foo(<param_value>) style call */
       
  4395             if (IN_param_value == NULL)
       
  4396               IN_param_value = function_call_param_iterator.next();
       
  4397             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4398             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4399             
       
  4400             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4401             {
       
  4402         
       
  4403                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  4404                 s4o.print("(");
       
  4405                 return_type_symbol->accept(*this);
       
  4406                 s4o.print(")");
       
  4407                 IN_param_value->accept(*this);
       
  4408                 return NULL;
       
  4409                 
       
  4410             }
       
  4411             
       
  4412             ERROR;
       
  4413         }
       
  4414         
       
  4415     }/*function_uint_to_udint*/
       
  4416     break;
       
  4417 
       
  4418 /****
       
  4419  *UINT_TO_ULINT
       
  4420  */
       
  4421     case function_uint_to_ulint :
       
  4422     {
       
  4423         symbol_c *last_type_symbol = NULL;
       
  4424 
       
  4425         {
       
  4426             identifier_c param_name("IN");
       
  4427             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4428             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4429             
       
  4430             /* Get the value from a foo(<param_value>) style call */
       
  4431             if (IN_param_value == NULL)
       
  4432               IN_param_value = function_call_param_iterator.next();
       
  4433             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4434             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4435             
       
  4436             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4437             {
       
  4438         
       
  4439                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  4440                 s4o.print("(");
       
  4441                 return_type_symbol->accept(*this);
       
  4442                 s4o.print(")");
       
  4443                 IN_param_value->accept(*this);
       
  4444                 return NULL;
       
  4445                 
       
  4446             }
       
  4447             
       
  4448             ERROR;
       
  4449         }
       
  4450         
       
  4451     }/*function_uint_to_ulint*/
       
  4452     break;
       
  4453 
       
  4454 /****
       
  4455  *UINT_TO_REAL
       
  4456  */
       
  4457     case function_uint_to_real :
       
  4458     {
       
  4459         symbol_c *last_type_symbol = NULL;
       
  4460 
       
  4461         {
       
  4462             identifier_c param_name("IN");
       
  4463             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4464             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4465             
       
  4466             /* Get the value from a foo(<param_value>) style call */
       
  4467             if (IN_param_value == NULL)
       
  4468               IN_param_value = function_call_param_iterator.next();
       
  4469             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4470             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4471             
       
  4472             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4473             {
       
  4474         
       
  4475                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  4476                 s4o.print("(");
       
  4477                 return_type_symbol->accept(*this);
       
  4478                 s4o.print(")");
       
  4479                 IN_param_value->accept(*this);
       
  4480                 return NULL;
       
  4481                 
       
  4482             }
       
  4483             
       
  4484             ERROR;
       
  4485         }
       
  4486         
       
  4487     }/*function_uint_to_real*/
       
  4488     break;
       
  4489 
       
  4490 /****
       
  4491  *UINT_TO_LREAL
       
  4492  */
       
  4493     case function_uint_to_lreal :
       
  4494     {
       
  4495         symbol_c *last_type_symbol = NULL;
       
  4496 
       
  4497         {
       
  4498             identifier_c param_name("IN");
       
  4499             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4500             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4501             
       
  4502             /* Get the value from a foo(<param_value>) style call */
       
  4503             if (IN_param_value == NULL)
       
  4504               IN_param_value = function_call_param_iterator.next();
       
  4505             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4506             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4507             
       
  4508             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4509             {
       
  4510         
       
  4511                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  4512                 s4o.print("(");
       
  4513                 return_type_symbol->accept(*this);
       
  4514                 s4o.print(")");
       
  4515                 IN_param_value->accept(*this);
       
  4516                 return NULL;
       
  4517                 
       
  4518             }
       
  4519             
       
  4520             ERROR;
       
  4521         }
       
  4522         
       
  4523     }/*function_uint_to_lreal*/
       
  4524     break;
       
  4525 
       
  4526 /****
       
  4527  *UINT_TO_TIME
       
  4528  */
       
  4529     case function_uint_to_time :
       
  4530     {
       
  4531         symbol_c *last_type_symbol = NULL;
       
  4532 
       
  4533         {
       
  4534             identifier_c param_name("IN");
       
  4535             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4536             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4537             
       
  4538             /* Get the value from a foo(<param_value>) style call */
       
  4539             if (IN_param_value == NULL)
       
  4540               IN_param_value = function_call_param_iterator.next();
       
  4541             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4542             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4543             
       
  4544             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4545             {
       
  4546         
       
  4547                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  4548                 s4o.print("(");
       
  4549                 return_type_symbol->accept(*this);
       
  4550                 s4o.print(")__int_to_time(");
       
  4551                 IN_param_value->accept(*this);
       
  4552                 s4o.print(")");
       
  4553                 return NULL;
       
  4554                 
       
  4555             }
       
  4556             
       
  4557             ERROR;
       
  4558         }
       
  4559         
       
  4560     }/*function_uint_to_time*/
       
  4561     break;
       
  4562 
       
  4563 /****
       
  4564  *UINT_TO_DATE
       
  4565  */
       
  4566     case function_uint_to_date :
       
  4567     {
       
  4568         symbol_c *last_type_symbol = NULL;
       
  4569 
       
  4570         {
       
  4571             identifier_c param_name("IN");
       
  4572             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4573             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4574             
       
  4575             /* Get the value from a foo(<param_value>) style call */
       
  4576             if (IN_param_value == NULL)
       
  4577               IN_param_value = function_call_param_iterator.next();
       
  4578             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4579             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4580             
       
  4581             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4582             {
       
  4583         
       
  4584                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  4585                 s4o.print("(");
       
  4586                 return_type_symbol->accept(*this);
       
  4587                 s4o.print(")__int_to_time(");
       
  4588                 IN_param_value->accept(*this);
       
  4589                 s4o.print(")");
       
  4590                 return NULL;
       
  4591                 
       
  4592             }
       
  4593             
       
  4594             ERROR;
       
  4595         }
       
  4596         
       
  4597     }/*function_uint_to_date*/
       
  4598     break;
       
  4599 
       
  4600 /****
       
  4601  *UINT_TO_TOD
       
  4602  */
       
  4603     case function_uint_to_tod :
       
  4604     {
       
  4605         symbol_c *last_type_symbol = NULL;
       
  4606 
       
  4607         {
       
  4608             identifier_c param_name("IN");
       
  4609             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4610             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4611             
       
  4612             /* Get the value from a foo(<param_value>) style call */
       
  4613             if (IN_param_value == NULL)
       
  4614               IN_param_value = function_call_param_iterator.next();
       
  4615             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4616             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4617             
       
  4618             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4619             {
       
  4620         
       
  4621                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  4622                 s4o.print("(");
       
  4623                 return_type_symbol->accept(*this);
       
  4624                 s4o.print(")__int_to_time(");
       
  4625                 IN_param_value->accept(*this);
       
  4626                 s4o.print(")");
       
  4627                 return NULL;
       
  4628                 
       
  4629             }
       
  4630             
       
  4631             ERROR;
       
  4632         }
       
  4633         
       
  4634     }/*function_uint_to_tod*/
       
  4635     break;
       
  4636 
       
  4637 /****
       
  4638  *UINT_TO_DT
       
  4639  */
       
  4640     case function_uint_to_dt :
       
  4641     {
       
  4642         symbol_c *last_type_symbol = NULL;
       
  4643 
       
  4644         {
       
  4645             identifier_c param_name("IN");
       
  4646             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4647             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4648             
       
  4649             /* Get the value from a foo(<param_value>) style call */
       
  4650             if (IN_param_value == NULL)
       
  4651               IN_param_value = function_call_param_iterator.next();
       
  4652             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4653             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4654             
       
  4655             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4656             {
       
  4657         
       
  4658                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  4659                 s4o.print("(");
       
  4660                 return_type_symbol->accept(*this);
       
  4661                 s4o.print(")__int_to_time(");
       
  4662                 IN_param_value->accept(*this);
       
  4663                 s4o.print(")");
       
  4664                 return NULL;
       
  4665                 
       
  4666             }
       
  4667             
       
  4668             ERROR;
       
  4669         }
       
  4670         
       
  4671     }/*function_uint_to_dt*/
       
  4672     break;
       
  4673 
       
  4674 /****
       
  4675  *UINT_TO_STRING
       
  4676  */
       
  4677     case function_uint_to_string :
       
  4678     {
       
  4679         symbol_c *last_type_symbol = NULL;
       
  4680 
       
  4681         {
       
  4682             identifier_c param_name("IN");
       
  4683             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4684             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4685             
       
  4686             /* Get the value from a foo(<param_value>) style call */
       
  4687             if (IN_param_value == NULL)
       
  4688               IN_param_value = function_call_param_iterator.next();
       
  4689             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4690             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4691             
       
  4692             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4693             {
       
  4694         
       
  4695                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  4696                 s4o.print("(");
       
  4697                 return_type_symbol->accept(*this);
       
  4698                 s4o.print(")__uint_to_string(");
       
  4699                 IN_param_value->accept(*this);
       
  4700                 s4o.print(")");
       
  4701                 return NULL;
       
  4702                 
       
  4703             }
       
  4704             
       
  4705             ERROR;
       
  4706         }
       
  4707         
       
  4708     }/*function_uint_to_string*/
       
  4709     break;
       
  4710 
       
  4711 /****
       
  4712  *UINT_TO_BYTE
       
  4713  */
       
  4714     case function_uint_to_byte :
       
  4715     {
       
  4716         symbol_c *last_type_symbol = NULL;
       
  4717 
       
  4718         {
       
  4719             identifier_c param_name("IN");
       
  4720             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4721             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4722             
       
  4723             /* Get the value from a foo(<param_value>) style call */
       
  4724             if (IN_param_value == NULL)
       
  4725               IN_param_value = function_call_param_iterator.next();
       
  4726             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4727             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4728             
       
  4729             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4730             {
       
  4731         
       
  4732                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  4733                 s4o.print("(");
       
  4734                 return_type_symbol->accept(*this);
       
  4735                 s4o.print(")");
       
  4736                 IN_param_value->accept(*this);
       
  4737                 return NULL;
       
  4738                 
       
  4739             }
       
  4740             
       
  4741             ERROR;
       
  4742         }
       
  4743         
       
  4744     }/*function_uint_to_byte*/
       
  4745     break;
       
  4746 
       
  4747 /****
       
  4748  *UINT_TO_WORD
       
  4749  */
       
  4750     case function_uint_to_word :
       
  4751     {
       
  4752         symbol_c *last_type_symbol = NULL;
       
  4753 
       
  4754         {
       
  4755             identifier_c param_name("IN");
       
  4756             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4757             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4758             
       
  4759             /* Get the value from a foo(<param_value>) style call */
       
  4760             if (IN_param_value == NULL)
       
  4761               IN_param_value = function_call_param_iterator.next();
       
  4762             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4763             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4764             
       
  4765             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4766             {
       
  4767         
       
  4768                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  4769                 s4o.print("(");
       
  4770                 return_type_symbol->accept(*this);
       
  4771                 s4o.print(")");
       
  4772                 IN_param_value->accept(*this);
       
  4773                 return NULL;
       
  4774                 
       
  4775             }
       
  4776             
       
  4777             ERROR;
       
  4778         }
       
  4779         
       
  4780     }/*function_uint_to_word*/
       
  4781     break;
       
  4782 
       
  4783 /****
       
  4784  *UINT_TO_DWORD
       
  4785  */
       
  4786     case function_uint_to_dword :
       
  4787     {
       
  4788         symbol_c *last_type_symbol = NULL;
       
  4789 
       
  4790         {
       
  4791             identifier_c param_name("IN");
       
  4792             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4793             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4794             
       
  4795             /* Get the value from a foo(<param_value>) style call */
       
  4796             if (IN_param_value == NULL)
       
  4797               IN_param_value = function_call_param_iterator.next();
       
  4798             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4799             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4800             
       
  4801             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4802             {
       
  4803         
       
  4804                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  4805                 s4o.print("(");
       
  4806                 return_type_symbol->accept(*this);
       
  4807                 s4o.print(")");
       
  4808                 IN_param_value->accept(*this);
       
  4809                 return NULL;
       
  4810                 
       
  4811             }
       
  4812             
       
  4813             ERROR;
       
  4814         }
       
  4815         
       
  4816     }/*function_uint_to_dword*/
       
  4817     break;
       
  4818 
       
  4819 /****
       
  4820  *UINT_TO_LWORD
       
  4821  */
       
  4822     case function_uint_to_lword :
       
  4823     {
       
  4824         symbol_c *last_type_symbol = NULL;
       
  4825 
       
  4826         {
       
  4827             identifier_c param_name("IN");
       
  4828             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4829             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4830             
       
  4831             /* Get the value from a foo(<param_value>) style call */
       
  4832             if (IN_param_value == NULL)
       
  4833               IN_param_value = function_call_param_iterator.next();
       
  4834             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4835             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4836             
       
  4837             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
  4838             {
       
  4839         
       
  4840                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  4841                 s4o.print("(");
       
  4842                 return_type_symbol->accept(*this);
       
  4843                 s4o.print(")");
       
  4844                 IN_param_value->accept(*this);
       
  4845                 return NULL;
       
  4846                 
       
  4847             }
       
  4848             
       
  4849             ERROR;
       
  4850         }
       
  4851         
       
  4852     }/*function_uint_to_lword*/
       
  4853     break;
       
  4854 
       
  4855 /****
       
  4856  *UDINT_TO_BOOL
       
  4857  */
       
  4858     case function_udint_to_bool :
       
  4859     {
       
  4860         symbol_c *last_type_symbol = NULL;
       
  4861 
       
  4862         {
       
  4863             identifier_c param_name("IN");
       
  4864             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4865             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4866             
       
  4867             /* Get the value from a foo(<param_value>) style call */
       
  4868             if (IN_param_value == NULL)
       
  4869               IN_param_value = function_call_param_iterator.next();
       
  4870             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4871             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4872             
       
  4873             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  4874             {
       
  4875         
       
  4876                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  4877                 s4o.print("(");
       
  4878                 return_type_symbol->accept(*this);
       
  4879                 s4o.print(")");
       
  4880                 IN_param_value->accept(*this);
       
  4881                 return NULL;
       
  4882                 
       
  4883             }
       
  4884             
       
  4885             ERROR;
       
  4886         }
       
  4887         
       
  4888     }/*function_udint_to_bool*/
       
  4889     break;
       
  4890 
       
  4891 /****
       
  4892  *UDINT_TO_SINT
       
  4893  */
       
  4894     case function_udint_to_sint :
       
  4895     {
       
  4896         symbol_c *last_type_symbol = NULL;
       
  4897 
       
  4898         {
       
  4899             identifier_c param_name("IN");
       
  4900             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4901             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4902             
       
  4903             /* Get the value from a foo(<param_value>) style call */
       
  4904             if (IN_param_value == NULL)
       
  4905               IN_param_value = function_call_param_iterator.next();
       
  4906             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4907             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4908             
       
  4909             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  4910             {
       
  4911         
       
  4912                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  4913                 s4o.print("(");
       
  4914                 return_type_symbol->accept(*this);
       
  4915                 s4o.print(")");
       
  4916                 IN_param_value->accept(*this);
       
  4917                 return NULL;
       
  4918                 
       
  4919             }
       
  4920             
       
  4921             ERROR;
       
  4922         }
       
  4923         
       
  4924     }/*function_udint_to_sint*/
       
  4925     break;
       
  4926 
       
  4927 /****
       
  4928  *UDINT_TO_INT
       
  4929  */
       
  4930     case function_udint_to_int :
       
  4931     {
       
  4932         symbol_c *last_type_symbol = NULL;
       
  4933 
       
  4934         {
       
  4935             identifier_c param_name("IN");
       
  4936             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4937             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4938             
       
  4939             /* Get the value from a foo(<param_value>) style call */
       
  4940             if (IN_param_value == NULL)
       
  4941               IN_param_value = function_call_param_iterator.next();
       
  4942             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4943             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4944             
       
  4945             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  4946             {
       
  4947         
       
  4948                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  4949                 s4o.print("(");
       
  4950                 return_type_symbol->accept(*this);
       
  4951                 s4o.print(")");
       
  4952                 IN_param_value->accept(*this);
       
  4953                 return NULL;
       
  4954                 
       
  4955             }
       
  4956             
       
  4957             ERROR;
       
  4958         }
       
  4959         
       
  4960     }/*function_udint_to_int*/
       
  4961     break;
       
  4962 
       
  4963 /****
       
  4964  *UDINT_TO_DINT
       
  4965  */
       
  4966     case function_udint_to_dint :
       
  4967     {
       
  4968         symbol_c *last_type_symbol = NULL;
       
  4969 
       
  4970         {
       
  4971             identifier_c param_name("IN");
       
  4972             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4973             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4974             
       
  4975             /* Get the value from a foo(<param_value>) style call */
       
  4976             if (IN_param_value == NULL)
       
  4977               IN_param_value = function_call_param_iterator.next();
       
  4978             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4979             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4980             
       
  4981             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  4982             {
       
  4983         
       
  4984                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  4985                 s4o.print("(");
       
  4986                 return_type_symbol->accept(*this);
       
  4987                 s4o.print(")");
       
  4988                 IN_param_value->accept(*this);
       
  4989                 return NULL;
       
  4990                 
       
  4991             }
       
  4992             
       
  4993             ERROR;
       
  4994         }
       
  4995         
       
  4996     }/*function_udint_to_dint*/
       
  4997     break;
       
  4998 
       
  4999 /****
       
  5000  *UDINT_TO_LINT
       
  5001  */
       
  5002     case function_udint_to_lint :
       
  5003     {
       
  5004         symbol_c *last_type_symbol = NULL;
       
  5005 
       
  5006         {
       
  5007             identifier_c param_name("IN");
       
  5008             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5009             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5010             
       
  5011             /* Get the value from a foo(<param_value>) style call */
       
  5012             if (IN_param_value == NULL)
       
  5013               IN_param_value = function_call_param_iterator.next();
       
  5014             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5015             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5016             
       
  5017             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5018             {
       
  5019         
       
  5020                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  5021                 s4o.print("(");
       
  5022                 return_type_symbol->accept(*this);
       
  5023                 s4o.print(")");
       
  5024                 IN_param_value->accept(*this);
       
  5025                 return NULL;
       
  5026                 
       
  5027             }
       
  5028             
       
  5029             ERROR;
       
  5030         }
       
  5031         
       
  5032     }/*function_udint_to_lint*/
       
  5033     break;
       
  5034 
       
  5035 /****
       
  5036  *UDINT_TO_USINT
       
  5037  */
       
  5038     case function_udint_to_usint :
       
  5039     {
       
  5040         symbol_c *last_type_symbol = NULL;
       
  5041 
       
  5042         {
       
  5043             identifier_c param_name("IN");
       
  5044             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5045             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5046             
       
  5047             /* Get the value from a foo(<param_value>) style call */
       
  5048             if (IN_param_value == NULL)
       
  5049               IN_param_value = function_call_param_iterator.next();
       
  5050             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5051             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5052             
       
  5053             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5054             {
       
  5055         
       
  5056                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  5057                 s4o.print("(");
       
  5058                 return_type_symbol->accept(*this);
       
  5059                 s4o.print(")");
       
  5060                 IN_param_value->accept(*this);
       
  5061                 return NULL;
       
  5062                 
       
  5063             }
       
  5064             
       
  5065             ERROR;
       
  5066         }
       
  5067         
       
  5068     }/*function_udint_to_usint*/
       
  5069     break;
       
  5070 
       
  5071 /****
       
  5072  *UDINT_TO_UINT
       
  5073  */
       
  5074     case function_udint_to_uint :
       
  5075     {
       
  5076         symbol_c *last_type_symbol = NULL;
       
  5077 
       
  5078         {
       
  5079             identifier_c param_name("IN");
       
  5080             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5081             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5082             
       
  5083             /* Get the value from a foo(<param_value>) style call */
       
  5084             if (IN_param_value == NULL)
       
  5085               IN_param_value = function_call_param_iterator.next();
       
  5086             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5087             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5088             
       
  5089             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5090             {
       
  5091         
       
  5092                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  5093                 s4o.print("(");
       
  5094                 return_type_symbol->accept(*this);
       
  5095                 s4o.print(")");
       
  5096                 IN_param_value->accept(*this);
       
  5097                 return NULL;
       
  5098                 
       
  5099             }
       
  5100             
       
  5101             ERROR;
       
  5102         }
       
  5103         
       
  5104     }/*function_udint_to_uint*/
       
  5105     break;
       
  5106 
       
  5107 /****
       
  5108  *UDINT_TO_ULINT
       
  5109  */
       
  5110     case function_udint_to_ulint :
       
  5111     {
       
  5112         symbol_c *last_type_symbol = NULL;
       
  5113 
       
  5114         {
       
  5115             identifier_c param_name("IN");
       
  5116             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5117             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5118             
       
  5119             /* Get the value from a foo(<param_value>) style call */
       
  5120             if (IN_param_value == NULL)
       
  5121               IN_param_value = function_call_param_iterator.next();
       
  5122             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5123             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5124             
       
  5125             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5126             {
       
  5127         
       
  5128                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  5129                 s4o.print("(");
       
  5130                 return_type_symbol->accept(*this);
       
  5131                 s4o.print(")");
       
  5132                 IN_param_value->accept(*this);
       
  5133                 return NULL;
       
  5134                 
       
  5135             }
       
  5136             
       
  5137             ERROR;
       
  5138         }
       
  5139         
       
  5140     }/*function_udint_to_ulint*/
       
  5141     break;
       
  5142 
       
  5143 /****
       
  5144  *UDINT_TO_REAL
       
  5145  */
       
  5146     case function_udint_to_real :
       
  5147     {
       
  5148         symbol_c *last_type_symbol = NULL;
       
  5149 
       
  5150         {
       
  5151             identifier_c param_name("IN");
       
  5152             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5153             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5154             
       
  5155             /* Get the value from a foo(<param_value>) style call */
       
  5156             if (IN_param_value == NULL)
       
  5157               IN_param_value = function_call_param_iterator.next();
       
  5158             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5159             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5160             
       
  5161             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5162             {
       
  5163         
       
  5164                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  5165                 s4o.print("(");
       
  5166                 return_type_symbol->accept(*this);
       
  5167                 s4o.print(")");
       
  5168                 IN_param_value->accept(*this);
       
  5169                 return NULL;
       
  5170                 
       
  5171             }
       
  5172             
       
  5173             ERROR;
       
  5174         }
       
  5175         
       
  5176     }/*function_udint_to_real*/
       
  5177     break;
       
  5178 
       
  5179 /****
       
  5180  *UDINT_TO_LREAL
       
  5181  */
       
  5182     case function_udint_to_lreal :
       
  5183     {
       
  5184         symbol_c *last_type_symbol = NULL;
       
  5185 
       
  5186         {
       
  5187             identifier_c param_name("IN");
       
  5188             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5189             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5190             
       
  5191             /* Get the value from a foo(<param_value>) style call */
       
  5192             if (IN_param_value == NULL)
       
  5193               IN_param_value = function_call_param_iterator.next();
       
  5194             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5195             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5196             
       
  5197             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5198             {
       
  5199         
       
  5200                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  5201                 s4o.print("(");
       
  5202                 return_type_symbol->accept(*this);
       
  5203                 s4o.print(")");
       
  5204                 IN_param_value->accept(*this);
       
  5205                 return NULL;
       
  5206                 
       
  5207             }
       
  5208             
       
  5209             ERROR;
       
  5210         }
       
  5211         
       
  5212     }/*function_udint_to_lreal*/
       
  5213     break;
       
  5214 
       
  5215 /****
       
  5216  *UDINT_TO_TIME
       
  5217  */
       
  5218     case function_udint_to_time :
       
  5219     {
       
  5220         symbol_c *last_type_symbol = NULL;
       
  5221 
       
  5222         {
       
  5223             identifier_c param_name("IN");
       
  5224             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5225             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5226             
       
  5227             /* Get the value from a foo(<param_value>) style call */
       
  5228             if (IN_param_value == NULL)
       
  5229               IN_param_value = function_call_param_iterator.next();
       
  5230             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5231             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5232             
       
  5233             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5234             {
       
  5235         
       
  5236                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  5237                 s4o.print("(");
       
  5238                 return_type_symbol->accept(*this);
       
  5239                 s4o.print(")__int_to_time(");
       
  5240                 IN_param_value->accept(*this);
       
  5241                 s4o.print(")");
       
  5242                 return NULL;
       
  5243                 
       
  5244             }
       
  5245             
       
  5246             ERROR;
       
  5247         }
       
  5248         
       
  5249     }/*function_udint_to_time*/
       
  5250     break;
       
  5251 
       
  5252 /****
       
  5253  *UDINT_TO_DATE
       
  5254  */
       
  5255     case function_udint_to_date :
       
  5256     {
       
  5257         symbol_c *last_type_symbol = NULL;
       
  5258 
       
  5259         {
       
  5260             identifier_c param_name("IN");
       
  5261             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5262             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5263             
       
  5264             /* Get the value from a foo(<param_value>) style call */
       
  5265             if (IN_param_value == NULL)
       
  5266               IN_param_value = function_call_param_iterator.next();
       
  5267             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5268             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5269             
       
  5270             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5271             {
       
  5272         
       
  5273                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  5274                 s4o.print("(");
       
  5275                 return_type_symbol->accept(*this);
       
  5276                 s4o.print(")__int_to_time(");
       
  5277                 IN_param_value->accept(*this);
       
  5278                 s4o.print(")");
       
  5279                 return NULL;
       
  5280                 
       
  5281             }
       
  5282             
       
  5283             ERROR;
       
  5284         }
       
  5285         
       
  5286     }/*function_udint_to_date*/
       
  5287     break;
       
  5288 
       
  5289 /****
       
  5290  *UDINT_TO_TOD
       
  5291  */
       
  5292     case function_udint_to_tod :
       
  5293     {
       
  5294         symbol_c *last_type_symbol = NULL;
       
  5295 
       
  5296         {
       
  5297             identifier_c param_name("IN");
       
  5298             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5299             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5300             
       
  5301             /* Get the value from a foo(<param_value>) style call */
       
  5302             if (IN_param_value == NULL)
       
  5303               IN_param_value = function_call_param_iterator.next();
       
  5304             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5305             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5306             
       
  5307             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5308             {
       
  5309         
       
  5310                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  5311                 s4o.print("(");
       
  5312                 return_type_symbol->accept(*this);
       
  5313                 s4o.print(")__int_to_time(");
       
  5314                 IN_param_value->accept(*this);
       
  5315                 s4o.print(")");
       
  5316                 return NULL;
       
  5317                 
       
  5318             }
       
  5319             
       
  5320             ERROR;
       
  5321         }
       
  5322         
       
  5323     }/*function_udint_to_tod*/
       
  5324     break;
       
  5325 
       
  5326 /****
       
  5327  *UDINT_TO_DT
       
  5328  */
       
  5329     case function_udint_to_dt :
       
  5330     {
       
  5331         symbol_c *last_type_symbol = NULL;
       
  5332 
       
  5333         {
       
  5334             identifier_c param_name("IN");
       
  5335             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5336             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5337             
       
  5338             /* Get the value from a foo(<param_value>) style call */
       
  5339             if (IN_param_value == NULL)
       
  5340               IN_param_value = function_call_param_iterator.next();
       
  5341             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5342             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5343             
       
  5344             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5345             {
       
  5346         
       
  5347                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  5348                 s4o.print("(");
       
  5349                 return_type_symbol->accept(*this);
       
  5350                 s4o.print(")__int_to_time(");
       
  5351                 IN_param_value->accept(*this);
       
  5352                 s4o.print(")");
       
  5353                 return NULL;
       
  5354                 
       
  5355             }
       
  5356             
       
  5357             ERROR;
       
  5358         }
       
  5359         
       
  5360     }/*function_udint_to_dt*/
       
  5361     break;
       
  5362 
       
  5363 /****
       
  5364  *UDINT_TO_STRING
       
  5365  */
       
  5366     case function_udint_to_string :
       
  5367     {
       
  5368         symbol_c *last_type_symbol = NULL;
       
  5369 
       
  5370         {
       
  5371             identifier_c param_name("IN");
       
  5372             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5373             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5374             
       
  5375             /* Get the value from a foo(<param_value>) style call */
       
  5376             if (IN_param_value == NULL)
       
  5377               IN_param_value = function_call_param_iterator.next();
       
  5378             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5379             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5380             
       
  5381             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5382             {
       
  5383         
       
  5384                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  5385                 s4o.print("(");
       
  5386                 return_type_symbol->accept(*this);
       
  5387                 s4o.print(")__uint_to_string(");
       
  5388                 IN_param_value->accept(*this);
       
  5389                 s4o.print(")");
       
  5390                 return NULL;
       
  5391                 
       
  5392             }
       
  5393             
       
  5394             ERROR;
       
  5395         }
       
  5396         
       
  5397     }/*function_udint_to_string*/
       
  5398     break;
       
  5399 
       
  5400 /****
       
  5401  *UDINT_TO_BYTE
       
  5402  */
       
  5403     case function_udint_to_byte :
       
  5404     {
       
  5405         symbol_c *last_type_symbol = NULL;
       
  5406 
       
  5407         {
       
  5408             identifier_c param_name("IN");
       
  5409             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5410             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5411             
       
  5412             /* Get the value from a foo(<param_value>) style call */
       
  5413             if (IN_param_value == NULL)
       
  5414               IN_param_value = function_call_param_iterator.next();
       
  5415             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5416             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5417             
       
  5418             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5419             {
       
  5420         
       
  5421                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  5422                 s4o.print("(");
       
  5423                 return_type_symbol->accept(*this);
       
  5424                 s4o.print(")");
       
  5425                 IN_param_value->accept(*this);
       
  5426                 return NULL;
       
  5427                 
       
  5428             }
       
  5429             
       
  5430             ERROR;
       
  5431         }
       
  5432         
       
  5433     }/*function_udint_to_byte*/
       
  5434     break;
       
  5435 
       
  5436 /****
       
  5437  *UDINT_TO_WORD
       
  5438  */
       
  5439     case function_udint_to_word :
       
  5440     {
       
  5441         symbol_c *last_type_symbol = NULL;
       
  5442 
       
  5443         {
       
  5444             identifier_c param_name("IN");
       
  5445             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5446             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5447             
       
  5448             /* Get the value from a foo(<param_value>) style call */
       
  5449             if (IN_param_value == NULL)
       
  5450               IN_param_value = function_call_param_iterator.next();
       
  5451             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5452             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5453             
       
  5454             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5455             {
       
  5456         
       
  5457                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  5458                 s4o.print("(");
       
  5459                 return_type_symbol->accept(*this);
       
  5460                 s4o.print(")");
       
  5461                 IN_param_value->accept(*this);
       
  5462                 return NULL;
       
  5463                 
       
  5464             }
       
  5465             
       
  5466             ERROR;
       
  5467         }
       
  5468         
       
  5469     }/*function_udint_to_word*/
       
  5470     break;
       
  5471 
       
  5472 /****
       
  5473  *UDINT_TO_DWORD
       
  5474  */
       
  5475     case function_udint_to_dword :
       
  5476     {
       
  5477         symbol_c *last_type_symbol = NULL;
       
  5478 
       
  5479         {
       
  5480             identifier_c param_name("IN");
       
  5481             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5482             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5483             
       
  5484             /* Get the value from a foo(<param_value>) style call */
       
  5485             if (IN_param_value == NULL)
       
  5486               IN_param_value = function_call_param_iterator.next();
       
  5487             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5488             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5489             
       
  5490             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5491             {
       
  5492         
       
  5493                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  5494                 s4o.print("(");
       
  5495                 return_type_symbol->accept(*this);
       
  5496                 s4o.print(")");
       
  5497                 IN_param_value->accept(*this);
       
  5498                 return NULL;
       
  5499                 
       
  5500             }
       
  5501             
       
  5502             ERROR;
       
  5503         }
       
  5504         
       
  5505     }/*function_udint_to_dword*/
       
  5506     break;
       
  5507 
       
  5508 /****
       
  5509  *UDINT_TO_LWORD
       
  5510  */
       
  5511     case function_udint_to_lword :
       
  5512     {
       
  5513         symbol_c *last_type_symbol = NULL;
       
  5514 
       
  5515         {
       
  5516             identifier_c param_name("IN");
       
  5517             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5518             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5519             
       
  5520             /* Get the value from a foo(<param_value>) style call */
       
  5521             if (IN_param_value == NULL)
       
  5522               IN_param_value = function_call_param_iterator.next();
       
  5523             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5524             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5525             
       
  5526             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
  5527             {
       
  5528         
       
  5529                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  5530                 s4o.print("(");
       
  5531                 return_type_symbol->accept(*this);
       
  5532                 s4o.print(")");
       
  5533                 IN_param_value->accept(*this);
       
  5534                 return NULL;
       
  5535                 
       
  5536             }
       
  5537             
       
  5538             ERROR;
       
  5539         }
       
  5540         
       
  5541     }/*function_udint_to_lword*/
       
  5542     break;
       
  5543 
       
  5544 /****
       
  5545  *ULINT_TO_BOOL
       
  5546  */
       
  5547     case function_ulint_to_bool :
       
  5548     {
       
  5549         symbol_c *last_type_symbol = NULL;
       
  5550 
       
  5551         {
       
  5552             identifier_c param_name("IN");
       
  5553             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5554             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5555             
       
  5556             /* Get the value from a foo(<param_value>) style call */
       
  5557             if (IN_param_value == NULL)
       
  5558               IN_param_value = function_call_param_iterator.next();
       
  5559             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5560             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5561             
       
  5562             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  5563             {
       
  5564         
       
  5565                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  5566                 s4o.print("(");
       
  5567                 return_type_symbol->accept(*this);
       
  5568                 s4o.print(")");
       
  5569                 IN_param_value->accept(*this);
       
  5570                 return NULL;
       
  5571                 
       
  5572             }
       
  5573             
       
  5574             ERROR;
       
  5575         }
       
  5576         
       
  5577     }/*function_ulint_to_bool*/
       
  5578     break;
       
  5579 
       
  5580 /****
       
  5581  *ULINT_TO_SINT
       
  5582  */
       
  5583     case function_ulint_to_sint :
       
  5584     {
       
  5585         symbol_c *last_type_symbol = NULL;
       
  5586 
       
  5587         {
       
  5588             identifier_c param_name("IN");
       
  5589             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5590             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5591             
       
  5592             /* Get the value from a foo(<param_value>) style call */
       
  5593             if (IN_param_value == NULL)
       
  5594               IN_param_value = function_call_param_iterator.next();
       
  5595             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5596             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5597             
       
  5598             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  5599             {
       
  5600         
       
  5601                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  5602                 s4o.print("(");
       
  5603                 return_type_symbol->accept(*this);
       
  5604                 s4o.print(")");
       
  5605                 IN_param_value->accept(*this);
       
  5606                 return NULL;
       
  5607                 
       
  5608             }
       
  5609             
       
  5610             ERROR;
       
  5611         }
       
  5612         
       
  5613     }/*function_ulint_to_sint*/
       
  5614     break;
       
  5615 
       
  5616 /****
       
  5617  *ULINT_TO_INT
       
  5618  */
       
  5619     case function_ulint_to_int :
       
  5620     {
       
  5621         symbol_c *last_type_symbol = NULL;
       
  5622 
       
  5623         {
       
  5624             identifier_c param_name("IN");
       
  5625             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5626             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5627             
       
  5628             /* Get the value from a foo(<param_value>) style call */
       
  5629             if (IN_param_value == NULL)
       
  5630               IN_param_value = function_call_param_iterator.next();
       
  5631             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5632             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5633             
       
  5634             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  5635             {
       
  5636         
       
  5637                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  5638                 s4o.print("(");
       
  5639                 return_type_symbol->accept(*this);
       
  5640                 s4o.print(")");
       
  5641                 IN_param_value->accept(*this);
       
  5642                 return NULL;
       
  5643                 
       
  5644             }
       
  5645             
       
  5646             ERROR;
       
  5647         }
       
  5648         
       
  5649     }/*function_ulint_to_int*/
       
  5650     break;
       
  5651 
       
  5652 /****
       
  5653  *ULINT_TO_DINT
       
  5654  */
       
  5655     case function_ulint_to_dint :
       
  5656     {
       
  5657         symbol_c *last_type_symbol = NULL;
       
  5658 
       
  5659         {
       
  5660             identifier_c param_name("IN");
       
  5661             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5662             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5663             
       
  5664             /* Get the value from a foo(<param_value>) style call */
       
  5665             if (IN_param_value == NULL)
       
  5666               IN_param_value = function_call_param_iterator.next();
       
  5667             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5668             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5669             
       
  5670             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  5671             {
       
  5672         
       
  5673                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  5674                 s4o.print("(");
       
  5675                 return_type_symbol->accept(*this);
       
  5676                 s4o.print(")");
       
  5677                 IN_param_value->accept(*this);
       
  5678                 return NULL;
       
  5679                 
       
  5680             }
       
  5681             
       
  5682             ERROR;
       
  5683         }
       
  5684         
       
  5685     }/*function_ulint_to_dint*/
       
  5686     break;
       
  5687 
       
  5688 /****
       
  5689  *ULINT_TO_LINT
       
  5690  */
       
  5691     case function_ulint_to_lint :
       
  5692     {
       
  5693         symbol_c *last_type_symbol = NULL;
       
  5694 
       
  5695         {
       
  5696             identifier_c param_name("IN");
       
  5697             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5698             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5699             
       
  5700             /* Get the value from a foo(<param_value>) style call */
       
  5701             if (IN_param_value == NULL)
       
  5702               IN_param_value = function_call_param_iterator.next();
       
  5703             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5704             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5705             
       
  5706             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  5707             {
       
  5708         
       
  5709                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  5710                 s4o.print("(");
       
  5711                 return_type_symbol->accept(*this);
       
  5712                 s4o.print(")");
       
  5713                 IN_param_value->accept(*this);
       
  5714                 return NULL;
       
  5715                 
       
  5716             }
       
  5717             
       
  5718             ERROR;
       
  5719         }
       
  5720         
       
  5721     }/*function_ulint_to_lint*/
       
  5722     break;
       
  5723 
       
  5724 /****
       
  5725  *ULINT_TO_USINT
       
  5726  */
       
  5727     case function_ulint_to_usint :
       
  5728     {
       
  5729         symbol_c *last_type_symbol = NULL;
       
  5730 
       
  5731         {
       
  5732             identifier_c param_name("IN");
       
  5733             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5734             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5735             
       
  5736             /* Get the value from a foo(<param_value>) style call */
       
  5737             if (IN_param_value == NULL)
       
  5738               IN_param_value = function_call_param_iterator.next();
       
  5739             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5740             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5741             
       
  5742             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  5743             {
       
  5744         
       
  5745                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  5746                 s4o.print("(");
       
  5747                 return_type_symbol->accept(*this);
       
  5748                 s4o.print(")");
       
  5749                 IN_param_value->accept(*this);
       
  5750                 return NULL;
       
  5751                 
       
  5752             }
       
  5753             
       
  5754             ERROR;
       
  5755         }
       
  5756         
       
  5757     }/*function_ulint_to_usint*/
       
  5758     break;
       
  5759 
       
  5760 /****
       
  5761  *ULINT_TO_UINT
       
  5762  */
       
  5763     case function_ulint_to_uint :
       
  5764     {
       
  5765         symbol_c *last_type_symbol = NULL;
       
  5766 
       
  5767         {
       
  5768             identifier_c param_name("IN");
       
  5769             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5770             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5771             
       
  5772             /* Get the value from a foo(<param_value>) style call */
       
  5773             if (IN_param_value == NULL)
       
  5774               IN_param_value = function_call_param_iterator.next();
       
  5775             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5776             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5777             
       
  5778             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  5779             {
       
  5780         
       
  5781                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  5782                 s4o.print("(");
       
  5783                 return_type_symbol->accept(*this);
       
  5784                 s4o.print(")");
       
  5785                 IN_param_value->accept(*this);
       
  5786                 return NULL;
       
  5787                 
       
  5788             }
       
  5789             
       
  5790             ERROR;
       
  5791         }
       
  5792         
       
  5793     }/*function_ulint_to_uint*/
       
  5794     break;
       
  5795 
       
  5796 /****
       
  5797  *ULINT_TO_UDINT
       
  5798  */
       
  5799     case function_ulint_to_udint :
       
  5800     {
       
  5801         symbol_c *last_type_symbol = NULL;
       
  5802 
       
  5803         {
       
  5804             identifier_c param_name("IN");
       
  5805             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5806             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5807             
       
  5808             /* Get the value from a foo(<param_value>) style call */
       
  5809             if (IN_param_value == NULL)
       
  5810               IN_param_value = function_call_param_iterator.next();
       
  5811             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5812             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5813             
       
  5814             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  5815             {
       
  5816         
       
  5817                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  5818                 s4o.print("(");
       
  5819                 return_type_symbol->accept(*this);
       
  5820                 s4o.print(")");
       
  5821                 IN_param_value->accept(*this);
       
  5822                 return NULL;
       
  5823                 
       
  5824             }
       
  5825             
       
  5826             ERROR;
       
  5827         }
       
  5828         
       
  5829     }/*function_ulint_to_udint*/
       
  5830     break;
       
  5831 
       
  5832 /****
       
  5833  *ULINT_TO_REAL
       
  5834  */
       
  5835     case function_ulint_to_real :
       
  5836     {
       
  5837         symbol_c *last_type_symbol = NULL;
       
  5838 
       
  5839         {
       
  5840             identifier_c param_name("IN");
       
  5841             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5842             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5843             
       
  5844             /* Get the value from a foo(<param_value>) style call */
       
  5845             if (IN_param_value == NULL)
       
  5846               IN_param_value = function_call_param_iterator.next();
       
  5847             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5848             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5849             
       
  5850             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  5851             {
       
  5852         
       
  5853                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  5854                 s4o.print("(");
       
  5855                 return_type_symbol->accept(*this);
       
  5856                 s4o.print(")");
       
  5857                 IN_param_value->accept(*this);
       
  5858                 return NULL;
       
  5859                 
       
  5860             }
       
  5861             
       
  5862             ERROR;
       
  5863         }
       
  5864         
       
  5865     }/*function_ulint_to_real*/
       
  5866     break;
       
  5867 
       
  5868 /****
       
  5869  *ULINT_TO_LREAL
       
  5870  */
       
  5871     case function_ulint_to_lreal :
       
  5872     {
       
  5873         symbol_c *last_type_symbol = NULL;
       
  5874 
       
  5875         {
       
  5876             identifier_c param_name("IN");
       
  5877             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5878             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5879             
       
  5880             /* Get the value from a foo(<param_value>) style call */
       
  5881             if (IN_param_value == NULL)
       
  5882               IN_param_value = function_call_param_iterator.next();
       
  5883             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5884             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5885             
       
  5886             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  5887             {
       
  5888         
       
  5889                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  5890                 s4o.print("(");
       
  5891                 return_type_symbol->accept(*this);
       
  5892                 s4o.print(")");
       
  5893                 IN_param_value->accept(*this);
       
  5894                 return NULL;
       
  5895                 
       
  5896             }
       
  5897             
       
  5898             ERROR;
       
  5899         }
       
  5900         
       
  5901     }/*function_ulint_to_lreal*/
       
  5902     break;
       
  5903 
       
  5904 /****
       
  5905  *ULINT_TO_TIME
       
  5906  */
       
  5907     case function_ulint_to_time :
       
  5908     {
       
  5909         symbol_c *last_type_symbol = NULL;
       
  5910 
       
  5911         {
       
  5912             identifier_c param_name("IN");
       
  5913             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5914             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5915             
       
  5916             /* Get the value from a foo(<param_value>) style call */
       
  5917             if (IN_param_value == NULL)
       
  5918               IN_param_value = function_call_param_iterator.next();
       
  5919             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5920             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5921             
       
  5922             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  5923             {
       
  5924         
       
  5925                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  5926                 s4o.print("(");
       
  5927                 return_type_symbol->accept(*this);
       
  5928                 s4o.print(")__int_to_time(");
       
  5929                 IN_param_value->accept(*this);
       
  5930                 s4o.print(")");
       
  5931                 return NULL;
       
  5932                 
       
  5933             }
       
  5934             
       
  5935             ERROR;
       
  5936         }
       
  5937         
       
  5938     }/*function_ulint_to_time*/
       
  5939     break;
       
  5940 
       
  5941 /****
       
  5942  *ULINT_TO_DATE
       
  5943  */
       
  5944     case function_ulint_to_date :
       
  5945     {
       
  5946         symbol_c *last_type_symbol = NULL;
       
  5947 
       
  5948         {
       
  5949             identifier_c param_name("IN");
       
  5950             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5951             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5952             
       
  5953             /* Get the value from a foo(<param_value>) style call */
       
  5954             if (IN_param_value == NULL)
       
  5955               IN_param_value = function_call_param_iterator.next();
       
  5956             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5957             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5958             
       
  5959             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  5960             {
       
  5961         
       
  5962                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  5963                 s4o.print("(");
       
  5964                 return_type_symbol->accept(*this);
       
  5965                 s4o.print(")__int_to_time(");
       
  5966                 IN_param_value->accept(*this);
       
  5967                 s4o.print(")");
       
  5968                 return NULL;
       
  5969                 
       
  5970             }
       
  5971             
       
  5972             ERROR;
       
  5973         }
       
  5974         
       
  5975     }/*function_ulint_to_date*/
       
  5976     break;
       
  5977 
       
  5978 /****
       
  5979  *ULINT_TO_TOD
       
  5980  */
       
  5981     case function_ulint_to_tod :
       
  5982     {
       
  5983         symbol_c *last_type_symbol = NULL;
       
  5984 
       
  5985         {
       
  5986             identifier_c param_name("IN");
       
  5987             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5988             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5989             
       
  5990             /* Get the value from a foo(<param_value>) style call */
       
  5991             if (IN_param_value == NULL)
       
  5992               IN_param_value = function_call_param_iterator.next();
       
  5993             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5994             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5995             
       
  5996             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  5997             {
       
  5998         
       
  5999                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  6000                 s4o.print("(");
       
  6001                 return_type_symbol->accept(*this);
       
  6002                 s4o.print(")__int_to_time(");
       
  6003                 IN_param_value->accept(*this);
       
  6004                 s4o.print(")");
       
  6005                 return NULL;
       
  6006                 
       
  6007             }
       
  6008             
       
  6009             ERROR;
       
  6010         }
       
  6011         
       
  6012     }/*function_ulint_to_tod*/
       
  6013     break;
       
  6014 
       
  6015 /****
       
  6016  *ULINT_TO_DT
       
  6017  */
       
  6018     case function_ulint_to_dt :
       
  6019     {
       
  6020         symbol_c *last_type_symbol = NULL;
       
  6021 
       
  6022         {
       
  6023             identifier_c param_name("IN");
       
  6024             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6025             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6026             
       
  6027             /* Get the value from a foo(<param_value>) style call */
       
  6028             if (IN_param_value == NULL)
       
  6029               IN_param_value = function_call_param_iterator.next();
       
  6030             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6031             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6032             
       
  6033             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  6034             {
       
  6035         
       
  6036                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  6037                 s4o.print("(");
       
  6038                 return_type_symbol->accept(*this);
       
  6039                 s4o.print(")__int_to_time(");
       
  6040                 IN_param_value->accept(*this);
       
  6041                 s4o.print(")");
       
  6042                 return NULL;
       
  6043                 
       
  6044             }
       
  6045             
       
  6046             ERROR;
       
  6047         }
       
  6048         
       
  6049     }/*function_ulint_to_dt*/
       
  6050     break;
       
  6051 
       
  6052 /****
       
  6053  *ULINT_TO_STRING
       
  6054  */
       
  6055     case function_ulint_to_string :
       
  6056     {
       
  6057         symbol_c *last_type_symbol = NULL;
       
  6058 
       
  6059         {
       
  6060             identifier_c param_name("IN");
       
  6061             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6062             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6063             
       
  6064             /* Get the value from a foo(<param_value>) style call */
       
  6065             if (IN_param_value == NULL)
       
  6066               IN_param_value = function_call_param_iterator.next();
       
  6067             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6068             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6069             
       
  6070             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  6071             {
       
  6072         
       
  6073                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  6074                 s4o.print("(");
       
  6075                 return_type_symbol->accept(*this);
       
  6076                 s4o.print(")__uint_to_string(");
       
  6077                 IN_param_value->accept(*this);
       
  6078                 s4o.print(")");
       
  6079                 return NULL;
       
  6080                 
       
  6081             }
       
  6082             
       
  6083             ERROR;
       
  6084         }
       
  6085         
       
  6086     }/*function_ulint_to_string*/
       
  6087     break;
       
  6088 
       
  6089 /****
       
  6090  *ULINT_TO_BYTE
       
  6091  */
       
  6092     case function_ulint_to_byte :
       
  6093     {
       
  6094         symbol_c *last_type_symbol = NULL;
       
  6095 
       
  6096         {
       
  6097             identifier_c param_name("IN");
       
  6098             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6099             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6100             
       
  6101             /* Get the value from a foo(<param_value>) style call */
       
  6102             if (IN_param_value == NULL)
       
  6103               IN_param_value = function_call_param_iterator.next();
       
  6104             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6105             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6106             
       
  6107             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  6108             {
       
  6109         
       
  6110                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  6111                 s4o.print("(");
       
  6112                 return_type_symbol->accept(*this);
       
  6113                 s4o.print(")");
       
  6114                 IN_param_value->accept(*this);
       
  6115                 return NULL;
       
  6116                 
       
  6117             }
       
  6118             
       
  6119             ERROR;
       
  6120         }
       
  6121         
       
  6122     }/*function_ulint_to_byte*/
       
  6123     break;
       
  6124 
       
  6125 /****
       
  6126  *ULINT_TO_WORD
       
  6127  */
       
  6128     case function_ulint_to_word :
       
  6129     {
       
  6130         symbol_c *last_type_symbol = NULL;
       
  6131 
       
  6132         {
       
  6133             identifier_c param_name("IN");
       
  6134             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6135             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6136             
       
  6137             /* Get the value from a foo(<param_value>) style call */
       
  6138             if (IN_param_value == NULL)
       
  6139               IN_param_value = function_call_param_iterator.next();
       
  6140             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6141             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6142             
       
  6143             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  6144             {
       
  6145         
       
  6146                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  6147                 s4o.print("(");
       
  6148                 return_type_symbol->accept(*this);
       
  6149                 s4o.print(")");
       
  6150                 IN_param_value->accept(*this);
       
  6151                 return NULL;
       
  6152                 
       
  6153             }
       
  6154             
       
  6155             ERROR;
       
  6156         }
       
  6157         
       
  6158     }/*function_ulint_to_word*/
       
  6159     break;
       
  6160 
       
  6161 /****
       
  6162  *ULINT_TO_DWORD
       
  6163  */
       
  6164     case function_ulint_to_dword :
       
  6165     {
       
  6166         symbol_c *last_type_symbol = NULL;
       
  6167 
       
  6168         {
       
  6169             identifier_c param_name("IN");
       
  6170             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6171             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6172             
       
  6173             /* Get the value from a foo(<param_value>) style call */
       
  6174             if (IN_param_value == NULL)
       
  6175               IN_param_value = function_call_param_iterator.next();
       
  6176             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6177             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6178             
       
  6179             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  6180             {
       
  6181         
       
  6182                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  6183                 s4o.print("(");
       
  6184                 return_type_symbol->accept(*this);
       
  6185                 s4o.print(")");
       
  6186                 IN_param_value->accept(*this);
       
  6187                 return NULL;
       
  6188                 
       
  6189             }
       
  6190             
       
  6191             ERROR;
       
  6192         }
       
  6193         
       
  6194     }/*function_ulint_to_dword*/
       
  6195     break;
       
  6196 
       
  6197 /****
       
  6198  *ULINT_TO_LWORD
       
  6199  */
       
  6200     case function_ulint_to_lword :
       
  6201     {
       
  6202         symbol_c *last_type_symbol = NULL;
       
  6203 
       
  6204         {
       
  6205             identifier_c param_name("IN");
       
  6206             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6207             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6208             
       
  6209             /* Get the value from a foo(<param_value>) style call */
       
  6210             if (IN_param_value == NULL)
       
  6211               IN_param_value = function_call_param_iterator.next();
       
  6212             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6213             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6214             
       
  6215             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
  6216             {
       
  6217         
       
  6218                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  6219                 s4o.print("(");
       
  6220                 return_type_symbol->accept(*this);
       
  6221                 s4o.print(")");
       
  6222                 IN_param_value->accept(*this);
       
  6223                 return NULL;
       
  6224                 
       
  6225             }
       
  6226             
       
  6227             ERROR;
       
  6228         }
       
  6229         
       
  6230     }/*function_ulint_to_lword*/
       
  6231     break;
       
  6232 
       
  6233 /****
       
  6234  *REAL_TO_BOOL
       
  6235  */
       
  6236     case function_real_to_bool :
       
  6237     {
       
  6238         symbol_c *last_type_symbol = NULL;
       
  6239 
       
  6240         {
       
  6241             identifier_c param_name("IN");
       
  6242             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6243             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6244             
       
  6245             /* Get the value from a foo(<param_value>) style call */
       
  6246             if (IN_param_value == NULL)
       
  6247               IN_param_value = function_call_param_iterator.next();
       
  6248             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6249             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6250             
       
  6251             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6252             {
       
  6253         
       
  6254                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  6255                 s4o.print("(");
       
  6256                 return_type_symbol->accept(*this);
       
  6257                 s4o.print(")");
       
  6258                 IN_param_value->accept(*this);
       
  6259                 return NULL;
       
  6260                 
       
  6261             }
       
  6262             
       
  6263             ERROR;
       
  6264         }
       
  6265         
       
  6266     }/*function_real_to_bool*/
       
  6267     break;
       
  6268 
       
  6269 /****
       
  6270  *REAL_TO_SINT
       
  6271  */
       
  6272     case function_real_to_sint :
       
  6273     {
       
  6274         symbol_c *last_type_symbol = NULL;
       
  6275 
       
  6276         {
       
  6277             identifier_c param_name("IN");
       
  6278             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6279             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6280             
       
  6281             /* Get the value from a foo(<param_value>) style call */
       
  6282             if (IN_param_value == NULL)
       
  6283               IN_param_value = function_call_param_iterator.next();
       
  6284             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6285             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6286             
       
  6287             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6288             {
       
  6289         
       
  6290                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  6291                 s4o.print("(");
       
  6292                 return_type_symbol->accept(*this);
       
  6293                 s4o.print(")");
       
  6294                 IN_param_value->accept(*this);
       
  6295                 return NULL;
       
  6296                 
       
  6297             }
       
  6298             
       
  6299             ERROR;
       
  6300         }
       
  6301         
       
  6302     }/*function_real_to_sint*/
       
  6303     break;
       
  6304 
       
  6305 /****
       
  6306  *REAL_TO_INT
       
  6307  */
       
  6308     case function_real_to_int :
       
  6309     {
       
  6310         symbol_c *last_type_symbol = NULL;
       
  6311 
       
  6312         {
       
  6313             identifier_c param_name("IN");
       
  6314             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6315             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6316             
       
  6317             /* Get the value from a foo(<param_value>) style call */
       
  6318             if (IN_param_value == NULL)
       
  6319               IN_param_value = function_call_param_iterator.next();
       
  6320             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6321             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6322             
       
  6323             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6324             {
       
  6325         
       
  6326                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  6327                 s4o.print("(");
       
  6328                 return_type_symbol->accept(*this);
       
  6329                 s4o.print(")");
       
  6330                 IN_param_value->accept(*this);
       
  6331                 return NULL;
       
  6332                 
       
  6333             }
       
  6334             
       
  6335             ERROR;
       
  6336         }
       
  6337         
       
  6338     }/*function_real_to_int*/
       
  6339     break;
       
  6340 
       
  6341 /****
       
  6342  *REAL_TO_DINT
       
  6343  */
       
  6344     case function_real_to_dint :
       
  6345     {
       
  6346         symbol_c *last_type_symbol = NULL;
       
  6347 
       
  6348         {
       
  6349             identifier_c param_name("IN");
       
  6350             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6351             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6352             
       
  6353             /* Get the value from a foo(<param_value>) style call */
       
  6354             if (IN_param_value == NULL)
       
  6355               IN_param_value = function_call_param_iterator.next();
       
  6356             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6357             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6358             
       
  6359             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6360             {
       
  6361         
       
  6362                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  6363                 s4o.print("(");
       
  6364                 return_type_symbol->accept(*this);
       
  6365                 s4o.print(")");
       
  6366                 IN_param_value->accept(*this);
       
  6367                 return NULL;
       
  6368                 
       
  6369             }
       
  6370             
       
  6371             ERROR;
       
  6372         }
       
  6373         
       
  6374     }/*function_real_to_dint*/
       
  6375     break;
       
  6376 
       
  6377 /****
       
  6378  *REAL_TO_LINT
       
  6379  */
       
  6380     case function_real_to_lint :
       
  6381     {
       
  6382         symbol_c *last_type_symbol = NULL;
       
  6383 
       
  6384         {
       
  6385             identifier_c param_name("IN");
       
  6386             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6387             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6388             
       
  6389             /* Get the value from a foo(<param_value>) style call */
       
  6390             if (IN_param_value == NULL)
       
  6391               IN_param_value = function_call_param_iterator.next();
       
  6392             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6393             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6394             
       
  6395             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6396             {
       
  6397         
       
  6398                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  6399                 s4o.print("(");
       
  6400                 return_type_symbol->accept(*this);
       
  6401                 s4o.print(")");
       
  6402                 IN_param_value->accept(*this);
       
  6403                 return NULL;
       
  6404                 
       
  6405             }
       
  6406             
       
  6407             ERROR;
       
  6408         }
       
  6409         
       
  6410     }/*function_real_to_lint*/
       
  6411     break;
       
  6412 
       
  6413 /****
       
  6414  *REAL_TO_USINT
       
  6415  */
       
  6416     case function_real_to_usint :
       
  6417     {
       
  6418         symbol_c *last_type_symbol = NULL;
       
  6419 
       
  6420         {
       
  6421             identifier_c param_name("IN");
       
  6422             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6423             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6424             
       
  6425             /* Get the value from a foo(<param_value>) style call */
       
  6426             if (IN_param_value == NULL)
       
  6427               IN_param_value = function_call_param_iterator.next();
       
  6428             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6429             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6430             
       
  6431             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6432             {
       
  6433         
       
  6434                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  6435                 s4o.print("(");
       
  6436                 return_type_symbol->accept(*this);
       
  6437                 s4o.print(")");
       
  6438                 IN_param_value->accept(*this);
       
  6439                 return NULL;
       
  6440                 
       
  6441             }
       
  6442             
       
  6443             ERROR;
       
  6444         }
       
  6445         
       
  6446     }/*function_real_to_usint*/
       
  6447     break;
       
  6448 
       
  6449 /****
       
  6450  *REAL_TO_UINT
       
  6451  */
       
  6452     case function_real_to_uint :
       
  6453     {
       
  6454         symbol_c *last_type_symbol = NULL;
       
  6455 
       
  6456         {
       
  6457             identifier_c param_name("IN");
       
  6458             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6459             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6460             
       
  6461             /* Get the value from a foo(<param_value>) style call */
       
  6462             if (IN_param_value == NULL)
       
  6463               IN_param_value = function_call_param_iterator.next();
       
  6464             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6465             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6466             
       
  6467             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6468             {
       
  6469         
       
  6470                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  6471                 s4o.print("(");
       
  6472                 return_type_symbol->accept(*this);
       
  6473                 s4o.print(")");
       
  6474                 IN_param_value->accept(*this);
       
  6475                 return NULL;
       
  6476                 
       
  6477             }
       
  6478             
       
  6479             ERROR;
       
  6480         }
       
  6481         
       
  6482     }/*function_real_to_uint*/
       
  6483     break;
       
  6484 
       
  6485 /****
       
  6486  *REAL_TO_UDINT
       
  6487  */
       
  6488     case function_real_to_udint :
       
  6489     {
       
  6490         symbol_c *last_type_symbol = NULL;
       
  6491 
       
  6492         {
       
  6493             identifier_c param_name("IN");
       
  6494             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6495             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6496             
       
  6497             /* Get the value from a foo(<param_value>) style call */
       
  6498             if (IN_param_value == NULL)
       
  6499               IN_param_value = function_call_param_iterator.next();
       
  6500             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6501             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6502             
       
  6503             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6504             {
       
  6505         
       
  6506                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  6507                 s4o.print("(");
       
  6508                 return_type_symbol->accept(*this);
       
  6509                 s4o.print(")");
       
  6510                 IN_param_value->accept(*this);
       
  6511                 return NULL;
       
  6512                 
       
  6513             }
       
  6514             
       
  6515             ERROR;
       
  6516         }
       
  6517         
       
  6518     }/*function_real_to_udint*/
       
  6519     break;
       
  6520 
       
  6521 /****
       
  6522  *REAL_TO_ULINT
       
  6523  */
       
  6524     case function_real_to_ulint :
       
  6525     {
       
  6526         symbol_c *last_type_symbol = NULL;
       
  6527 
       
  6528         {
       
  6529             identifier_c param_name("IN");
       
  6530             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6531             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6532             
       
  6533             /* Get the value from a foo(<param_value>) style call */
       
  6534             if (IN_param_value == NULL)
       
  6535               IN_param_value = function_call_param_iterator.next();
       
  6536             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6537             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6538             
       
  6539             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6540             {
       
  6541         
       
  6542                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  6543                 s4o.print("(");
       
  6544                 return_type_symbol->accept(*this);
       
  6545                 s4o.print(")");
       
  6546                 IN_param_value->accept(*this);
       
  6547                 return NULL;
       
  6548                 
       
  6549             }
       
  6550             
       
  6551             ERROR;
       
  6552         }
       
  6553         
       
  6554     }/*function_real_to_ulint*/
       
  6555     break;
       
  6556 
       
  6557 /****
       
  6558  *REAL_TO_LREAL
       
  6559  */
       
  6560     case function_real_to_lreal :
       
  6561     {
       
  6562         symbol_c *last_type_symbol = NULL;
       
  6563 
       
  6564         {
       
  6565             identifier_c param_name("IN");
       
  6566             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6567             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6568             
       
  6569             /* Get the value from a foo(<param_value>) style call */
       
  6570             if (IN_param_value == NULL)
       
  6571               IN_param_value = function_call_param_iterator.next();
       
  6572             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6573             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6574             
       
  6575             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6576             {
       
  6577         
       
  6578                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  6579                 s4o.print("(");
       
  6580                 return_type_symbol->accept(*this);
       
  6581                 s4o.print(")");
       
  6582                 IN_param_value->accept(*this);
       
  6583                 return NULL;
       
  6584                 
       
  6585             }
       
  6586             
       
  6587             ERROR;
       
  6588         }
       
  6589         
       
  6590     }/*function_real_to_lreal*/
       
  6591     break;
       
  6592 
       
  6593 /****
       
  6594  *REAL_TO_TIME
       
  6595  */
       
  6596     case function_real_to_time :
       
  6597     {
       
  6598         symbol_c *last_type_symbol = NULL;
       
  6599 
       
  6600         {
       
  6601             identifier_c param_name("IN");
       
  6602             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6603             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6604             
       
  6605             /* Get the value from a foo(<param_value>) style call */
       
  6606             if (IN_param_value == NULL)
       
  6607               IN_param_value = function_call_param_iterator.next();
       
  6608             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6609             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6610             
       
  6611             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6612             {
       
  6613         
       
  6614                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  6615                 s4o.print("(");
       
  6616                 return_type_symbol->accept(*this);
       
  6617                 s4o.print(")__real_to_time(");
       
  6618                 IN_param_value->accept(*this);
       
  6619                 s4o.print(")");
       
  6620                 return NULL;
       
  6621                 
       
  6622             }
       
  6623             
       
  6624             ERROR;
       
  6625         }
       
  6626         
       
  6627     }/*function_real_to_time*/
       
  6628     break;
       
  6629 
       
  6630 /****
       
  6631  *REAL_TO_DATE
       
  6632  */
       
  6633     case function_real_to_date :
       
  6634     {
       
  6635         symbol_c *last_type_symbol = NULL;
       
  6636 
       
  6637         {
       
  6638             identifier_c param_name("IN");
       
  6639             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6640             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6641             
       
  6642             /* Get the value from a foo(<param_value>) style call */
       
  6643             if (IN_param_value == NULL)
       
  6644               IN_param_value = function_call_param_iterator.next();
       
  6645             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6646             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6647             
       
  6648             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6649             {
       
  6650         
       
  6651                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  6652                 s4o.print("(");
       
  6653                 return_type_symbol->accept(*this);
       
  6654                 s4o.print(")__real_to_time(");
       
  6655                 IN_param_value->accept(*this);
       
  6656                 s4o.print(")");
       
  6657                 return NULL;
       
  6658                 
       
  6659             }
       
  6660             
       
  6661             ERROR;
       
  6662         }
       
  6663         
       
  6664     }/*function_real_to_date*/
       
  6665     break;
       
  6666 
       
  6667 /****
       
  6668  *REAL_TO_TOD
       
  6669  */
       
  6670     case function_real_to_tod :
       
  6671     {
       
  6672         symbol_c *last_type_symbol = NULL;
       
  6673 
       
  6674         {
       
  6675             identifier_c param_name("IN");
       
  6676             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6677             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6678             
       
  6679             /* Get the value from a foo(<param_value>) style call */
       
  6680             if (IN_param_value == NULL)
       
  6681               IN_param_value = function_call_param_iterator.next();
       
  6682             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6683             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6684             
       
  6685             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6686             {
       
  6687         
       
  6688                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  6689                 s4o.print("(");
       
  6690                 return_type_symbol->accept(*this);
       
  6691                 s4o.print(")__real_to_time(");
       
  6692                 IN_param_value->accept(*this);
       
  6693                 s4o.print(")");
       
  6694                 return NULL;
       
  6695                 
       
  6696             }
       
  6697             
       
  6698             ERROR;
       
  6699         }
       
  6700         
       
  6701     }/*function_real_to_tod*/
       
  6702     break;
       
  6703 
       
  6704 /****
       
  6705  *REAL_TO_DT
       
  6706  */
       
  6707     case function_real_to_dt :
       
  6708     {
       
  6709         symbol_c *last_type_symbol = NULL;
       
  6710 
       
  6711         {
       
  6712             identifier_c param_name("IN");
       
  6713             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6714             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6715             
       
  6716             /* Get the value from a foo(<param_value>) style call */
       
  6717             if (IN_param_value == NULL)
       
  6718               IN_param_value = function_call_param_iterator.next();
       
  6719             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6720             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6721             
       
  6722             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6723             {
       
  6724         
       
  6725                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  6726                 s4o.print("(");
       
  6727                 return_type_symbol->accept(*this);
       
  6728                 s4o.print(")__real_to_time(");
       
  6729                 IN_param_value->accept(*this);
       
  6730                 s4o.print(")");
       
  6731                 return NULL;
       
  6732                 
       
  6733             }
       
  6734             
       
  6735             ERROR;
       
  6736         }
       
  6737         
       
  6738     }/*function_real_to_dt*/
       
  6739     break;
       
  6740 
       
  6741 /****
       
  6742  *REAL_TO_STRING
       
  6743  */
       
  6744     case function_real_to_string :
       
  6745     {
       
  6746         symbol_c *last_type_symbol = NULL;
       
  6747 
       
  6748         {
       
  6749             identifier_c param_name("IN");
       
  6750             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6751             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6752             
       
  6753             /* Get the value from a foo(<param_value>) style call */
       
  6754             if (IN_param_value == NULL)
       
  6755               IN_param_value = function_call_param_iterator.next();
       
  6756             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6757             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6758             
       
  6759             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6760             {
       
  6761         
       
  6762                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  6763                 s4o.print("(");
       
  6764                 return_type_symbol->accept(*this);
       
  6765                 s4o.print(")__real_to_string(");
       
  6766                 IN_param_value->accept(*this);
       
  6767                 s4o.print(")");
       
  6768                 return NULL;
       
  6769                 
       
  6770             }
       
  6771             
       
  6772             ERROR;
       
  6773         }
       
  6774         
       
  6775     }/*function_real_to_string*/
       
  6776     break;
       
  6777 
       
  6778 /****
       
  6779  *REAL_TO_BYTE
       
  6780  */
       
  6781     case function_real_to_byte :
       
  6782     {
       
  6783         symbol_c *last_type_symbol = NULL;
       
  6784 
       
  6785         {
       
  6786             identifier_c param_name("IN");
       
  6787             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6788             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6789             
       
  6790             /* Get the value from a foo(<param_value>) style call */
       
  6791             if (IN_param_value == NULL)
       
  6792               IN_param_value = function_call_param_iterator.next();
       
  6793             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6794             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6795             
       
  6796             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6797             {
       
  6798         
       
  6799                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  6800                 s4o.print("(");
       
  6801                 return_type_symbol->accept(*this);
       
  6802                 s4o.print(")");
       
  6803                 IN_param_value->accept(*this);
       
  6804                 return NULL;
       
  6805                 
       
  6806             }
       
  6807             
       
  6808             ERROR;
       
  6809         }
       
  6810         
       
  6811     }/*function_real_to_byte*/
       
  6812     break;
       
  6813 
       
  6814 /****
       
  6815  *REAL_TO_WORD
       
  6816  */
       
  6817     case function_real_to_word :
       
  6818     {
       
  6819         symbol_c *last_type_symbol = NULL;
       
  6820 
       
  6821         {
       
  6822             identifier_c param_name("IN");
       
  6823             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6824             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6825             
       
  6826             /* Get the value from a foo(<param_value>) style call */
       
  6827             if (IN_param_value == NULL)
       
  6828               IN_param_value = function_call_param_iterator.next();
       
  6829             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6830             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6831             
       
  6832             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6833             {
       
  6834         
       
  6835                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  6836                 s4o.print("(");
       
  6837                 return_type_symbol->accept(*this);
       
  6838                 s4o.print(")");
       
  6839                 IN_param_value->accept(*this);
       
  6840                 return NULL;
       
  6841                 
       
  6842             }
       
  6843             
       
  6844             ERROR;
       
  6845         }
       
  6846         
       
  6847     }/*function_real_to_word*/
       
  6848     break;
       
  6849 
       
  6850 /****
       
  6851  *REAL_TO_DWORD
       
  6852  */
       
  6853     case function_real_to_dword :
       
  6854     {
       
  6855         symbol_c *last_type_symbol = NULL;
       
  6856 
       
  6857         {
       
  6858             identifier_c param_name("IN");
       
  6859             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6860             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6861             
       
  6862             /* Get the value from a foo(<param_value>) style call */
       
  6863             if (IN_param_value == NULL)
       
  6864               IN_param_value = function_call_param_iterator.next();
       
  6865             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6866             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6867             
       
  6868             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6869             {
       
  6870         
       
  6871                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  6872                 s4o.print("(");
       
  6873                 return_type_symbol->accept(*this);
       
  6874                 s4o.print(")");
       
  6875                 IN_param_value->accept(*this);
       
  6876                 return NULL;
       
  6877                 
       
  6878             }
       
  6879             
       
  6880             ERROR;
       
  6881         }
       
  6882         
       
  6883     }/*function_real_to_dword*/
       
  6884     break;
       
  6885 
       
  6886 /****
       
  6887  *REAL_TO_LWORD
       
  6888  */
       
  6889     case function_real_to_lword :
       
  6890     {
       
  6891         symbol_c *last_type_symbol = NULL;
       
  6892 
       
  6893         {
       
  6894             identifier_c param_name("IN");
       
  6895             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6896             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6897             
       
  6898             /* Get the value from a foo(<param_value>) style call */
       
  6899             if (IN_param_value == NULL)
       
  6900               IN_param_value = function_call_param_iterator.next();
       
  6901             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6902             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6903             
       
  6904             if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
       
  6905             {
       
  6906         
       
  6907                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  6908                 s4o.print("(");
       
  6909                 return_type_symbol->accept(*this);
       
  6910                 s4o.print(")");
       
  6911                 IN_param_value->accept(*this);
       
  6912                 return NULL;
       
  6913                 
       
  6914             }
       
  6915             
       
  6916             ERROR;
       
  6917         }
       
  6918         
       
  6919     }/*function_real_to_lword*/
       
  6920     break;
       
  6921 
       
  6922 /****
       
  6923  *LREAL_TO_BOOL
       
  6924  */
       
  6925     case function_lreal_to_bool :
       
  6926     {
       
  6927         symbol_c *last_type_symbol = NULL;
       
  6928 
       
  6929         {
       
  6930             identifier_c param_name("IN");
       
  6931             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6932             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6933             
       
  6934             /* Get the value from a foo(<param_value>) style call */
       
  6935             if (IN_param_value == NULL)
       
  6936               IN_param_value = function_call_param_iterator.next();
       
  6937             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6938             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6939             
       
  6940             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  6941             {
       
  6942         
       
  6943                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  6944                 s4o.print("(");
       
  6945                 return_type_symbol->accept(*this);
       
  6946                 s4o.print(")");
       
  6947                 IN_param_value->accept(*this);
       
  6948                 return NULL;
       
  6949                 
       
  6950             }
       
  6951             
       
  6952             ERROR;
       
  6953         }
       
  6954         
       
  6955     }/*function_lreal_to_bool*/
       
  6956     break;
       
  6957 
       
  6958 /****
       
  6959  *LREAL_TO_SINT
       
  6960  */
       
  6961     case function_lreal_to_sint :
       
  6962     {
       
  6963         symbol_c *last_type_symbol = NULL;
       
  6964 
       
  6965         {
       
  6966             identifier_c param_name("IN");
       
  6967             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6968             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6969             
       
  6970             /* Get the value from a foo(<param_value>) style call */
       
  6971             if (IN_param_value == NULL)
       
  6972               IN_param_value = function_call_param_iterator.next();
       
  6973             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6974             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6975             
       
  6976             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  6977             {
       
  6978         
       
  6979                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  6980                 s4o.print("(");
       
  6981                 return_type_symbol->accept(*this);
       
  6982                 s4o.print(")");
       
  6983                 IN_param_value->accept(*this);
       
  6984                 return NULL;
       
  6985                 
       
  6986             }
       
  6987             
       
  6988             ERROR;
       
  6989         }
       
  6990         
       
  6991     }/*function_lreal_to_sint*/
       
  6992     break;
       
  6993 
       
  6994 /****
       
  6995  *LREAL_TO_INT
       
  6996  */
       
  6997     case function_lreal_to_int :
       
  6998     {
       
  6999         symbol_c *last_type_symbol = NULL;
       
  7000 
       
  7001         {
       
  7002             identifier_c param_name("IN");
       
  7003             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7004             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7005             
       
  7006             /* Get the value from a foo(<param_value>) style call */
       
  7007             if (IN_param_value == NULL)
       
  7008               IN_param_value = function_call_param_iterator.next();
       
  7009             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7010             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7011             
       
  7012             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7013             {
       
  7014         
       
  7015                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  7016                 s4o.print("(");
       
  7017                 return_type_symbol->accept(*this);
       
  7018                 s4o.print(")");
       
  7019                 IN_param_value->accept(*this);
       
  7020                 return NULL;
       
  7021                 
       
  7022             }
       
  7023             
       
  7024             ERROR;
       
  7025         }
       
  7026         
       
  7027     }/*function_lreal_to_int*/
       
  7028     break;
       
  7029 
       
  7030 /****
       
  7031  *LREAL_TO_DINT
       
  7032  */
       
  7033     case function_lreal_to_dint :
       
  7034     {
       
  7035         symbol_c *last_type_symbol = NULL;
       
  7036 
       
  7037         {
       
  7038             identifier_c param_name("IN");
       
  7039             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7040             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7041             
       
  7042             /* Get the value from a foo(<param_value>) style call */
       
  7043             if (IN_param_value == NULL)
       
  7044               IN_param_value = function_call_param_iterator.next();
       
  7045             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7046             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7047             
       
  7048             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7049             {
       
  7050         
       
  7051                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  7052                 s4o.print("(");
       
  7053                 return_type_symbol->accept(*this);
       
  7054                 s4o.print(")");
       
  7055                 IN_param_value->accept(*this);
       
  7056                 return NULL;
       
  7057                 
       
  7058             }
       
  7059             
       
  7060             ERROR;
       
  7061         }
       
  7062         
       
  7063     }/*function_lreal_to_dint*/
       
  7064     break;
       
  7065 
       
  7066 /****
       
  7067  *LREAL_TO_LINT
       
  7068  */
       
  7069     case function_lreal_to_lint :
       
  7070     {
       
  7071         symbol_c *last_type_symbol = NULL;
       
  7072 
       
  7073         {
       
  7074             identifier_c param_name("IN");
       
  7075             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7076             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7077             
       
  7078             /* Get the value from a foo(<param_value>) style call */
       
  7079             if (IN_param_value == NULL)
       
  7080               IN_param_value = function_call_param_iterator.next();
       
  7081             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7082             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7083             
       
  7084             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7085             {
       
  7086         
       
  7087                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  7088                 s4o.print("(");
       
  7089                 return_type_symbol->accept(*this);
       
  7090                 s4o.print(")");
       
  7091                 IN_param_value->accept(*this);
       
  7092                 return NULL;
       
  7093                 
       
  7094             }
       
  7095             
       
  7096             ERROR;
       
  7097         }
       
  7098         
       
  7099     }/*function_lreal_to_lint*/
       
  7100     break;
       
  7101 
       
  7102 /****
       
  7103  *LREAL_TO_USINT
       
  7104  */
       
  7105     case function_lreal_to_usint :
       
  7106     {
       
  7107         symbol_c *last_type_symbol = NULL;
       
  7108 
       
  7109         {
       
  7110             identifier_c param_name("IN");
       
  7111             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7112             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7113             
       
  7114             /* Get the value from a foo(<param_value>) style call */
       
  7115             if (IN_param_value == NULL)
       
  7116               IN_param_value = function_call_param_iterator.next();
       
  7117             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7118             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7119             
       
  7120             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7121             {
       
  7122         
       
  7123                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  7124                 s4o.print("(");
       
  7125                 return_type_symbol->accept(*this);
       
  7126                 s4o.print(")");
       
  7127                 IN_param_value->accept(*this);
       
  7128                 return NULL;
       
  7129                 
       
  7130             }
       
  7131             
       
  7132             ERROR;
       
  7133         }
       
  7134         
       
  7135     }/*function_lreal_to_usint*/
       
  7136     break;
       
  7137 
       
  7138 /****
       
  7139  *LREAL_TO_UINT
       
  7140  */
       
  7141     case function_lreal_to_uint :
       
  7142     {
       
  7143         symbol_c *last_type_symbol = NULL;
       
  7144 
       
  7145         {
       
  7146             identifier_c param_name("IN");
       
  7147             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7148             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7149             
       
  7150             /* Get the value from a foo(<param_value>) style call */
       
  7151             if (IN_param_value == NULL)
       
  7152               IN_param_value = function_call_param_iterator.next();
       
  7153             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7154             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7155             
       
  7156             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7157             {
       
  7158         
       
  7159                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  7160                 s4o.print("(");
       
  7161                 return_type_symbol->accept(*this);
       
  7162                 s4o.print(")");
       
  7163                 IN_param_value->accept(*this);
       
  7164                 return NULL;
       
  7165                 
       
  7166             }
       
  7167             
       
  7168             ERROR;
       
  7169         }
       
  7170         
       
  7171     }/*function_lreal_to_uint*/
       
  7172     break;
       
  7173 
       
  7174 /****
       
  7175  *LREAL_TO_UDINT
       
  7176  */
       
  7177     case function_lreal_to_udint :
       
  7178     {
       
  7179         symbol_c *last_type_symbol = NULL;
       
  7180 
       
  7181         {
       
  7182             identifier_c param_name("IN");
       
  7183             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7184             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7185             
       
  7186             /* Get the value from a foo(<param_value>) style call */
       
  7187             if (IN_param_value == NULL)
       
  7188               IN_param_value = function_call_param_iterator.next();
       
  7189             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7190             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7191             
       
  7192             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7193             {
       
  7194         
       
  7195                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  7196                 s4o.print("(");
       
  7197                 return_type_symbol->accept(*this);
       
  7198                 s4o.print(")");
       
  7199                 IN_param_value->accept(*this);
       
  7200                 return NULL;
       
  7201                 
       
  7202             }
       
  7203             
       
  7204             ERROR;
       
  7205         }
       
  7206         
       
  7207     }/*function_lreal_to_udint*/
       
  7208     break;
       
  7209 
       
  7210 /****
       
  7211  *LREAL_TO_ULINT
       
  7212  */
       
  7213     case function_lreal_to_ulint :
       
  7214     {
       
  7215         symbol_c *last_type_symbol = NULL;
       
  7216 
       
  7217         {
       
  7218             identifier_c param_name("IN");
       
  7219             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7220             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7221             
       
  7222             /* Get the value from a foo(<param_value>) style call */
       
  7223             if (IN_param_value == NULL)
       
  7224               IN_param_value = function_call_param_iterator.next();
       
  7225             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7226             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7227             
       
  7228             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7229             {
       
  7230         
       
  7231                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  7232                 s4o.print("(");
       
  7233                 return_type_symbol->accept(*this);
       
  7234                 s4o.print(")");
       
  7235                 IN_param_value->accept(*this);
       
  7236                 return NULL;
       
  7237                 
       
  7238             }
       
  7239             
       
  7240             ERROR;
       
  7241         }
       
  7242         
       
  7243     }/*function_lreal_to_ulint*/
       
  7244     break;
       
  7245 
       
  7246 /****
       
  7247  *LREAL_TO_REAL
       
  7248  */
       
  7249     case function_lreal_to_real :
       
  7250     {
       
  7251         symbol_c *last_type_symbol = NULL;
       
  7252 
       
  7253         {
       
  7254             identifier_c param_name("IN");
       
  7255             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7256             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7257             
       
  7258             /* Get the value from a foo(<param_value>) style call */
       
  7259             if (IN_param_value == NULL)
       
  7260               IN_param_value = function_call_param_iterator.next();
       
  7261             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7262             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7263             
       
  7264             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7265             {
       
  7266         
       
  7267                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  7268                 s4o.print("(");
       
  7269                 return_type_symbol->accept(*this);
       
  7270                 s4o.print(")");
       
  7271                 IN_param_value->accept(*this);
       
  7272                 return NULL;
       
  7273                 
       
  7274             }
       
  7275             
       
  7276             ERROR;
       
  7277         }
       
  7278         
       
  7279     }/*function_lreal_to_real*/
       
  7280     break;
       
  7281 
       
  7282 /****
       
  7283  *LREAL_TO_TIME
       
  7284  */
       
  7285     case function_lreal_to_time :
       
  7286     {
       
  7287         symbol_c *last_type_symbol = NULL;
       
  7288 
       
  7289         {
       
  7290             identifier_c param_name("IN");
       
  7291             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7292             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7293             
       
  7294             /* Get the value from a foo(<param_value>) style call */
       
  7295             if (IN_param_value == NULL)
       
  7296               IN_param_value = function_call_param_iterator.next();
       
  7297             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7298             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7299             
       
  7300             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7301             {
       
  7302         
       
  7303                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  7304                 s4o.print("(");
       
  7305                 return_type_symbol->accept(*this);
       
  7306                 s4o.print(")__real_to_time(");
       
  7307                 IN_param_value->accept(*this);
       
  7308                 s4o.print(")");
       
  7309                 return NULL;
       
  7310                 
       
  7311             }
       
  7312             
       
  7313             ERROR;
       
  7314         }
       
  7315         
       
  7316     }/*function_lreal_to_time*/
       
  7317     break;
       
  7318 
       
  7319 /****
       
  7320  *LREAL_TO_DATE
       
  7321  */
       
  7322     case function_lreal_to_date :
       
  7323     {
       
  7324         symbol_c *last_type_symbol = NULL;
       
  7325 
       
  7326         {
       
  7327             identifier_c param_name("IN");
       
  7328             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7329             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7330             
       
  7331             /* Get the value from a foo(<param_value>) style call */
       
  7332             if (IN_param_value == NULL)
       
  7333               IN_param_value = function_call_param_iterator.next();
       
  7334             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7335             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7336             
       
  7337             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7338             {
       
  7339         
       
  7340                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  7341                 s4o.print("(");
       
  7342                 return_type_symbol->accept(*this);
       
  7343                 s4o.print(")__real_to_time(");
       
  7344                 IN_param_value->accept(*this);
       
  7345                 s4o.print(")");
       
  7346                 return NULL;
       
  7347                 
       
  7348             }
       
  7349             
       
  7350             ERROR;
       
  7351         }
       
  7352         
       
  7353     }/*function_lreal_to_date*/
       
  7354     break;
       
  7355 
       
  7356 /****
       
  7357  *LREAL_TO_TOD
       
  7358  */
       
  7359     case function_lreal_to_tod :
       
  7360     {
       
  7361         symbol_c *last_type_symbol = NULL;
       
  7362 
       
  7363         {
       
  7364             identifier_c param_name("IN");
       
  7365             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7366             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7367             
       
  7368             /* Get the value from a foo(<param_value>) style call */
       
  7369             if (IN_param_value == NULL)
       
  7370               IN_param_value = function_call_param_iterator.next();
       
  7371             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7372             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7373             
       
  7374             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7375             {
       
  7376         
       
  7377                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  7378                 s4o.print("(");
       
  7379                 return_type_symbol->accept(*this);
       
  7380                 s4o.print(")__real_to_time(");
       
  7381                 IN_param_value->accept(*this);
       
  7382                 s4o.print(")");
       
  7383                 return NULL;
       
  7384                 
       
  7385             }
       
  7386             
       
  7387             ERROR;
       
  7388         }
       
  7389         
       
  7390     }/*function_lreal_to_tod*/
       
  7391     break;
       
  7392 
       
  7393 /****
       
  7394  *LREAL_TO_DT
       
  7395  */
       
  7396     case function_lreal_to_dt :
       
  7397     {
       
  7398         symbol_c *last_type_symbol = NULL;
       
  7399 
       
  7400         {
       
  7401             identifier_c param_name("IN");
       
  7402             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7403             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7404             
       
  7405             /* Get the value from a foo(<param_value>) style call */
       
  7406             if (IN_param_value == NULL)
       
  7407               IN_param_value = function_call_param_iterator.next();
       
  7408             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7409             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7410             
       
  7411             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7412             {
       
  7413         
       
  7414                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  7415                 s4o.print("(");
       
  7416                 return_type_symbol->accept(*this);
       
  7417                 s4o.print(")__real_to_time(");
       
  7418                 IN_param_value->accept(*this);
       
  7419                 s4o.print(")");
       
  7420                 return NULL;
       
  7421                 
       
  7422             }
       
  7423             
       
  7424             ERROR;
       
  7425         }
       
  7426         
       
  7427     }/*function_lreal_to_dt*/
       
  7428     break;
       
  7429 
       
  7430 /****
       
  7431  *LREAL_TO_STRING
       
  7432  */
       
  7433     case function_lreal_to_string :
       
  7434     {
       
  7435         symbol_c *last_type_symbol = NULL;
       
  7436 
       
  7437         {
       
  7438             identifier_c param_name("IN");
       
  7439             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7440             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7441             
       
  7442             /* Get the value from a foo(<param_value>) style call */
       
  7443             if (IN_param_value == NULL)
       
  7444               IN_param_value = function_call_param_iterator.next();
       
  7445             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7446             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7447             
       
  7448             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7449             {
       
  7450         
       
  7451                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  7452                 s4o.print("(");
       
  7453                 return_type_symbol->accept(*this);
       
  7454                 s4o.print(")__real_to_string(");
       
  7455                 IN_param_value->accept(*this);
       
  7456                 s4o.print(")");
       
  7457                 return NULL;
       
  7458                 
       
  7459             }
       
  7460             
       
  7461             ERROR;
       
  7462         }
       
  7463         
       
  7464     }/*function_lreal_to_string*/
       
  7465     break;
       
  7466 
       
  7467 /****
       
  7468  *LREAL_TO_BYTE
       
  7469  */
       
  7470     case function_lreal_to_byte :
       
  7471     {
       
  7472         symbol_c *last_type_symbol = NULL;
       
  7473 
       
  7474         {
       
  7475             identifier_c param_name("IN");
       
  7476             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7477             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7478             
       
  7479             /* Get the value from a foo(<param_value>) style call */
       
  7480             if (IN_param_value == NULL)
       
  7481               IN_param_value = function_call_param_iterator.next();
       
  7482             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7483             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7484             
       
  7485             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7486             {
       
  7487         
       
  7488                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  7489                 s4o.print("(");
       
  7490                 return_type_symbol->accept(*this);
       
  7491                 s4o.print(")");
       
  7492                 IN_param_value->accept(*this);
       
  7493                 return NULL;
       
  7494                 
       
  7495             }
       
  7496             
       
  7497             ERROR;
       
  7498         }
       
  7499         
       
  7500     }/*function_lreal_to_byte*/
       
  7501     break;
       
  7502 
       
  7503 /****
       
  7504  *LREAL_TO_WORD
       
  7505  */
       
  7506     case function_lreal_to_word :
       
  7507     {
       
  7508         symbol_c *last_type_symbol = NULL;
       
  7509 
       
  7510         {
       
  7511             identifier_c param_name("IN");
       
  7512             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7513             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7514             
       
  7515             /* Get the value from a foo(<param_value>) style call */
       
  7516             if (IN_param_value == NULL)
       
  7517               IN_param_value = function_call_param_iterator.next();
       
  7518             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7519             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7520             
       
  7521             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7522             {
       
  7523         
       
  7524                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  7525                 s4o.print("(");
       
  7526                 return_type_symbol->accept(*this);
       
  7527                 s4o.print(")");
       
  7528                 IN_param_value->accept(*this);
       
  7529                 return NULL;
       
  7530                 
       
  7531             }
       
  7532             
       
  7533             ERROR;
       
  7534         }
       
  7535         
       
  7536     }/*function_lreal_to_word*/
       
  7537     break;
       
  7538 
       
  7539 /****
       
  7540  *LREAL_TO_DWORD
       
  7541  */
       
  7542     case function_lreal_to_dword :
       
  7543     {
       
  7544         symbol_c *last_type_symbol = NULL;
       
  7545 
       
  7546         {
       
  7547             identifier_c param_name("IN");
       
  7548             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7549             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7550             
       
  7551             /* Get the value from a foo(<param_value>) style call */
       
  7552             if (IN_param_value == NULL)
       
  7553               IN_param_value = function_call_param_iterator.next();
       
  7554             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7555             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7556             
       
  7557             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7558             {
       
  7559         
       
  7560                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  7561                 s4o.print("(");
       
  7562                 return_type_symbol->accept(*this);
       
  7563                 s4o.print(")");
       
  7564                 IN_param_value->accept(*this);
       
  7565                 return NULL;
       
  7566                 
       
  7567             }
       
  7568             
       
  7569             ERROR;
       
  7570         }
       
  7571         
       
  7572     }/*function_lreal_to_dword*/
       
  7573     break;
       
  7574 
       
  7575 /****
       
  7576  *LREAL_TO_LWORD
       
  7577  */
       
  7578     case function_lreal_to_lword :
       
  7579     {
       
  7580         symbol_c *last_type_symbol = NULL;
       
  7581 
       
  7582         {
       
  7583             identifier_c param_name("IN");
       
  7584             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7585             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7586             
       
  7587             /* Get the value from a foo(<param_value>) style call */
       
  7588             if (IN_param_value == NULL)
       
  7589               IN_param_value = function_call_param_iterator.next();
       
  7590             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7591             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7592             
       
  7593             if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
       
  7594             {
       
  7595         
       
  7596                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  7597                 s4o.print("(");
       
  7598                 return_type_symbol->accept(*this);
       
  7599                 s4o.print(")");
       
  7600                 IN_param_value->accept(*this);
       
  7601                 return NULL;
       
  7602                 
       
  7603             }
       
  7604             
       
  7605             ERROR;
       
  7606         }
       
  7607         
       
  7608     }/*function_lreal_to_lword*/
       
  7609     break;
       
  7610 
       
  7611 /****
       
  7612  *TIME_TO_SINT
       
  7613  */
       
  7614     case function_time_to_sint :
       
  7615     {
       
  7616         symbol_c *last_type_symbol = NULL;
       
  7617 
       
  7618         {
       
  7619             identifier_c param_name("IN");
       
  7620             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7621             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7622             
       
  7623             /* Get the value from a foo(<param_value>) style call */
       
  7624             if (IN_param_value == NULL)
       
  7625               IN_param_value = function_call_param_iterator.next();
       
  7626             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7627             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7628             
       
  7629             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  7630             {
       
  7631         
       
  7632                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  7633                 s4o.print("(");
       
  7634                 return_type_symbol->accept(*this);
       
  7635                 s4o.print(")__time_to_int(");
       
  7636                 IN_param_value->accept(*this);
       
  7637                 s4o.print(")");
       
  7638                 return NULL;
       
  7639                 
       
  7640             }
       
  7641             
       
  7642             ERROR;
       
  7643         }
       
  7644         
       
  7645     }/*function_time_to_sint*/
       
  7646     break;
       
  7647 
       
  7648 /****
       
  7649  *TIME_TO_INT
       
  7650  */
       
  7651     case function_time_to_int :
       
  7652     {
       
  7653         symbol_c *last_type_symbol = NULL;
       
  7654 
       
  7655         {
       
  7656             identifier_c param_name("IN");
       
  7657             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7658             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7659             
       
  7660             /* Get the value from a foo(<param_value>) style call */
       
  7661             if (IN_param_value == NULL)
       
  7662               IN_param_value = function_call_param_iterator.next();
       
  7663             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7664             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7665             
       
  7666             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  7667             {
       
  7668         
       
  7669                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  7670                 s4o.print("(");
       
  7671                 return_type_symbol->accept(*this);
       
  7672                 s4o.print(")__time_to_int(");
       
  7673                 IN_param_value->accept(*this);
       
  7674                 s4o.print(")");
       
  7675                 return NULL;
       
  7676                 
       
  7677             }
       
  7678             
       
  7679             ERROR;
       
  7680         }
       
  7681         
       
  7682     }/*function_time_to_int*/
       
  7683     break;
       
  7684 
       
  7685 /****
       
  7686  *TIME_TO_DINT
       
  7687  */
       
  7688     case function_time_to_dint :
       
  7689     {
       
  7690         symbol_c *last_type_symbol = NULL;
       
  7691 
       
  7692         {
       
  7693             identifier_c param_name("IN");
       
  7694             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7695             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7696             
       
  7697             /* Get the value from a foo(<param_value>) style call */
       
  7698             if (IN_param_value == NULL)
       
  7699               IN_param_value = function_call_param_iterator.next();
       
  7700             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7701             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7702             
       
  7703             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  7704             {
       
  7705         
       
  7706                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  7707                 s4o.print("(");
       
  7708                 return_type_symbol->accept(*this);
       
  7709                 s4o.print(")__time_to_int(");
       
  7710                 IN_param_value->accept(*this);
       
  7711                 s4o.print(")");
       
  7712                 return NULL;
       
  7713                 
       
  7714             }
       
  7715             
       
  7716             ERROR;
       
  7717         }
       
  7718         
       
  7719     }/*function_time_to_dint*/
       
  7720     break;
       
  7721 
       
  7722 /****
       
  7723  *TIME_TO_LINT
       
  7724  */
       
  7725     case function_time_to_lint :
       
  7726     {
       
  7727         symbol_c *last_type_symbol = NULL;
       
  7728 
       
  7729         {
       
  7730             identifier_c param_name("IN");
       
  7731             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7732             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7733             
       
  7734             /* Get the value from a foo(<param_value>) style call */
       
  7735             if (IN_param_value == NULL)
       
  7736               IN_param_value = function_call_param_iterator.next();
       
  7737             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7738             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7739             
       
  7740             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  7741             {
       
  7742         
       
  7743                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  7744                 s4o.print("(");
       
  7745                 return_type_symbol->accept(*this);
       
  7746                 s4o.print(")__time_to_int(");
       
  7747                 IN_param_value->accept(*this);
       
  7748                 s4o.print(")");
       
  7749                 return NULL;
       
  7750                 
       
  7751             }
       
  7752             
       
  7753             ERROR;
       
  7754         }
       
  7755         
       
  7756     }/*function_time_to_lint*/
       
  7757     break;
       
  7758 
       
  7759 /****
       
  7760  *TIME_TO_USINT
       
  7761  */
       
  7762     case function_time_to_usint :
       
  7763     {
       
  7764         symbol_c *last_type_symbol = NULL;
       
  7765 
       
  7766         {
       
  7767             identifier_c param_name("IN");
       
  7768             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7769             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7770             
       
  7771             /* Get the value from a foo(<param_value>) style call */
       
  7772             if (IN_param_value == NULL)
       
  7773               IN_param_value = function_call_param_iterator.next();
       
  7774             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7775             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7776             
       
  7777             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  7778             {
       
  7779         
       
  7780                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  7781                 s4o.print("(");
       
  7782                 return_type_symbol->accept(*this);
       
  7783                 s4o.print(")__time_to_int(");
       
  7784                 IN_param_value->accept(*this);
       
  7785                 s4o.print(")");
       
  7786                 return NULL;
       
  7787                 
       
  7788             }
       
  7789             
       
  7790             ERROR;
       
  7791         }
       
  7792         
       
  7793     }/*function_time_to_usint*/
       
  7794     break;
       
  7795 
       
  7796 /****
       
  7797  *TIME_TO_UINT
       
  7798  */
       
  7799     case function_time_to_uint :
       
  7800     {
       
  7801         symbol_c *last_type_symbol = NULL;
       
  7802 
       
  7803         {
       
  7804             identifier_c param_name("IN");
       
  7805             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7806             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7807             
       
  7808             /* Get the value from a foo(<param_value>) style call */
       
  7809             if (IN_param_value == NULL)
       
  7810               IN_param_value = function_call_param_iterator.next();
       
  7811             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7812             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7813             
       
  7814             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  7815             {
       
  7816         
       
  7817                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  7818                 s4o.print("(");
       
  7819                 return_type_symbol->accept(*this);
       
  7820                 s4o.print(")__time_to_int(");
       
  7821                 IN_param_value->accept(*this);
       
  7822                 s4o.print(")");
       
  7823                 return NULL;
       
  7824                 
       
  7825             }
       
  7826             
       
  7827             ERROR;
       
  7828         }
       
  7829         
       
  7830     }/*function_time_to_uint*/
       
  7831     break;
       
  7832 
       
  7833 /****
       
  7834  *TIME_TO_UDINT
       
  7835  */
       
  7836     case function_time_to_udint :
       
  7837     {
       
  7838         symbol_c *last_type_symbol = NULL;
       
  7839 
       
  7840         {
       
  7841             identifier_c param_name("IN");
       
  7842             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7843             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7844             
       
  7845             /* Get the value from a foo(<param_value>) style call */
       
  7846             if (IN_param_value == NULL)
       
  7847               IN_param_value = function_call_param_iterator.next();
       
  7848             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7849             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7850             
       
  7851             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  7852             {
       
  7853         
       
  7854                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  7855                 s4o.print("(");
       
  7856                 return_type_symbol->accept(*this);
       
  7857                 s4o.print(")__time_to_int(");
       
  7858                 IN_param_value->accept(*this);
       
  7859                 s4o.print(")");
       
  7860                 return NULL;
       
  7861                 
       
  7862             }
       
  7863             
       
  7864             ERROR;
       
  7865         }
       
  7866         
       
  7867     }/*function_time_to_udint*/
       
  7868     break;
       
  7869 
       
  7870 /****
       
  7871  *TIME_TO_ULINT
       
  7872  */
       
  7873     case function_time_to_ulint :
       
  7874     {
       
  7875         symbol_c *last_type_symbol = NULL;
       
  7876 
       
  7877         {
       
  7878             identifier_c param_name("IN");
       
  7879             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7880             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7881             
       
  7882             /* Get the value from a foo(<param_value>) style call */
       
  7883             if (IN_param_value == NULL)
       
  7884               IN_param_value = function_call_param_iterator.next();
       
  7885             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7886             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7887             
       
  7888             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  7889             {
       
  7890         
       
  7891                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  7892                 s4o.print("(");
       
  7893                 return_type_symbol->accept(*this);
       
  7894                 s4o.print(")__time_to_int(");
       
  7895                 IN_param_value->accept(*this);
       
  7896                 s4o.print(")");
       
  7897                 return NULL;
       
  7898                 
       
  7899             }
       
  7900             
       
  7901             ERROR;
       
  7902         }
       
  7903         
       
  7904     }/*function_time_to_ulint*/
       
  7905     break;
       
  7906 
       
  7907 /****
       
  7908  *TIME_TO_REAL
       
  7909  */
       
  7910     case function_time_to_real :
       
  7911     {
       
  7912         symbol_c *last_type_symbol = NULL;
       
  7913 
       
  7914         {
       
  7915             identifier_c param_name("IN");
       
  7916             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7917             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7918             
       
  7919             /* Get the value from a foo(<param_value>) style call */
       
  7920             if (IN_param_value == NULL)
       
  7921               IN_param_value = function_call_param_iterator.next();
       
  7922             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7923             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7924             
       
  7925             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  7926             {
       
  7927         
       
  7928                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  7929                 s4o.print("(");
       
  7930                 return_type_symbol->accept(*this);
       
  7931                 s4o.print(")__time_to_real(");
       
  7932                 IN_param_value->accept(*this);
       
  7933                 s4o.print(")");
       
  7934                 return NULL;
       
  7935                 
       
  7936             }
       
  7937             
       
  7938             ERROR;
       
  7939         }
       
  7940         
       
  7941     }/*function_time_to_real*/
       
  7942     break;
       
  7943 
       
  7944 /****
       
  7945  *TIME_TO_LREAL
       
  7946  */
       
  7947     case function_time_to_lreal :
       
  7948     {
       
  7949         symbol_c *last_type_symbol = NULL;
       
  7950 
       
  7951         {
       
  7952             identifier_c param_name("IN");
       
  7953             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7954             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7955             
       
  7956             /* Get the value from a foo(<param_value>) style call */
       
  7957             if (IN_param_value == NULL)
       
  7958               IN_param_value = function_call_param_iterator.next();
       
  7959             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7960             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7961             
       
  7962             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  7963             {
       
  7964         
       
  7965                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  7966                 s4o.print("(");
       
  7967                 return_type_symbol->accept(*this);
       
  7968                 s4o.print(")__time_to_real(");
       
  7969                 IN_param_value->accept(*this);
       
  7970                 s4o.print(")");
       
  7971                 return NULL;
       
  7972                 
       
  7973             }
       
  7974             
       
  7975             ERROR;
       
  7976         }
       
  7977         
       
  7978     }/*function_time_to_lreal*/
       
  7979     break;
       
  7980 
       
  7981 /****
       
  7982  *TIME_TO_STRING
       
  7983  */
       
  7984     case function_time_to_string :
       
  7985     {
       
  7986         symbol_c *last_type_symbol = NULL;
       
  7987 
       
  7988         {
       
  7989             identifier_c param_name("IN");
       
  7990             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7991             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7992             
       
  7993             /* Get the value from a foo(<param_value>) style call */
       
  7994             if (IN_param_value == NULL)
       
  7995               IN_param_value = function_call_param_iterator.next();
       
  7996             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7997             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7998             
       
  7999             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  8000             {
       
  8001         
       
  8002                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  8003                 s4o.print("(");
       
  8004                 return_type_symbol->accept(*this);
       
  8005                 s4o.print(")__time_to_string(");
       
  8006                 IN_param_value->accept(*this);
       
  8007                 s4o.print(")");
       
  8008                 return NULL;
       
  8009                 
       
  8010             }
       
  8011             
       
  8012             ERROR;
       
  8013         }
       
  8014         
       
  8015     }/*function_time_to_string*/
       
  8016     break;
       
  8017 
       
  8018 /****
       
  8019  *TIME_TO_BYTE
       
  8020  */
       
  8021     case function_time_to_byte :
       
  8022     {
       
  8023         symbol_c *last_type_symbol = NULL;
       
  8024 
       
  8025         {
       
  8026             identifier_c param_name("IN");
       
  8027             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8028             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8029             
       
  8030             /* Get the value from a foo(<param_value>) style call */
       
  8031             if (IN_param_value == NULL)
       
  8032               IN_param_value = function_call_param_iterator.next();
       
  8033             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8034             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8035             
       
  8036             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  8037             {
       
  8038         
       
  8039                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  8040                 s4o.print("(");
       
  8041                 return_type_symbol->accept(*this);
       
  8042                 s4o.print(")__time_to_int(");
       
  8043                 IN_param_value->accept(*this);
       
  8044                 s4o.print(")");
       
  8045                 return NULL;
       
  8046                 
       
  8047             }
       
  8048             
       
  8049             ERROR;
       
  8050         }
       
  8051         
       
  8052     }/*function_time_to_byte*/
       
  8053     break;
       
  8054 
       
  8055 /****
       
  8056  *TIME_TO_WORD
       
  8057  */
       
  8058     case function_time_to_word :
       
  8059     {
       
  8060         symbol_c *last_type_symbol = NULL;
       
  8061 
       
  8062         {
       
  8063             identifier_c param_name("IN");
       
  8064             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8065             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8066             
       
  8067             /* Get the value from a foo(<param_value>) style call */
       
  8068             if (IN_param_value == NULL)
       
  8069               IN_param_value = function_call_param_iterator.next();
       
  8070             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8071             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8072             
       
  8073             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  8074             {
       
  8075         
       
  8076                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  8077                 s4o.print("(");
       
  8078                 return_type_symbol->accept(*this);
       
  8079                 s4o.print(")__time_to_int(");
       
  8080                 IN_param_value->accept(*this);
       
  8081                 s4o.print(")");
       
  8082                 return NULL;
       
  8083                 
       
  8084             }
       
  8085             
       
  8086             ERROR;
       
  8087         }
       
  8088         
       
  8089     }/*function_time_to_word*/
       
  8090     break;
       
  8091 
       
  8092 /****
       
  8093  *TIME_TO_DWORD
       
  8094  */
       
  8095     case function_time_to_dword :
       
  8096     {
       
  8097         symbol_c *last_type_symbol = NULL;
       
  8098 
       
  8099         {
       
  8100             identifier_c param_name("IN");
       
  8101             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8102             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8103             
       
  8104             /* Get the value from a foo(<param_value>) style call */
       
  8105             if (IN_param_value == NULL)
       
  8106               IN_param_value = function_call_param_iterator.next();
       
  8107             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8108             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8109             
       
  8110             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  8111             {
       
  8112         
       
  8113                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  8114                 s4o.print("(");
       
  8115                 return_type_symbol->accept(*this);
       
  8116                 s4o.print(")__time_to_int(");
       
  8117                 IN_param_value->accept(*this);
       
  8118                 s4o.print(")");
       
  8119                 return NULL;
       
  8120                 
       
  8121             }
       
  8122             
       
  8123             ERROR;
       
  8124         }
       
  8125         
       
  8126     }/*function_time_to_dword*/
       
  8127     break;
       
  8128 
       
  8129 /****
       
  8130  *TIME_TO_LWORD
       
  8131  */
       
  8132     case function_time_to_lword :
       
  8133     {
       
  8134         symbol_c *last_type_symbol = NULL;
       
  8135 
       
  8136         {
       
  8137             identifier_c param_name("IN");
       
  8138             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8139             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8140             
       
  8141             /* Get the value from a foo(<param_value>) style call */
       
  8142             if (IN_param_value == NULL)
       
  8143               IN_param_value = function_call_param_iterator.next();
       
  8144             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8145             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8146             
       
  8147             if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
       
  8148             {
       
  8149         
       
  8150                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  8151                 s4o.print("(");
       
  8152                 return_type_symbol->accept(*this);
       
  8153                 s4o.print(")__time_to_int(");
       
  8154                 IN_param_value->accept(*this);
       
  8155                 s4o.print(")");
       
  8156                 return NULL;
       
  8157                 
       
  8158             }
       
  8159             
       
  8160             ERROR;
       
  8161         }
       
  8162         
       
  8163     }/*function_time_to_lword*/
       
  8164     break;
       
  8165 
       
  8166 /****
       
  8167  *DATE_TO_SINT
       
  8168  */
       
  8169     case function_date_to_sint :
       
  8170     {
       
  8171         symbol_c *last_type_symbol = NULL;
       
  8172 
       
  8173         {
       
  8174             identifier_c param_name("IN");
       
  8175             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8176             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8177             
       
  8178             /* Get the value from a foo(<param_value>) style call */
       
  8179             if (IN_param_value == NULL)
       
  8180               IN_param_value = function_call_param_iterator.next();
       
  8181             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8182             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8183             
       
  8184             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8185             {
       
  8186         
       
  8187                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  8188                 s4o.print("(");
       
  8189                 return_type_symbol->accept(*this);
       
  8190                 s4o.print(")__time_to_int(");
       
  8191                 IN_param_value->accept(*this);
       
  8192                 s4o.print(")");
       
  8193                 return NULL;
       
  8194                 
       
  8195             }
       
  8196             
       
  8197             ERROR;
       
  8198         }
       
  8199         
       
  8200     }/*function_date_to_sint*/
       
  8201     break;
       
  8202 
       
  8203 /****
       
  8204  *DATE_TO_INT
       
  8205  */
       
  8206     case function_date_to_int :
       
  8207     {
       
  8208         symbol_c *last_type_symbol = NULL;
       
  8209 
       
  8210         {
       
  8211             identifier_c param_name("IN");
       
  8212             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8213             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8214             
       
  8215             /* Get the value from a foo(<param_value>) style call */
       
  8216             if (IN_param_value == NULL)
       
  8217               IN_param_value = function_call_param_iterator.next();
       
  8218             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8219             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8220             
       
  8221             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8222             {
       
  8223         
       
  8224                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  8225                 s4o.print("(");
       
  8226                 return_type_symbol->accept(*this);
       
  8227                 s4o.print(")__time_to_int(");
       
  8228                 IN_param_value->accept(*this);
       
  8229                 s4o.print(")");
       
  8230                 return NULL;
       
  8231                 
       
  8232             }
       
  8233             
       
  8234             ERROR;
       
  8235         }
       
  8236         
       
  8237     }/*function_date_to_int*/
       
  8238     break;
       
  8239 
       
  8240 /****
       
  8241  *DATE_TO_DINT
       
  8242  */
       
  8243     case function_date_to_dint :
       
  8244     {
       
  8245         symbol_c *last_type_symbol = NULL;
       
  8246 
       
  8247         {
       
  8248             identifier_c param_name("IN");
       
  8249             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8250             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8251             
       
  8252             /* Get the value from a foo(<param_value>) style call */
       
  8253             if (IN_param_value == NULL)
       
  8254               IN_param_value = function_call_param_iterator.next();
       
  8255             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8256             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8257             
       
  8258             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8259             {
       
  8260         
       
  8261                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  8262                 s4o.print("(");
       
  8263                 return_type_symbol->accept(*this);
       
  8264                 s4o.print(")__time_to_int(");
       
  8265                 IN_param_value->accept(*this);
       
  8266                 s4o.print(")");
       
  8267                 return NULL;
       
  8268                 
       
  8269             }
       
  8270             
       
  8271             ERROR;
       
  8272         }
       
  8273         
       
  8274     }/*function_date_to_dint*/
       
  8275     break;
       
  8276 
       
  8277 /****
       
  8278  *DATE_TO_LINT
       
  8279  */
       
  8280     case function_date_to_lint :
       
  8281     {
       
  8282         symbol_c *last_type_symbol = NULL;
       
  8283 
       
  8284         {
       
  8285             identifier_c param_name("IN");
       
  8286             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8287             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8288             
       
  8289             /* Get the value from a foo(<param_value>) style call */
       
  8290             if (IN_param_value == NULL)
       
  8291               IN_param_value = function_call_param_iterator.next();
       
  8292             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8293             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8294             
       
  8295             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8296             {
       
  8297         
       
  8298                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  8299                 s4o.print("(");
       
  8300                 return_type_symbol->accept(*this);
       
  8301                 s4o.print(")__time_to_int(");
       
  8302                 IN_param_value->accept(*this);
       
  8303                 s4o.print(")");
       
  8304                 return NULL;
       
  8305                 
       
  8306             }
       
  8307             
       
  8308             ERROR;
       
  8309         }
       
  8310         
       
  8311     }/*function_date_to_lint*/
       
  8312     break;
       
  8313 
       
  8314 /****
       
  8315  *DATE_TO_USINT
       
  8316  */
       
  8317     case function_date_to_usint :
       
  8318     {
       
  8319         symbol_c *last_type_symbol = NULL;
       
  8320 
       
  8321         {
       
  8322             identifier_c param_name("IN");
       
  8323             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8324             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8325             
       
  8326             /* Get the value from a foo(<param_value>) style call */
       
  8327             if (IN_param_value == NULL)
       
  8328               IN_param_value = function_call_param_iterator.next();
       
  8329             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8330             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8331             
       
  8332             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8333             {
       
  8334         
       
  8335                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  8336                 s4o.print("(");
       
  8337                 return_type_symbol->accept(*this);
       
  8338                 s4o.print(")__time_to_int(");
       
  8339                 IN_param_value->accept(*this);
       
  8340                 s4o.print(")");
       
  8341                 return NULL;
       
  8342                 
       
  8343             }
       
  8344             
       
  8345             ERROR;
       
  8346         }
       
  8347         
       
  8348     }/*function_date_to_usint*/
       
  8349     break;
       
  8350 
       
  8351 /****
       
  8352  *DATE_TO_UINT
       
  8353  */
       
  8354     case function_date_to_uint :
       
  8355     {
       
  8356         symbol_c *last_type_symbol = NULL;
       
  8357 
       
  8358         {
       
  8359             identifier_c param_name("IN");
       
  8360             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8361             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8362             
       
  8363             /* Get the value from a foo(<param_value>) style call */
       
  8364             if (IN_param_value == NULL)
       
  8365               IN_param_value = function_call_param_iterator.next();
       
  8366             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8367             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8368             
       
  8369             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8370             {
       
  8371         
       
  8372                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  8373                 s4o.print("(");
       
  8374                 return_type_symbol->accept(*this);
       
  8375                 s4o.print(")__time_to_int(");
       
  8376                 IN_param_value->accept(*this);
       
  8377                 s4o.print(")");
       
  8378                 return NULL;
       
  8379                 
       
  8380             }
       
  8381             
       
  8382             ERROR;
       
  8383         }
       
  8384         
       
  8385     }/*function_date_to_uint*/
       
  8386     break;
       
  8387 
       
  8388 /****
       
  8389  *DATE_TO_UDINT
       
  8390  */
       
  8391     case function_date_to_udint :
       
  8392     {
       
  8393         symbol_c *last_type_symbol = NULL;
       
  8394 
       
  8395         {
       
  8396             identifier_c param_name("IN");
       
  8397             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8398             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8399             
       
  8400             /* Get the value from a foo(<param_value>) style call */
       
  8401             if (IN_param_value == NULL)
       
  8402               IN_param_value = function_call_param_iterator.next();
       
  8403             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8404             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8405             
       
  8406             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8407             {
       
  8408         
       
  8409                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  8410                 s4o.print("(");
       
  8411                 return_type_symbol->accept(*this);
       
  8412                 s4o.print(")__time_to_int(");
       
  8413                 IN_param_value->accept(*this);
       
  8414                 s4o.print(")");
       
  8415                 return NULL;
       
  8416                 
       
  8417             }
       
  8418             
       
  8419             ERROR;
       
  8420         }
       
  8421         
       
  8422     }/*function_date_to_udint*/
       
  8423     break;
       
  8424 
       
  8425 /****
       
  8426  *DATE_TO_ULINT
       
  8427  */
       
  8428     case function_date_to_ulint :
       
  8429     {
       
  8430         symbol_c *last_type_symbol = NULL;
       
  8431 
       
  8432         {
       
  8433             identifier_c param_name("IN");
       
  8434             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8435             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8436             
       
  8437             /* Get the value from a foo(<param_value>) style call */
       
  8438             if (IN_param_value == NULL)
       
  8439               IN_param_value = function_call_param_iterator.next();
       
  8440             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8441             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8442             
       
  8443             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8444             {
       
  8445         
       
  8446                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  8447                 s4o.print("(");
       
  8448                 return_type_symbol->accept(*this);
       
  8449                 s4o.print(")__time_to_int(");
       
  8450                 IN_param_value->accept(*this);
       
  8451                 s4o.print(")");
       
  8452                 return NULL;
       
  8453                 
       
  8454             }
       
  8455             
       
  8456             ERROR;
       
  8457         }
       
  8458         
       
  8459     }/*function_date_to_ulint*/
       
  8460     break;
       
  8461 
       
  8462 /****
       
  8463  *DATE_TO_REAL
       
  8464  */
       
  8465     case function_date_to_real :
       
  8466     {
       
  8467         symbol_c *last_type_symbol = NULL;
       
  8468 
       
  8469         {
       
  8470             identifier_c param_name("IN");
       
  8471             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8472             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8473             
       
  8474             /* Get the value from a foo(<param_value>) style call */
       
  8475             if (IN_param_value == NULL)
       
  8476               IN_param_value = function_call_param_iterator.next();
       
  8477             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8478             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8479             
       
  8480             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8481             {
       
  8482         
       
  8483                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  8484                 s4o.print("(");
       
  8485                 return_type_symbol->accept(*this);
       
  8486                 s4o.print(")__time_to_real(");
       
  8487                 IN_param_value->accept(*this);
       
  8488                 s4o.print(")");
       
  8489                 return NULL;
       
  8490                 
       
  8491             }
       
  8492             
       
  8493             ERROR;
       
  8494         }
       
  8495         
       
  8496     }/*function_date_to_real*/
       
  8497     break;
       
  8498 
       
  8499 /****
       
  8500  *DATE_TO_LREAL
       
  8501  */
       
  8502     case function_date_to_lreal :
       
  8503     {
       
  8504         symbol_c *last_type_symbol = NULL;
       
  8505 
       
  8506         {
       
  8507             identifier_c param_name("IN");
       
  8508             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8509             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8510             
       
  8511             /* Get the value from a foo(<param_value>) style call */
       
  8512             if (IN_param_value == NULL)
       
  8513               IN_param_value = function_call_param_iterator.next();
       
  8514             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8515             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8516             
       
  8517             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8518             {
       
  8519         
       
  8520                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  8521                 s4o.print("(");
       
  8522                 return_type_symbol->accept(*this);
       
  8523                 s4o.print(")__time_to_real(");
       
  8524                 IN_param_value->accept(*this);
       
  8525                 s4o.print(")");
       
  8526                 return NULL;
       
  8527                 
       
  8528             }
       
  8529             
       
  8530             ERROR;
       
  8531         }
       
  8532         
       
  8533     }/*function_date_to_lreal*/
       
  8534     break;
       
  8535 
       
  8536 /****
       
  8537  *DATE_TO_STRING
       
  8538  */
       
  8539     case function_date_to_string :
       
  8540     {
       
  8541         symbol_c *last_type_symbol = NULL;
       
  8542 
       
  8543         {
       
  8544             identifier_c param_name("IN");
       
  8545             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8546             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8547             
       
  8548             /* Get the value from a foo(<param_value>) style call */
       
  8549             if (IN_param_value == NULL)
       
  8550               IN_param_value = function_call_param_iterator.next();
       
  8551             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8552             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8553             
       
  8554             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8555             {
       
  8556         
       
  8557                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  8558                 s4o.print("(");
       
  8559                 return_type_symbol->accept(*this);
       
  8560                 s4o.print(")__date_to_string(");
       
  8561                 IN_param_value->accept(*this);
       
  8562                 s4o.print(")");
       
  8563                 return NULL;
       
  8564                 
       
  8565             }
       
  8566             
       
  8567             ERROR;
       
  8568         }
       
  8569         
       
  8570     }/*function_date_to_string*/
       
  8571     break;
       
  8572 
       
  8573 /****
       
  8574  *DATE_TO_BYTE
       
  8575  */
       
  8576     case function_date_to_byte :
       
  8577     {
       
  8578         symbol_c *last_type_symbol = NULL;
       
  8579 
       
  8580         {
       
  8581             identifier_c param_name("IN");
       
  8582             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8583             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8584             
       
  8585             /* Get the value from a foo(<param_value>) style call */
       
  8586             if (IN_param_value == NULL)
       
  8587               IN_param_value = function_call_param_iterator.next();
       
  8588             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8589             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8590             
       
  8591             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8592             {
       
  8593         
       
  8594                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  8595                 s4o.print("(");
       
  8596                 return_type_symbol->accept(*this);
       
  8597                 s4o.print(")__time_to_int(");
       
  8598                 IN_param_value->accept(*this);
       
  8599                 s4o.print(")");
       
  8600                 return NULL;
       
  8601                 
       
  8602             }
       
  8603             
       
  8604             ERROR;
       
  8605         }
       
  8606         
       
  8607     }/*function_date_to_byte*/
       
  8608     break;
       
  8609 
       
  8610 /****
       
  8611  *DATE_TO_WORD
       
  8612  */
       
  8613     case function_date_to_word :
       
  8614     {
       
  8615         symbol_c *last_type_symbol = NULL;
       
  8616 
       
  8617         {
       
  8618             identifier_c param_name("IN");
       
  8619             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8620             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8621             
       
  8622             /* Get the value from a foo(<param_value>) style call */
       
  8623             if (IN_param_value == NULL)
       
  8624               IN_param_value = function_call_param_iterator.next();
       
  8625             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8626             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8627             
       
  8628             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8629             {
       
  8630         
       
  8631                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  8632                 s4o.print("(");
       
  8633                 return_type_symbol->accept(*this);
       
  8634                 s4o.print(")__time_to_int(");
       
  8635                 IN_param_value->accept(*this);
       
  8636                 s4o.print(")");
       
  8637                 return NULL;
       
  8638                 
       
  8639             }
       
  8640             
       
  8641             ERROR;
       
  8642         }
       
  8643         
       
  8644     }/*function_date_to_word*/
       
  8645     break;
       
  8646 
       
  8647 /****
       
  8648  *DATE_TO_DWORD
       
  8649  */
       
  8650     case function_date_to_dword :
       
  8651     {
       
  8652         symbol_c *last_type_symbol = NULL;
       
  8653 
       
  8654         {
       
  8655             identifier_c param_name("IN");
       
  8656             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8657             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8658             
       
  8659             /* Get the value from a foo(<param_value>) style call */
       
  8660             if (IN_param_value == NULL)
       
  8661               IN_param_value = function_call_param_iterator.next();
       
  8662             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8663             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8664             
       
  8665             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8666             {
       
  8667         
       
  8668                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  8669                 s4o.print("(");
       
  8670                 return_type_symbol->accept(*this);
       
  8671                 s4o.print(")__time_to_int(");
       
  8672                 IN_param_value->accept(*this);
       
  8673                 s4o.print(")");
       
  8674                 return NULL;
       
  8675                 
       
  8676             }
       
  8677             
       
  8678             ERROR;
       
  8679         }
       
  8680         
       
  8681     }/*function_date_to_dword*/
       
  8682     break;
       
  8683 
       
  8684 /****
       
  8685  *DATE_TO_LWORD
       
  8686  */
       
  8687     case function_date_to_lword :
       
  8688     {
       
  8689         symbol_c *last_type_symbol = NULL;
       
  8690 
       
  8691         {
       
  8692             identifier_c param_name("IN");
       
  8693             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8694             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8695             
       
  8696             /* Get the value from a foo(<param_value>) style call */
       
  8697             if (IN_param_value == NULL)
       
  8698               IN_param_value = function_call_param_iterator.next();
       
  8699             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8700             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8701             
       
  8702             if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
       
  8703             {
       
  8704         
       
  8705                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  8706                 s4o.print("(");
       
  8707                 return_type_symbol->accept(*this);
       
  8708                 s4o.print(")__time_to_int(");
       
  8709                 IN_param_value->accept(*this);
       
  8710                 s4o.print(")");
       
  8711                 return NULL;
       
  8712                 
       
  8713             }
       
  8714             
       
  8715             ERROR;
       
  8716         }
       
  8717         
       
  8718     }/*function_date_to_lword*/
       
  8719     break;
       
  8720 
       
  8721 /****
       
  8722  *TOD_TO_SINT
       
  8723  */
       
  8724     case function_tod_to_sint :
       
  8725     {
       
  8726         symbol_c *last_type_symbol = NULL;
       
  8727 
       
  8728         {
       
  8729             identifier_c param_name("IN");
       
  8730             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8731             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8732             
       
  8733             /* Get the value from a foo(<param_value>) style call */
       
  8734             if (IN_param_value == NULL)
       
  8735               IN_param_value = function_call_param_iterator.next();
       
  8736             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8737             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8738             
       
  8739             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  8740             {
       
  8741         
       
  8742                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  8743                 s4o.print("(");
       
  8744                 return_type_symbol->accept(*this);
       
  8745                 s4o.print(")__time_to_int(");
       
  8746                 IN_param_value->accept(*this);
       
  8747                 s4o.print(")");
       
  8748                 return NULL;
       
  8749                 
       
  8750             }
       
  8751             
       
  8752             ERROR;
       
  8753         }
       
  8754         
       
  8755     }/*function_tod_to_sint*/
       
  8756     break;
       
  8757 
       
  8758 /****
       
  8759  *TOD_TO_INT
       
  8760  */
       
  8761     case function_tod_to_int :
       
  8762     {
       
  8763         symbol_c *last_type_symbol = NULL;
       
  8764 
       
  8765         {
       
  8766             identifier_c param_name("IN");
       
  8767             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8768             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8769             
       
  8770             /* Get the value from a foo(<param_value>) style call */
       
  8771             if (IN_param_value == NULL)
       
  8772               IN_param_value = function_call_param_iterator.next();
       
  8773             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8774             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8775             
       
  8776             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  8777             {
       
  8778         
       
  8779                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  8780                 s4o.print("(");
       
  8781                 return_type_symbol->accept(*this);
       
  8782                 s4o.print(")__time_to_int(");
       
  8783                 IN_param_value->accept(*this);
       
  8784                 s4o.print(")");
       
  8785                 return NULL;
       
  8786                 
       
  8787             }
       
  8788             
       
  8789             ERROR;
       
  8790         }
       
  8791         
       
  8792     }/*function_tod_to_int*/
       
  8793     break;
       
  8794 
       
  8795 /****
       
  8796  *TOD_TO_DINT
       
  8797  */
       
  8798     case function_tod_to_dint :
       
  8799     {
       
  8800         symbol_c *last_type_symbol = NULL;
       
  8801 
       
  8802         {
       
  8803             identifier_c param_name("IN");
       
  8804             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8805             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8806             
       
  8807             /* Get the value from a foo(<param_value>) style call */
       
  8808             if (IN_param_value == NULL)
       
  8809               IN_param_value = function_call_param_iterator.next();
       
  8810             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8811             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8812             
       
  8813             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  8814             {
       
  8815         
       
  8816                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  8817                 s4o.print("(");
       
  8818                 return_type_symbol->accept(*this);
       
  8819                 s4o.print(")__time_to_int(");
       
  8820                 IN_param_value->accept(*this);
       
  8821                 s4o.print(")");
       
  8822                 return NULL;
       
  8823                 
       
  8824             }
       
  8825             
       
  8826             ERROR;
       
  8827         }
       
  8828         
       
  8829     }/*function_tod_to_dint*/
       
  8830     break;
       
  8831 
       
  8832 /****
       
  8833  *TOD_TO_LINT
       
  8834  */
       
  8835     case function_tod_to_lint :
       
  8836     {
       
  8837         symbol_c *last_type_symbol = NULL;
       
  8838 
       
  8839         {
       
  8840             identifier_c param_name("IN");
       
  8841             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8842             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8843             
       
  8844             /* Get the value from a foo(<param_value>) style call */
       
  8845             if (IN_param_value == NULL)
       
  8846               IN_param_value = function_call_param_iterator.next();
       
  8847             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8848             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8849             
       
  8850             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  8851             {
       
  8852         
       
  8853                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  8854                 s4o.print("(");
       
  8855                 return_type_symbol->accept(*this);
       
  8856                 s4o.print(")__time_to_int(");
       
  8857                 IN_param_value->accept(*this);
       
  8858                 s4o.print(")");
       
  8859                 return NULL;
       
  8860                 
       
  8861             }
       
  8862             
       
  8863             ERROR;
       
  8864         }
       
  8865         
       
  8866     }/*function_tod_to_lint*/
       
  8867     break;
       
  8868 
       
  8869 /****
       
  8870  *TOD_TO_USINT
       
  8871  */
       
  8872     case function_tod_to_usint :
       
  8873     {
       
  8874         symbol_c *last_type_symbol = NULL;
       
  8875 
       
  8876         {
       
  8877             identifier_c param_name("IN");
       
  8878             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8879             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8880             
       
  8881             /* Get the value from a foo(<param_value>) style call */
       
  8882             if (IN_param_value == NULL)
       
  8883               IN_param_value = function_call_param_iterator.next();
       
  8884             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8885             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8886             
       
  8887             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  8888             {
       
  8889         
       
  8890                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  8891                 s4o.print("(");
       
  8892                 return_type_symbol->accept(*this);
       
  8893                 s4o.print(")__time_to_int(");
       
  8894                 IN_param_value->accept(*this);
       
  8895                 s4o.print(")");
       
  8896                 return NULL;
       
  8897                 
       
  8898             }
       
  8899             
       
  8900             ERROR;
       
  8901         }
       
  8902         
       
  8903     }/*function_tod_to_usint*/
       
  8904     break;
       
  8905 
       
  8906 /****
       
  8907  *TOD_TO_UINT
       
  8908  */
       
  8909     case function_tod_to_uint :
       
  8910     {
       
  8911         symbol_c *last_type_symbol = NULL;
       
  8912 
       
  8913         {
       
  8914             identifier_c param_name("IN");
       
  8915             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8916             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8917             
       
  8918             /* Get the value from a foo(<param_value>) style call */
       
  8919             if (IN_param_value == NULL)
       
  8920               IN_param_value = function_call_param_iterator.next();
       
  8921             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8922             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8923             
       
  8924             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  8925             {
       
  8926         
       
  8927                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  8928                 s4o.print("(");
       
  8929                 return_type_symbol->accept(*this);
       
  8930                 s4o.print(")__time_to_int(");
       
  8931                 IN_param_value->accept(*this);
       
  8932                 s4o.print(")");
       
  8933                 return NULL;
       
  8934                 
       
  8935             }
       
  8936             
       
  8937             ERROR;
       
  8938         }
       
  8939         
       
  8940     }/*function_tod_to_uint*/
       
  8941     break;
       
  8942 
       
  8943 /****
       
  8944  *TOD_TO_UDINT
       
  8945  */
       
  8946     case function_tod_to_udint :
       
  8947     {
       
  8948         symbol_c *last_type_symbol = NULL;
       
  8949 
       
  8950         {
       
  8951             identifier_c param_name("IN");
       
  8952             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8953             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8954             
       
  8955             /* Get the value from a foo(<param_value>) style call */
       
  8956             if (IN_param_value == NULL)
       
  8957               IN_param_value = function_call_param_iterator.next();
       
  8958             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8959             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8960             
       
  8961             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  8962             {
       
  8963         
       
  8964                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  8965                 s4o.print("(");
       
  8966                 return_type_symbol->accept(*this);
       
  8967                 s4o.print(")__time_to_int(");
       
  8968                 IN_param_value->accept(*this);
       
  8969                 s4o.print(")");
       
  8970                 return NULL;
       
  8971                 
       
  8972             }
       
  8973             
       
  8974             ERROR;
       
  8975         }
       
  8976         
       
  8977     }/*function_tod_to_udint*/
       
  8978     break;
       
  8979 
       
  8980 /****
       
  8981  *TOD_TO_ULINT
       
  8982  */
       
  8983     case function_tod_to_ulint :
       
  8984     {
       
  8985         symbol_c *last_type_symbol = NULL;
       
  8986 
       
  8987         {
       
  8988             identifier_c param_name("IN");
       
  8989             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8990             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8991             
       
  8992             /* Get the value from a foo(<param_value>) style call */
       
  8993             if (IN_param_value == NULL)
       
  8994               IN_param_value = function_call_param_iterator.next();
       
  8995             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8996             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8997             
       
  8998             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  8999             {
       
  9000         
       
  9001                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  9002                 s4o.print("(");
       
  9003                 return_type_symbol->accept(*this);
       
  9004                 s4o.print(")__time_to_int(");
       
  9005                 IN_param_value->accept(*this);
       
  9006                 s4o.print(")");
       
  9007                 return NULL;
       
  9008                 
       
  9009             }
       
  9010             
       
  9011             ERROR;
       
  9012         }
       
  9013         
       
  9014     }/*function_tod_to_ulint*/
       
  9015     break;
       
  9016 
       
  9017 /****
       
  9018  *TOD_TO_REAL
       
  9019  */
       
  9020     case function_tod_to_real :
       
  9021     {
       
  9022         symbol_c *last_type_symbol = NULL;
       
  9023 
       
  9024         {
       
  9025             identifier_c param_name("IN");
       
  9026             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9027             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9028             
       
  9029             /* Get the value from a foo(<param_value>) style call */
       
  9030             if (IN_param_value == NULL)
       
  9031               IN_param_value = function_call_param_iterator.next();
       
  9032             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9033             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9034             
       
  9035             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  9036             {
       
  9037         
       
  9038                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  9039                 s4o.print("(");
       
  9040                 return_type_symbol->accept(*this);
       
  9041                 s4o.print(")__time_to_real(");
       
  9042                 IN_param_value->accept(*this);
       
  9043                 s4o.print(")");
       
  9044                 return NULL;
       
  9045                 
       
  9046             }
       
  9047             
       
  9048             ERROR;
       
  9049         }
       
  9050         
       
  9051     }/*function_tod_to_real*/
       
  9052     break;
       
  9053 
       
  9054 /****
       
  9055  *TOD_TO_LREAL
       
  9056  */
       
  9057     case function_tod_to_lreal :
       
  9058     {
       
  9059         symbol_c *last_type_symbol = NULL;
       
  9060 
       
  9061         {
       
  9062             identifier_c param_name("IN");
       
  9063             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9064             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9065             
       
  9066             /* Get the value from a foo(<param_value>) style call */
       
  9067             if (IN_param_value == NULL)
       
  9068               IN_param_value = function_call_param_iterator.next();
       
  9069             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9070             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9071             
       
  9072             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  9073             {
       
  9074         
       
  9075                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  9076                 s4o.print("(");
       
  9077                 return_type_symbol->accept(*this);
       
  9078                 s4o.print(")__time_to_real(");
       
  9079                 IN_param_value->accept(*this);
       
  9080                 s4o.print(")");
       
  9081                 return NULL;
       
  9082                 
       
  9083             }
       
  9084             
       
  9085             ERROR;
       
  9086         }
       
  9087         
       
  9088     }/*function_tod_to_lreal*/
       
  9089     break;
       
  9090 
       
  9091 /****
       
  9092  *TOD_TO_STRING
       
  9093  */
       
  9094     case function_tod_to_string :
       
  9095     {
       
  9096         symbol_c *last_type_symbol = NULL;
       
  9097 
       
  9098         {
       
  9099             identifier_c param_name("IN");
       
  9100             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9101             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9102             
       
  9103             /* Get the value from a foo(<param_value>) style call */
       
  9104             if (IN_param_value == NULL)
       
  9105               IN_param_value = function_call_param_iterator.next();
       
  9106             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9107             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9108             
       
  9109             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  9110             {
       
  9111         
       
  9112                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  9113                 s4o.print("(");
       
  9114                 return_type_symbol->accept(*this);
       
  9115                 s4o.print(")__tod_to_string(");
       
  9116                 IN_param_value->accept(*this);
       
  9117                 s4o.print(")");
       
  9118                 return NULL;
       
  9119                 
       
  9120             }
       
  9121             
       
  9122             ERROR;
       
  9123         }
       
  9124         
       
  9125     }/*function_tod_to_string*/
       
  9126     break;
       
  9127 
       
  9128 /****
       
  9129  *TOD_TO_BYTE
       
  9130  */
       
  9131     case function_tod_to_byte :
       
  9132     {
       
  9133         symbol_c *last_type_symbol = NULL;
       
  9134 
       
  9135         {
       
  9136             identifier_c param_name("IN");
       
  9137             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9138             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9139             
       
  9140             /* Get the value from a foo(<param_value>) style call */
       
  9141             if (IN_param_value == NULL)
       
  9142               IN_param_value = function_call_param_iterator.next();
       
  9143             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9144             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9145             
       
  9146             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  9147             {
       
  9148         
       
  9149                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  9150                 s4o.print("(");
       
  9151                 return_type_symbol->accept(*this);
       
  9152                 s4o.print(")__time_to_int(");
       
  9153                 IN_param_value->accept(*this);
       
  9154                 s4o.print(")");
       
  9155                 return NULL;
       
  9156                 
       
  9157             }
       
  9158             
       
  9159             ERROR;
       
  9160         }
       
  9161         
       
  9162     }/*function_tod_to_byte*/
       
  9163     break;
       
  9164 
       
  9165 /****
       
  9166  *TOD_TO_WORD
       
  9167  */
       
  9168     case function_tod_to_word :
       
  9169     {
       
  9170         symbol_c *last_type_symbol = NULL;
       
  9171 
       
  9172         {
       
  9173             identifier_c param_name("IN");
       
  9174             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9175             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9176             
       
  9177             /* Get the value from a foo(<param_value>) style call */
       
  9178             if (IN_param_value == NULL)
       
  9179               IN_param_value = function_call_param_iterator.next();
       
  9180             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9181             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9182             
       
  9183             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  9184             {
       
  9185         
       
  9186                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  9187                 s4o.print("(");
       
  9188                 return_type_symbol->accept(*this);
       
  9189                 s4o.print(")__time_to_int(");
       
  9190                 IN_param_value->accept(*this);
       
  9191                 s4o.print(")");
       
  9192                 return NULL;
       
  9193                 
       
  9194             }
       
  9195             
       
  9196             ERROR;
       
  9197         }
       
  9198         
       
  9199     }/*function_tod_to_word*/
       
  9200     break;
       
  9201 
       
  9202 /****
       
  9203  *TOD_TO_DWORD
       
  9204  */
       
  9205     case function_tod_to_dword :
       
  9206     {
       
  9207         symbol_c *last_type_symbol = NULL;
       
  9208 
       
  9209         {
       
  9210             identifier_c param_name("IN");
       
  9211             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9212             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9213             
       
  9214             /* Get the value from a foo(<param_value>) style call */
       
  9215             if (IN_param_value == NULL)
       
  9216               IN_param_value = function_call_param_iterator.next();
       
  9217             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9218             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9219             
       
  9220             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  9221             {
       
  9222         
       
  9223                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  9224                 s4o.print("(");
       
  9225                 return_type_symbol->accept(*this);
       
  9226                 s4o.print(")__time_to_int(");
       
  9227                 IN_param_value->accept(*this);
       
  9228                 s4o.print(")");
       
  9229                 return NULL;
       
  9230                 
       
  9231             }
       
  9232             
       
  9233             ERROR;
       
  9234         }
       
  9235         
       
  9236     }/*function_tod_to_dword*/
       
  9237     break;
       
  9238 
       
  9239 /****
       
  9240  *TOD_TO_LWORD
       
  9241  */
       
  9242     case function_tod_to_lword :
       
  9243     {
       
  9244         symbol_c *last_type_symbol = NULL;
       
  9245 
       
  9246         {
       
  9247             identifier_c param_name("IN");
       
  9248             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9249             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9250             
       
  9251             /* Get the value from a foo(<param_value>) style call */
       
  9252             if (IN_param_value == NULL)
       
  9253               IN_param_value = function_call_param_iterator.next();
       
  9254             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9255             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9256             
       
  9257             if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
       
  9258             {
       
  9259         
       
  9260                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  9261                 s4o.print("(");
       
  9262                 return_type_symbol->accept(*this);
       
  9263                 s4o.print(")__time_to_int(");
       
  9264                 IN_param_value->accept(*this);
       
  9265                 s4o.print(")");
       
  9266                 return NULL;
       
  9267                 
       
  9268             }
       
  9269             
       
  9270             ERROR;
       
  9271         }
       
  9272         
       
  9273     }/*function_tod_to_lword*/
       
  9274     break;
       
  9275 
       
  9276 /****
       
  9277  *DT_TO_SINT
       
  9278  */
       
  9279     case function_dt_to_sint :
       
  9280     {
       
  9281         symbol_c *last_type_symbol = NULL;
       
  9282 
       
  9283         {
       
  9284             identifier_c param_name("IN");
       
  9285             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9286             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9287             
       
  9288             /* Get the value from a foo(<param_value>) style call */
       
  9289             if (IN_param_value == NULL)
       
  9290               IN_param_value = function_call_param_iterator.next();
       
  9291             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9292             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9293             
       
  9294             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9295             {
       
  9296         
       
  9297                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  9298                 s4o.print("(");
       
  9299                 return_type_symbol->accept(*this);
       
  9300                 s4o.print(")__time_to_int(");
       
  9301                 IN_param_value->accept(*this);
       
  9302                 s4o.print(")");
       
  9303                 return NULL;
       
  9304                 
       
  9305             }
       
  9306             
       
  9307             ERROR;
       
  9308         }
       
  9309         
       
  9310     }/*function_dt_to_sint*/
       
  9311     break;
       
  9312 
       
  9313 /****
       
  9314  *DT_TO_INT
       
  9315  */
       
  9316     case function_dt_to_int :
       
  9317     {
       
  9318         symbol_c *last_type_symbol = NULL;
       
  9319 
       
  9320         {
       
  9321             identifier_c param_name("IN");
       
  9322             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9323             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9324             
       
  9325             /* Get the value from a foo(<param_value>) style call */
       
  9326             if (IN_param_value == NULL)
       
  9327               IN_param_value = function_call_param_iterator.next();
       
  9328             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9329             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9330             
       
  9331             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9332             {
       
  9333         
       
  9334                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  9335                 s4o.print("(");
       
  9336                 return_type_symbol->accept(*this);
       
  9337                 s4o.print(")__time_to_int(");
       
  9338                 IN_param_value->accept(*this);
       
  9339                 s4o.print(")");
       
  9340                 return NULL;
       
  9341                 
       
  9342             }
       
  9343             
       
  9344             ERROR;
       
  9345         }
       
  9346         
       
  9347     }/*function_dt_to_int*/
       
  9348     break;
       
  9349 
       
  9350 /****
       
  9351  *DT_TO_DINT
       
  9352  */
       
  9353     case function_dt_to_dint :
       
  9354     {
       
  9355         symbol_c *last_type_symbol = NULL;
       
  9356 
       
  9357         {
       
  9358             identifier_c param_name("IN");
       
  9359             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9360             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9361             
       
  9362             /* Get the value from a foo(<param_value>) style call */
       
  9363             if (IN_param_value == NULL)
       
  9364               IN_param_value = function_call_param_iterator.next();
       
  9365             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9366             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9367             
       
  9368             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9369             {
       
  9370         
       
  9371                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  9372                 s4o.print("(");
       
  9373                 return_type_symbol->accept(*this);
       
  9374                 s4o.print(")__time_to_int(");
       
  9375                 IN_param_value->accept(*this);
       
  9376                 s4o.print(")");
       
  9377                 return NULL;
       
  9378                 
       
  9379             }
       
  9380             
       
  9381             ERROR;
       
  9382         }
       
  9383         
       
  9384     }/*function_dt_to_dint*/
       
  9385     break;
       
  9386 
       
  9387 /****
       
  9388  *DT_TO_LINT
       
  9389  */
       
  9390     case function_dt_to_lint :
       
  9391     {
       
  9392         symbol_c *last_type_symbol = NULL;
       
  9393 
       
  9394         {
       
  9395             identifier_c param_name("IN");
       
  9396             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9397             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9398             
       
  9399             /* Get the value from a foo(<param_value>) style call */
       
  9400             if (IN_param_value == NULL)
       
  9401               IN_param_value = function_call_param_iterator.next();
       
  9402             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9403             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9404             
       
  9405             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9406             {
       
  9407         
       
  9408                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  9409                 s4o.print("(");
       
  9410                 return_type_symbol->accept(*this);
       
  9411                 s4o.print(")__time_to_int(");
       
  9412                 IN_param_value->accept(*this);
       
  9413                 s4o.print(")");
       
  9414                 return NULL;
       
  9415                 
       
  9416             }
       
  9417             
       
  9418             ERROR;
       
  9419         }
       
  9420         
       
  9421     }/*function_dt_to_lint*/
       
  9422     break;
       
  9423 
       
  9424 /****
       
  9425  *DT_TO_USINT
       
  9426  */
       
  9427     case function_dt_to_usint :
       
  9428     {
       
  9429         symbol_c *last_type_symbol = NULL;
       
  9430 
       
  9431         {
       
  9432             identifier_c param_name("IN");
       
  9433             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9434             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9435             
       
  9436             /* Get the value from a foo(<param_value>) style call */
       
  9437             if (IN_param_value == NULL)
       
  9438               IN_param_value = function_call_param_iterator.next();
       
  9439             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9440             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9441             
       
  9442             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9443             {
       
  9444         
       
  9445                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  9446                 s4o.print("(");
       
  9447                 return_type_symbol->accept(*this);
       
  9448                 s4o.print(")__time_to_int(");
       
  9449                 IN_param_value->accept(*this);
       
  9450                 s4o.print(")");
       
  9451                 return NULL;
       
  9452                 
       
  9453             }
       
  9454             
       
  9455             ERROR;
       
  9456         }
       
  9457         
       
  9458     }/*function_dt_to_usint*/
       
  9459     break;
       
  9460 
       
  9461 /****
       
  9462  *DT_TO_UINT
       
  9463  */
       
  9464     case function_dt_to_uint :
       
  9465     {
       
  9466         symbol_c *last_type_symbol = NULL;
       
  9467 
       
  9468         {
       
  9469             identifier_c param_name("IN");
       
  9470             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9471             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9472             
       
  9473             /* Get the value from a foo(<param_value>) style call */
       
  9474             if (IN_param_value == NULL)
       
  9475               IN_param_value = function_call_param_iterator.next();
       
  9476             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9477             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9478             
       
  9479             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9480             {
       
  9481         
       
  9482                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  9483                 s4o.print("(");
       
  9484                 return_type_symbol->accept(*this);
       
  9485                 s4o.print(")__time_to_int(");
       
  9486                 IN_param_value->accept(*this);
       
  9487                 s4o.print(")");
       
  9488                 return NULL;
       
  9489                 
       
  9490             }
       
  9491             
       
  9492             ERROR;
       
  9493         }
       
  9494         
       
  9495     }/*function_dt_to_uint*/
       
  9496     break;
       
  9497 
       
  9498 /****
       
  9499  *DT_TO_UDINT
       
  9500  */
       
  9501     case function_dt_to_udint :
       
  9502     {
       
  9503         symbol_c *last_type_symbol = NULL;
       
  9504 
       
  9505         {
       
  9506             identifier_c param_name("IN");
       
  9507             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9508             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9509             
       
  9510             /* Get the value from a foo(<param_value>) style call */
       
  9511             if (IN_param_value == NULL)
       
  9512               IN_param_value = function_call_param_iterator.next();
       
  9513             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9514             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9515             
       
  9516             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9517             {
       
  9518         
       
  9519                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  9520                 s4o.print("(");
       
  9521                 return_type_symbol->accept(*this);
       
  9522                 s4o.print(")__time_to_int(");
       
  9523                 IN_param_value->accept(*this);
       
  9524                 s4o.print(")");
       
  9525                 return NULL;
       
  9526                 
       
  9527             }
       
  9528             
       
  9529             ERROR;
       
  9530         }
       
  9531         
       
  9532     }/*function_dt_to_udint*/
       
  9533     break;
       
  9534 
       
  9535 /****
       
  9536  *DT_TO_ULINT
       
  9537  */
       
  9538     case function_dt_to_ulint :
       
  9539     {
       
  9540         symbol_c *last_type_symbol = NULL;
       
  9541 
       
  9542         {
       
  9543             identifier_c param_name("IN");
       
  9544             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9545             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9546             
       
  9547             /* Get the value from a foo(<param_value>) style call */
       
  9548             if (IN_param_value == NULL)
       
  9549               IN_param_value = function_call_param_iterator.next();
       
  9550             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9551             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9552             
       
  9553             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9554             {
       
  9555         
       
  9556                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  9557                 s4o.print("(");
       
  9558                 return_type_symbol->accept(*this);
       
  9559                 s4o.print(")__time_to_int(");
       
  9560                 IN_param_value->accept(*this);
       
  9561                 s4o.print(")");
       
  9562                 return NULL;
       
  9563                 
       
  9564             }
       
  9565             
       
  9566             ERROR;
       
  9567         }
       
  9568         
       
  9569     }/*function_dt_to_ulint*/
       
  9570     break;
       
  9571 
       
  9572 /****
       
  9573  *DT_TO_REAL
       
  9574  */
       
  9575     case function_dt_to_real :
       
  9576     {
       
  9577         symbol_c *last_type_symbol = NULL;
       
  9578 
       
  9579         {
       
  9580             identifier_c param_name("IN");
       
  9581             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9582             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9583             
       
  9584             /* Get the value from a foo(<param_value>) style call */
       
  9585             if (IN_param_value == NULL)
       
  9586               IN_param_value = function_call_param_iterator.next();
       
  9587             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9588             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9589             
       
  9590             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9591             {
       
  9592         
       
  9593                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  9594                 s4o.print("(");
       
  9595                 return_type_symbol->accept(*this);
       
  9596                 s4o.print(")__time_to_real(");
       
  9597                 IN_param_value->accept(*this);
       
  9598                 s4o.print(")");
       
  9599                 return NULL;
       
  9600                 
       
  9601             }
       
  9602             
       
  9603             ERROR;
       
  9604         }
       
  9605         
       
  9606     }/*function_dt_to_real*/
       
  9607     break;
       
  9608 
       
  9609 /****
       
  9610  *DT_TO_LREAL
       
  9611  */
       
  9612     case function_dt_to_lreal :
       
  9613     {
       
  9614         symbol_c *last_type_symbol = NULL;
       
  9615 
       
  9616         {
       
  9617             identifier_c param_name("IN");
       
  9618             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9619             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9620             
       
  9621             /* Get the value from a foo(<param_value>) style call */
       
  9622             if (IN_param_value == NULL)
       
  9623               IN_param_value = function_call_param_iterator.next();
       
  9624             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9625             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9626             
       
  9627             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9628             {
       
  9629         
       
  9630                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  9631                 s4o.print("(");
       
  9632                 return_type_symbol->accept(*this);
       
  9633                 s4o.print(")__time_to_real(");
       
  9634                 IN_param_value->accept(*this);
       
  9635                 s4o.print(")");
       
  9636                 return NULL;
       
  9637                 
       
  9638             }
       
  9639             
       
  9640             ERROR;
       
  9641         }
       
  9642         
       
  9643     }/*function_dt_to_lreal*/
       
  9644     break;
       
  9645 
       
  9646 /****
       
  9647  *DT_TO_STRING
       
  9648  */
       
  9649     case function_dt_to_string :
       
  9650     {
       
  9651         symbol_c *last_type_symbol = NULL;
       
  9652 
       
  9653         {
       
  9654             identifier_c param_name("IN");
       
  9655             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9656             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9657             
       
  9658             /* Get the value from a foo(<param_value>) style call */
       
  9659             if (IN_param_value == NULL)
       
  9660               IN_param_value = function_call_param_iterator.next();
       
  9661             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9662             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9663             
       
  9664             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9665             {
       
  9666         
       
  9667                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  9668                 s4o.print("(");
       
  9669                 return_type_symbol->accept(*this);
       
  9670                 s4o.print(")__dt_to_string(");
       
  9671                 IN_param_value->accept(*this);
       
  9672                 s4o.print(")");
       
  9673                 return NULL;
       
  9674                 
       
  9675             }
       
  9676             
       
  9677             ERROR;
       
  9678         }
       
  9679         
       
  9680     }/*function_dt_to_string*/
       
  9681     break;
       
  9682 
       
  9683 /****
       
  9684  *DT_TO_BYTE
       
  9685  */
       
  9686     case function_dt_to_byte :
       
  9687     {
       
  9688         symbol_c *last_type_symbol = NULL;
       
  9689 
       
  9690         {
       
  9691             identifier_c param_name("IN");
       
  9692             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9693             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9694             
       
  9695             /* Get the value from a foo(<param_value>) style call */
       
  9696             if (IN_param_value == NULL)
       
  9697               IN_param_value = function_call_param_iterator.next();
       
  9698             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9699             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9700             
       
  9701             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9702             {
       
  9703         
       
  9704                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  9705                 s4o.print("(");
       
  9706                 return_type_symbol->accept(*this);
       
  9707                 s4o.print(")__time_to_int(");
       
  9708                 IN_param_value->accept(*this);
       
  9709                 s4o.print(")");
       
  9710                 return NULL;
       
  9711                 
       
  9712             }
       
  9713             
       
  9714             ERROR;
       
  9715         }
       
  9716         
       
  9717     }/*function_dt_to_byte*/
       
  9718     break;
       
  9719 
       
  9720 /****
       
  9721  *DT_TO_WORD
       
  9722  */
       
  9723     case function_dt_to_word :
       
  9724     {
       
  9725         symbol_c *last_type_symbol = NULL;
       
  9726 
       
  9727         {
       
  9728             identifier_c param_name("IN");
       
  9729             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9730             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9731             
       
  9732             /* Get the value from a foo(<param_value>) style call */
       
  9733             if (IN_param_value == NULL)
       
  9734               IN_param_value = function_call_param_iterator.next();
       
  9735             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9736             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9737             
       
  9738             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9739             {
       
  9740         
       
  9741                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  9742                 s4o.print("(");
       
  9743                 return_type_symbol->accept(*this);
       
  9744                 s4o.print(")__time_to_int(");
       
  9745                 IN_param_value->accept(*this);
       
  9746                 s4o.print(")");
       
  9747                 return NULL;
       
  9748                 
       
  9749             }
       
  9750             
       
  9751             ERROR;
       
  9752         }
       
  9753         
       
  9754     }/*function_dt_to_word*/
       
  9755     break;
       
  9756 
       
  9757 /****
       
  9758  *DT_TO_DWORD
       
  9759  */
       
  9760     case function_dt_to_dword :
       
  9761     {
       
  9762         symbol_c *last_type_symbol = NULL;
       
  9763 
       
  9764         {
       
  9765             identifier_c param_name("IN");
       
  9766             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9767             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9768             
       
  9769             /* Get the value from a foo(<param_value>) style call */
       
  9770             if (IN_param_value == NULL)
       
  9771               IN_param_value = function_call_param_iterator.next();
       
  9772             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9773             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9774             
       
  9775             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9776             {
       
  9777         
       
  9778                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  9779                 s4o.print("(");
       
  9780                 return_type_symbol->accept(*this);
       
  9781                 s4o.print(")__time_to_int(");
       
  9782                 IN_param_value->accept(*this);
       
  9783                 s4o.print(")");
       
  9784                 return NULL;
       
  9785                 
       
  9786             }
       
  9787             
       
  9788             ERROR;
       
  9789         }
       
  9790         
       
  9791     }/*function_dt_to_dword*/
       
  9792     break;
       
  9793 
       
  9794 /****
       
  9795  *DT_TO_LWORD
       
  9796  */
       
  9797     case function_dt_to_lword :
       
  9798     {
       
  9799         symbol_c *last_type_symbol = NULL;
       
  9800 
       
  9801         {
       
  9802             identifier_c param_name("IN");
       
  9803             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9804             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9805             
       
  9806             /* Get the value from a foo(<param_value>) style call */
       
  9807             if (IN_param_value == NULL)
       
  9808               IN_param_value = function_call_param_iterator.next();
       
  9809             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9810             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9811             
       
  9812             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
  9813             {
       
  9814         
       
  9815                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  9816                 s4o.print("(");
       
  9817                 return_type_symbol->accept(*this);
       
  9818                 s4o.print(")__time_to_int(");
       
  9819                 IN_param_value->accept(*this);
       
  9820                 s4o.print(")");
       
  9821                 return NULL;
       
  9822                 
       
  9823             }
       
  9824             
       
  9825             ERROR;
       
  9826         }
       
  9827         
       
  9828     }/*function_dt_to_lword*/
       
  9829     break;
       
  9830 
       
  9831 /****
       
  9832  *STRING_TO_BOOL
       
  9833  */
       
  9834     case function_string_to_bool :
       
  9835     {
       
  9836         symbol_c *last_type_symbol = NULL;
       
  9837 
       
  9838         {
       
  9839             identifier_c param_name("IN");
       
  9840             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9841             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9842             
       
  9843             /* Get the value from a foo(<param_value>) style call */
       
  9844             if (IN_param_value == NULL)
       
  9845               IN_param_value = function_call_param_iterator.next();
       
  9846             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9847             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9848             
       
  9849             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  9850             {
       
  9851         
       
  9852                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  9853                 s4o.print("(");
       
  9854                 return_type_symbol->accept(*this);
       
  9855                 s4o.print(")__string_to_bool(");
       
  9856                 IN_param_value->accept(*this);
       
  9857                 s4o.print(")");
       
  9858                 return NULL;
       
  9859                 
       
  9860             }
       
  9861             
       
  9862             ERROR;
       
  9863         }
       
  9864         
       
  9865     }/*function_string_to_bool*/
       
  9866     break;
       
  9867 
       
  9868 /****
       
  9869  *STRING_TO_SINT
       
  9870  */
       
  9871     case function_string_to_sint :
       
  9872     {
       
  9873         symbol_c *last_type_symbol = NULL;
       
  9874 
       
  9875         {
       
  9876             identifier_c param_name("IN");
       
  9877             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9878             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9879             
       
  9880             /* Get the value from a foo(<param_value>) style call */
       
  9881             if (IN_param_value == NULL)
       
  9882               IN_param_value = function_call_param_iterator.next();
       
  9883             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9884             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9885             
       
  9886             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  9887             {
       
  9888         
       
  9889                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  9890                 s4o.print("(");
       
  9891                 return_type_symbol->accept(*this);
       
  9892                 s4o.print(")__string_to_sint(");
       
  9893                 IN_param_value->accept(*this);
       
  9894                 s4o.print(")");
       
  9895                 return NULL;
       
  9896                 
       
  9897             }
       
  9898             
       
  9899             ERROR;
       
  9900         }
       
  9901         
       
  9902     }/*function_string_to_sint*/
       
  9903     break;
       
  9904 
       
  9905 /****
       
  9906  *STRING_TO_INT
       
  9907  */
       
  9908     case function_string_to_int :
       
  9909     {
       
  9910         symbol_c *last_type_symbol = NULL;
       
  9911 
       
  9912         {
       
  9913             identifier_c param_name("IN");
       
  9914             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9915             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9916             
       
  9917             /* Get the value from a foo(<param_value>) style call */
       
  9918             if (IN_param_value == NULL)
       
  9919               IN_param_value = function_call_param_iterator.next();
       
  9920             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9921             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9922             
       
  9923             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  9924             {
       
  9925         
       
  9926                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  9927                 s4o.print("(");
       
  9928                 return_type_symbol->accept(*this);
       
  9929                 s4o.print(")__string_to_sint(");
       
  9930                 IN_param_value->accept(*this);
       
  9931                 s4o.print(")");
       
  9932                 return NULL;
       
  9933                 
       
  9934             }
       
  9935             
       
  9936             ERROR;
       
  9937         }
       
  9938         
       
  9939     }/*function_string_to_int*/
       
  9940     break;
       
  9941 
       
  9942 /****
       
  9943  *STRING_TO_DINT
       
  9944  */
       
  9945     case function_string_to_dint :
       
  9946     {
       
  9947         symbol_c *last_type_symbol = NULL;
       
  9948 
       
  9949         {
       
  9950             identifier_c param_name("IN");
       
  9951             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9952             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9953             
       
  9954             /* Get the value from a foo(<param_value>) style call */
       
  9955             if (IN_param_value == NULL)
       
  9956               IN_param_value = function_call_param_iterator.next();
       
  9957             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9958             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9959             
       
  9960             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  9961             {
       
  9962         
       
  9963                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  9964                 s4o.print("(");
       
  9965                 return_type_symbol->accept(*this);
       
  9966                 s4o.print(")__string_to_sint(");
       
  9967                 IN_param_value->accept(*this);
       
  9968                 s4o.print(")");
       
  9969                 return NULL;
       
  9970                 
       
  9971             }
       
  9972             
       
  9973             ERROR;
       
  9974         }
       
  9975         
       
  9976     }/*function_string_to_dint*/
       
  9977     break;
       
  9978 
       
  9979 /****
       
  9980  *STRING_TO_LINT
       
  9981  */
       
  9982     case function_string_to_lint :
       
  9983     {
       
  9984         symbol_c *last_type_symbol = NULL;
       
  9985 
       
  9986         {
       
  9987             identifier_c param_name("IN");
       
  9988             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9989             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9990             
       
  9991             /* Get the value from a foo(<param_value>) style call */
       
  9992             if (IN_param_value == NULL)
       
  9993               IN_param_value = function_call_param_iterator.next();
       
  9994             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9995             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9996             
       
  9997             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
  9998             {
       
  9999         
       
 10000                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 10001                 s4o.print("(");
       
 10002                 return_type_symbol->accept(*this);
       
 10003                 s4o.print(")__string_to_sint(");
       
 10004                 IN_param_value->accept(*this);
       
 10005                 s4o.print(")");
       
 10006                 return NULL;
       
 10007                 
       
 10008             }
       
 10009             
       
 10010             ERROR;
       
 10011         }
       
 10012         
       
 10013     }/*function_string_to_lint*/
       
 10014     break;
       
 10015 
       
 10016 /****
       
 10017  *STRING_TO_USINT
       
 10018  */
       
 10019     case function_string_to_usint :
       
 10020     {
       
 10021         symbol_c *last_type_symbol = NULL;
       
 10022 
       
 10023         {
       
 10024             identifier_c param_name("IN");
       
 10025             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10026             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10027             
       
 10028             /* Get the value from a foo(<param_value>) style call */
       
 10029             if (IN_param_value == NULL)
       
 10030               IN_param_value = function_call_param_iterator.next();
       
 10031             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10032             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10033             
       
 10034             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
 10035             {
       
 10036         
       
 10037                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 10038                 s4o.print("(");
       
 10039                 return_type_symbol->accept(*this);
       
 10040                 s4o.print(")__string_to_uint(");
       
 10041                 IN_param_value->accept(*this);
       
 10042                 s4o.print(")");
       
 10043                 return NULL;
       
 10044                 
       
 10045             }
       
 10046             
       
 10047             ERROR;
       
 10048         }
       
 10049         
       
 10050     }/*function_string_to_usint*/
       
 10051     break;
       
 10052 
       
 10053 /****
       
 10054  *STRING_TO_UINT
       
 10055  */
       
 10056     case function_string_to_uint :
       
 10057     {
       
 10058         symbol_c *last_type_symbol = NULL;
       
 10059 
       
 10060         {
       
 10061             identifier_c param_name("IN");
       
 10062             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10063             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10064             
       
 10065             /* Get the value from a foo(<param_value>) style call */
       
 10066             if (IN_param_value == NULL)
       
 10067               IN_param_value = function_call_param_iterator.next();
       
 10068             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10069             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10070             
       
 10071             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
 10072             {
       
 10073         
       
 10074                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 10075                 s4o.print("(");
       
 10076                 return_type_symbol->accept(*this);
       
 10077                 s4o.print(")__string_to_uint(");
       
 10078                 IN_param_value->accept(*this);
       
 10079                 s4o.print(")");
       
 10080                 return NULL;
       
 10081                 
       
 10082             }
       
 10083             
       
 10084             ERROR;
       
 10085         }
       
 10086         
       
 10087     }/*function_string_to_uint*/
       
 10088     break;
       
 10089 
       
 10090 /****
       
 10091  *STRING_TO_UDINT
       
 10092  */
       
 10093     case function_string_to_udint :
       
 10094     {
       
 10095         symbol_c *last_type_symbol = NULL;
       
 10096 
       
 10097         {
       
 10098             identifier_c param_name("IN");
       
 10099             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10100             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10101             
       
 10102             /* Get the value from a foo(<param_value>) style call */
       
 10103             if (IN_param_value == NULL)
       
 10104               IN_param_value = function_call_param_iterator.next();
       
 10105             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10106             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10107             
       
 10108             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
 10109             {
       
 10110         
       
 10111                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 10112                 s4o.print("(");
       
 10113                 return_type_symbol->accept(*this);
       
 10114                 s4o.print(")__string_to_uint(");
       
 10115                 IN_param_value->accept(*this);
       
 10116                 s4o.print(")");
       
 10117                 return NULL;
       
 10118                 
       
 10119             }
       
 10120             
       
 10121             ERROR;
       
 10122         }
       
 10123         
       
 10124     }/*function_string_to_udint*/
       
 10125     break;
       
 10126 
       
 10127 /****
       
 10128  *STRING_TO_ULINT
       
 10129  */
       
 10130     case function_string_to_ulint :
       
 10131     {
       
 10132         symbol_c *last_type_symbol = NULL;
       
 10133 
       
 10134         {
       
 10135             identifier_c param_name("IN");
       
 10136             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10137             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10138             
       
 10139             /* Get the value from a foo(<param_value>) style call */
       
 10140             if (IN_param_value == NULL)
       
 10141               IN_param_value = function_call_param_iterator.next();
       
 10142             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10143             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10144             
       
 10145             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
 10146             {
       
 10147         
       
 10148                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 10149                 s4o.print("(");
       
 10150                 return_type_symbol->accept(*this);
       
 10151                 s4o.print(")__string_to_uint(");
       
 10152                 IN_param_value->accept(*this);
       
 10153                 s4o.print(")");
       
 10154                 return NULL;
       
 10155                 
       
 10156             }
       
 10157             
       
 10158             ERROR;
       
 10159         }
       
 10160         
       
 10161     }/*function_string_to_ulint*/
       
 10162     break;
       
 10163 
       
 10164 /****
       
 10165  *STRING_TO_REAL
       
 10166  */
       
 10167     case function_string_to_real :
       
 10168     {
       
 10169         symbol_c *last_type_symbol = NULL;
       
 10170 
       
 10171         {
       
 10172             identifier_c param_name("IN");
       
 10173             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10174             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10175             
       
 10176             /* Get the value from a foo(<param_value>) style call */
       
 10177             if (IN_param_value == NULL)
       
 10178               IN_param_value = function_call_param_iterator.next();
       
 10179             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10180             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10181             
       
 10182             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
 10183             {
       
 10184         
       
 10185                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 10186                 s4o.print("(");
       
 10187                 return_type_symbol->accept(*this);
       
 10188                 s4o.print(")__string_to_real(");
       
 10189                 IN_param_value->accept(*this);
       
 10190                 s4o.print(")");
       
 10191                 return NULL;
       
 10192                 
       
 10193             }
       
 10194             
       
 10195             ERROR;
       
 10196         }
       
 10197         
       
 10198     }/*function_string_to_real*/
       
 10199     break;
       
 10200 
       
 10201 /****
       
 10202  *STRING_TO_LREAL
       
 10203  */
       
 10204     case function_string_to_lreal :
       
 10205     {
       
 10206         symbol_c *last_type_symbol = NULL;
       
 10207 
       
 10208         {
       
 10209             identifier_c param_name("IN");
       
 10210             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10211             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10212             
       
 10213             /* Get the value from a foo(<param_value>) style call */
       
 10214             if (IN_param_value == NULL)
       
 10215               IN_param_value = function_call_param_iterator.next();
       
 10216             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10217             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10218             
       
 10219             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
 10220             {
       
 10221         
       
 10222                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 10223                 s4o.print("(");
       
 10224                 return_type_symbol->accept(*this);
       
 10225                 s4o.print(")__string_to_real(");
       
 10226                 IN_param_value->accept(*this);
       
 10227                 s4o.print(")");
       
 10228                 return NULL;
       
 10229                 
       
 10230             }
       
 10231             
       
 10232             ERROR;
       
 10233         }
       
 10234         
       
 10235     }/*function_string_to_lreal*/
       
 10236     break;
       
 10237 
       
 10238 /****
       
 10239  *STRING_TO_TIME
       
 10240  */
       
 10241     case function_string_to_time :
       
 10242     {
       
 10243         symbol_c *last_type_symbol = NULL;
       
 10244 
       
 10245         {
       
 10246             identifier_c param_name("IN");
       
 10247             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10248             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10249             
       
 10250             /* Get the value from a foo(<param_value>) style call */
       
 10251             if (IN_param_value == NULL)
       
 10252               IN_param_value = function_call_param_iterator.next();
       
 10253             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10254             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10255             
       
 10256             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
 10257             {
       
 10258         
       
 10259                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 10260                 s4o.print("(");
       
 10261                 return_type_symbol->accept(*this);
       
 10262                 s4o.print(")__string_to_time(");
       
 10263                 IN_param_value->accept(*this);
       
 10264                 s4o.print(")");
       
 10265                 return NULL;
       
 10266                 
       
 10267             }
       
 10268             
       
 10269             ERROR;
       
 10270         }
       
 10271         
       
 10272     }/*function_string_to_time*/
       
 10273     break;
       
 10274 
       
 10275 /****
       
 10276  *STRING_TO_DATE
       
 10277  */
       
 10278     case function_string_to_date :
       
 10279     {
       
 10280         symbol_c *last_type_symbol = NULL;
       
 10281 
       
 10282         {
       
 10283             identifier_c param_name("IN");
       
 10284             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10285             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10286             
       
 10287             /* Get the value from a foo(<param_value>) style call */
       
 10288             if (IN_param_value == NULL)
       
 10289               IN_param_value = function_call_param_iterator.next();
       
 10290             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10291             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10292             
       
 10293             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
 10294             {
       
 10295         
       
 10296                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 10297                 s4o.print("(");
       
 10298                 return_type_symbol->accept(*this);
       
 10299                 s4o.print(")__string_to_time(");
       
 10300                 IN_param_value->accept(*this);
       
 10301                 s4o.print(")");
       
 10302                 return NULL;
       
 10303                 
       
 10304             }
       
 10305             
       
 10306             ERROR;
       
 10307         }
       
 10308         
       
 10309     }/*function_string_to_date*/
       
 10310     break;
       
 10311 
       
 10312 /****
       
 10313  *STRING_TO_TOD
       
 10314  */
       
 10315     case function_string_to_tod :
       
 10316     {
       
 10317         symbol_c *last_type_symbol = NULL;
       
 10318 
       
 10319         {
       
 10320             identifier_c param_name("IN");
       
 10321             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10322             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10323             
       
 10324             /* Get the value from a foo(<param_value>) style call */
       
 10325             if (IN_param_value == NULL)
       
 10326               IN_param_value = function_call_param_iterator.next();
       
 10327             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10328             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10329             
       
 10330             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
 10331             {
       
 10332         
       
 10333                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 10334                 s4o.print("(");
       
 10335                 return_type_symbol->accept(*this);
       
 10336                 s4o.print(")__string_to_time(");
       
 10337                 IN_param_value->accept(*this);
       
 10338                 s4o.print(")");
       
 10339                 return NULL;
       
 10340                 
       
 10341             }
       
 10342             
       
 10343             ERROR;
       
 10344         }
       
 10345         
       
 10346     }/*function_string_to_tod*/
       
 10347     break;
       
 10348 
       
 10349 /****
       
 10350  *STRING_TO_DT
       
 10351  */
       
 10352     case function_string_to_dt :
       
 10353     {
       
 10354         symbol_c *last_type_symbol = NULL;
       
 10355 
       
 10356         {
       
 10357             identifier_c param_name("IN");
       
 10358             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10359             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10360             
       
 10361             /* Get the value from a foo(<param_value>) style call */
       
 10362             if (IN_param_value == NULL)
       
 10363               IN_param_value = function_call_param_iterator.next();
       
 10364             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10365             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10366             
       
 10367             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
 10368             {
       
 10369         
       
 10370                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 10371                 s4o.print("(");
       
 10372                 return_type_symbol->accept(*this);
       
 10373                 s4o.print(")__string_to_time(");
       
 10374                 IN_param_value->accept(*this);
       
 10375                 s4o.print(")");
       
 10376                 return NULL;
       
 10377                 
       
 10378             }
       
 10379             
       
 10380             ERROR;
       
 10381         }
       
 10382         
       
 10383     }/*function_string_to_dt*/
       
 10384     break;
       
 10385 
       
 10386 /****
       
 10387  *STRING_TO_BYTE
       
 10388  */
       
 10389     case function_string_to_byte :
       
 10390     {
       
 10391         symbol_c *last_type_symbol = NULL;
       
 10392 
       
 10393         {
       
 10394             identifier_c param_name("IN");
       
 10395             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10396             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10397             
       
 10398             /* Get the value from a foo(<param_value>) style call */
       
 10399             if (IN_param_value == NULL)
       
 10400               IN_param_value = function_call_param_iterator.next();
       
 10401             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10402             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10403             
       
 10404             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
 10405             {
       
 10406         
       
 10407                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 10408                 s4o.print("(");
       
 10409                 return_type_symbol->accept(*this);
       
 10410                 s4o.print(")__string_to_bit(");
       
 10411                 IN_param_value->accept(*this);
       
 10412                 s4o.print(")");
       
 10413                 return NULL;
       
 10414                 
       
 10415             }
       
 10416             
       
 10417             ERROR;
       
 10418         }
       
 10419         
       
 10420     }/*function_string_to_byte*/
       
 10421     break;
       
 10422 
       
 10423 /****
       
 10424  *STRING_TO_WORD
       
 10425  */
       
 10426     case function_string_to_word :
       
 10427     {
       
 10428         symbol_c *last_type_symbol = NULL;
       
 10429 
       
 10430         {
       
 10431             identifier_c param_name("IN");
       
 10432             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10433             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10434             
       
 10435             /* Get the value from a foo(<param_value>) style call */
       
 10436             if (IN_param_value == NULL)
       
 10437               IN_param_value = function_call_param_iterator.next();
       
 10438             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10439             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10440             
       
 10441             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
 10442             {
       
 10443         
       
 10444                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 10445                 s4o.print("(");
       
 10446                 return_type_symbol->accept(*this);
       
 10447                 s4o.print(")__string_to_bit(");
       
 10448                 IN_param_value->accept(*this);
       
 10449                 s4o.print(")");
       
 10450                 return NULL;
       
 10451                 
       
 10452             }
       
 10453             
       
 10454             ERROR;
       
 10455         }
       
 10456         
       
 10457     }/*function_string_to_word*/
       
 10458     break;
       
 10459 
       
 10460 /****
       
 10461  *STRING_TO_DWORD
       
 10462  */
       
 10463     case function_string_to_dword :
       
 10464     {
       
 10465         symbol_c *last_type_symbol = NULL;
       
 10466 
       
 10467         {
       
 10468             identifier_c param_name("IN");
       
 10469             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10470             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10471             
       
 10472             /* Get the value from a foo(<param_value>) style call */
       
 10473             if (IN_param_value == NULL)
       
 10474               IN_param_value = function_call_param_iterator.next();
       
 10475             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10476             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10477             
       
 10478             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
 10479             {
       
 10480         
       
 10481                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 10482                 s4o.print("(");
       
 10483                 return_type_symbol->accept(*this);
       
 10484                 s4o.print(")__string_to_bit(");
       
 10485                 IN_param_value->accept(*this);
       
 10486                 s4o.print(")");
       
 10487                 return NULL;
       
 10488                 
       
 10489             }
       
 10490             
       
 10491             ERROR;
       
 10492         }
       
 10493         
       
 10494     }/*function_string_to_dword*/
       
 10495     break;
       
 10496 
       
 10497 /****
       
 10498  *STRING_TO_LWORD
       
 10499  */
       
 10500     case function_string_to_lword :
       
 10501     {
       
 10502         symbol_c *last_type_symbol = NULL;
       
 10503 
       
 10504         {
       
 10505             identifier_c param_name("IN");
       
 10506             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10507             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10508             
       
 10509             /* Get the value from a foo(<param_value>) style call */
       
 10510             if (IN_param_value == NULL)
       
 10511               IN_param_value = function_call_param_iterator.next();
       
 10512             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10513             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10514             
       
 10515             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
       
 10516             {
       
 10517         
       
 10518                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 10519                 s4o.print("(");
       
 10520                 return_type_symbol->accept(*this);
       
 10521                 s4o.print(")__string_to_bit(");
       
 10522                 IN_param_value->accept(*this);
       
 10523                 s4o.print(")");
       
 10524                 return NULL;
       
 10525                 
       
 10526             }
       
 10527             
       
 10528             ERROR;
       
 10529         }
       
 10530         
       
 10531     }/*function_string_to_lword*/
       
 10532     break;
       
 10533 
       
 10534 /****
       
 10535  *BYTE_TO_BOOL
       
 10536  */
       
 10537     case function_byte_to_bool :
       
 10538     {
       
 10539         symbol_c *last_type_symbol = NULL;
       
 10540 
       
 10541         {
       
 10542             identifier_c param_name("IN");
       
 10543             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10544             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10545             
       
 10546             /* Get the value from a foo(<param_value>) style call */
       
 10547             if (IN_param_value == NULL)
       
 10548               IN_param_value = function_call_param_iterator.next();
       
 10549             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10550             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10551             
       
 10552             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 10553             {
       
 10554         
       
 10555                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 10556                 s4o.print("(");
       
 10557                 return_type_symbol->accept(*this);
       
 10558                 s4o.print(")");
       
 10559                 IN_param_value->accept(*this);
       
 10560                 return NULL;
       
 10561                 
       
 10562             }
       
 10563             
       
 10564             ERROR;
       
 10565         }
       
 10566         
       
 10567     }/*function_byte_to_bool*/
       
 10568     break;
       
 10569 
       
 10570 /****
       
 10571  *BYTE_TO_SINT
       
 10572  */
       
 10573     case function_byte_to_sint :
       
 10574     {
       
 10575         symbol_c *last_type_symbol = NULL;
       
 10576 
       
 10577         {
       
 10578             identifier_c param_name("IN");
       
 10579             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10580             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10581             
       
 10582             /* Get the value from a foo(<param_value>) style call */
       
 10583             if (IN_param_value == NULL)
       
 10584               IN_param_value = function_call_param_iterator.next();
       
 10585             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10586             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10587             
       
 10588             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 10589             {
       
 10590         
       
 10591                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 10592                 s4o.print("(");
       
 10593                 return_type_symbol->accept(*this);
       
 10594                 s4o.print(")");
       
 10595                 IN_param_value->accept(*this);
       
 10596                 return NULL;
       
 10597                 
       
 10598             }
       
 10599             
       
 10600             ERROR;
       
 10601         }
       
 10602         
       
 10603     }/*function_byte_to_sint*/
       
 10604     break;
       
 10605 
       
 10606 /****
       
 10607  *BYTE_TO_INT
       
 10608  */
       
 10609     case function_byte_to_int :
       
 10610     {
       
 10611         symbol_c *last_type_symbol = NULL;
       
 10612 
       
 10613         {
       
 10614             identifier_c param_name("IN");
       
 10615             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10616             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10617             
       
 10618             /* Get the value from a foo(<param_value>) style call */
       
 10619             if (IN_param_value == NULL)
       
 10620               IN_param_value = function_call_param_iterator.next();
       
 10621             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10622             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10623             
       
 10624             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 10625             {
       
 10626         
       
 10627                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 10628                 s4o.print("(");
       
 10629                 return_type_symbol->accept(*this);
       
 10630                 s4o.print(")");
       
 10631                 IN_param_value->accept(*this);
       
 10632                 return NULL;
       
 10633                 
       
 10634             }
       
 10635             
       
 10636             ERROR;
       
 10637         }
       
 10638         
       
 10639     }/*function_byte_to_int*/
       
 10640     break;
       
 10641 
       
 10642 /****
       
 10643  *BYTE_TO_DINT
       
 10644  */
       
 10645     case function_byte_to_dint :
       
 10646     {
       
 10647         symbol_c *last_type_symbol = NULL;
       
 10648 
       
 10649         {
       
 10650             identifier_c param_name("IN");
       
 10651             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10652             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10653             
       
 10654             /* Get the value from a foo(<param_value>) style call */
       
 10655             if (IN_param_value == NULL)
       
 10656               IN_param_value = function_call_param_iterator.next();
       
 10657             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10658             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10659             
       
 10660             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 10661             {
       
 10662         
       
 10663                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 10664                 s4o.print("(");
       
 10665                 return_type_symbol->accept(*this);
       
 10666                 s4o.print(")");
       
 10667                 IN_param_value->accept(*this);
       
 10668                 return NULL;
       
 10669                 
       
 10670             }
       
 10671             
       
 10672             ERROR;
       
 10673         }
       
 10674         
       
 10675     }/*function_byte_to_dint*/
       
 10676     break;
       
 10677 
       
 10678 /****
       
 10679  *BYTE_TO_LINT
       
 10680  */
       
 10681     case function_byte_to_lint :
       
 10682     {
       
 10683         symbol_c *last_type_symbol = NULL;
       
 10684 
       
 10685         {
       
 10686             identifier_c param_name("IN");
       
 10687             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10688             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10689             
       
 10690             /* Get the value from a foo(<param_value>) style call */
       
 10691             if (IN_param_value == NULL)
       
 10692               IN_param_value = function_call_param_iterator.next();
       
 10693             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10694             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10695             
       
 10696             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 10697             {
       
 10698         
       
 10699                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 10700                 s4o.print("(");
       
 10701                 return_type_symbol->accept(*this);
       
 10702                 s4o.print(")");
       
 10703                 IN_param_value->accept(*this);
       
 10704                 return NULL;
       
 10705                 
       
 10706             }
       
 10707             
       
 10708             ERROR;
       
 10709         }
       
 10710         
       
 10711     }/*function_byte_to_lint*/
       
 10712     break;
       
 10713 
       
 10714 /****
       
 10715  *BYTE_TO_USINT
       
 10716  */
       
 10717     case function_byte_to_usint :
       
 10718     {
       
 10719         symbol_c *last_type_symbol = NULL;
       
 10720 
       
 10721         {
       
 10722             identifier_c param_name("IN");
       
 10723             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10724             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10725             
       
 10726             /* Get the value from a foo(<param_value>) style call */
       
 10727             if (IN_param_value == NULL)
       
 10728               IN_param_value = function_call_param_iterator.next();
       
 10729             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10730             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10731             
       
 10732             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 10733             {
       
 10734         
       
 10735                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 10736                 s4o.print("(");
       
 10737                 return_type_symbol->accept(*this);
       
 10738                 s4o.print(")");
       
 10739                 IN_param_value->accept(*this);
       
 10740                 return NULL;
       
 10741                 
       
 10742             }
       
 10743             
       
 10744             ERROR;
       
 10745         }
       
 10746         
       
 10747     }/*function_byte_to_usint*/
       
 10748     break;
       
 10749 
       
 10750 /****
       
 10751  *BYTE_TO_UINT
       
 10752  */
       
 10753     case function_byte_to_uint :
       
 10754     {
       
 10755         symbol_c *last_type_symbol = NULL;
       
 10756 
       
 10757         {
       
 10758             identifier_c param_name("IN");
       
 10759             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10760             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10761             
       
 10762             /* Get the value from a foo(<param_value>) style call */
       
 10763             if (IN_param_value == NULL)
       
 10764               IN_param_value = function_call_param_iterator.next();
       
 10765             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10766             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10767             
       
 10768             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 10769             {
       
 10770         
       
 10771                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 10772                 s4o.print("(");
       
 10773                 return_type_symbol->accept(*this);
       
 10774                 s4o.print(")");
       
 10775                 IN_param_value->accept(*this);
       
 10776                 return NULL;
       
 10777                 
       
 10778             }
       
 10779             
       
 10780             ERROR;
       
 10781         }
       
 10782         
       
 10783     }/*function_byte_to_uint*/
       
 10784     break;
       
 10785 
       
 10786 /****
       
 10787  *BYTE_TO_UDINT
       
 10788  */
       
 10789     case function_byte_to_udint :
       
 10790     {
       
 10791         symbol_c *last_type_symbol = NULL;
       
 10792 
       
 10793         {
       
 10794             identifier_c param_name("IN");
       
 10795             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10796             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10797             
       
 10798             /* Get the value from a foo(<param_value>) style call */
       
 10799             if (IN_param_value == NULL)
       
 10800               IN_param_value = function_call_param_iterator.next();
       
 10801             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10802             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10803             
       
 10804             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 10805             {
       
 10806         
       
 10807                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 10808                 s4o.print("(");
       
 10809                 return_type_symbol->accept(*this);
       
 10810                 s4o.print(")");
       
 10811                 IN_param_value->accept(*this);
       
 10812                 return NULL;
       
 10813                 
       
 10814             }
       
 10815             
       
 10816             ERROR;
       
 10817         }
       
 10818         
       
 10819     }/*function_byte_to_udint*/
       
 10820     break;
       
 10821 
       
 10822 /****
       
 10823  *BYTE_TO_ULINT
       
 10824  */
       
 10825     case function_byte_to_ulint :
       
 10826     {
       
 10827         symbol_c *last_type_symbol = NULL;
       
 10828 
       
 10829         {
       
 10830             identifier_c param_name("IN");
       
 10831             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10832             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10833             
       
 10834             /* Get the value from a foo(<param_value>) style call */
       
 10835             if (IN_param_value == NULL)
       
 10836               IN_param_value = function_call_param_iterator.next();
       
 10837             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10838             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10839             
       
 10840             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 10841             {
       
 10842         
       
 10843                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 10844                 s4o.print("(");
       
 10845                 return_type_symbol->accept(*this);
       
 10846                 s4o.print(")");
       
 10847                 IN_param_value->accept(*this);
       
 10848                 return NULL;
       
 10849                 
       
 10850             }
       
 10851             
       
 10852             ERROR;
       
 10853         }
       
 10854         
       
 10855     }/*function_byte_to_ulint*/
       
 10856     break;
       
 10857 
       
 10858 /****
       
 10859  *BYTE_TO_REAL
       
 10860  */
       
 10861     case function_byte_to_real :
       
 10862     {
       
 10863         symbol_c *last_type_symbol = NULL;
       
 10864 
       
 10865         {
       
 10866             identifier_c param_name("IN");
       
 10867             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10868             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10869             
       
 10870             /* Get the value from a foo(<param_value>) style call */
       
 10871             if (IN_param_value == NULL)
       
 10872               IN_param_value = function_call_param_iterator.next();
       
 10873             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10874             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10875             
       
 10876             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 10877             {
       
 10878         
       
 10879                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 10880                 s4o.print("(");
       
 10881                 return_type_symbol->accept(*this);
       
 10882                 s4o.print(")");
       
 10883                 IN_param_value->accept(*this);
       
 10884                 return NULL;
       
 10885                 
       
 10886             }
       
 10887             
       
 10888             ERROR;
       
 10889         }
       
 10890         
       
 10891     }/*function_byte_to_real*/
       
 10892     break;
       
 10893 
       
 10894 /****
       
 10895  *BYTE_TO_LREAL
       
 10896  */
       
 10897     case function_byte_to_lreal :
       
 10898     {
       
 10899         symbol_c *last_type_symbol = NULL;
       
 10900 
       
 10901         {
       
 10902             identifier_c param_name("IN");
       
 10903             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10904             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10905             
       
 10906             /* Get the value from a foo(<param_value>) style call */
       
 10907             if (IN_param_value == NULL)
       
 10908               IN_param_value = function_call_param_iterator.next();
       
 10909             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10910             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10911             
       
 10912             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 10913             {
       
 10914         
       
 10915                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 10916                 s4o.print("(");
       
 10917                 return_type_symbol->accept(*this);
       
 10918                 s4o.print(")");
       
 10919                 IN_param_value->accept(*this);
       
 10920                 return NULL;
       
 10921                 
       
 10922             }
       
 10923             
       
 10924             ERROR;
       
 10925         }
       
 10926         
       
 10927     }/*function_byte_to_lreal*/
       
 10928     break;
       
 10929 
       
 10930 /****
       
 10931  *BYTE_TO_TIME
       
 10932  */
       
 10933     case function_byte_to_time :
       
 10934     {
       
 10935         symbol_c *last_type_symbol = NULL;
       
 10936 
       
 10937         {
       
 10938             identifier_c param_name("IN");
       
 10939             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10940             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10941             
       
 10942             /* Get the value from a foo(<param_value>) style call */
       
 10943             if (IN_param_value == NULL)
       
 10944               IN_param_value = function_call_param_iterator.next();
       
 10945             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10946             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10947             
       
 10948             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 10949             {
       
 10950         
       
 10951                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 10952                 s4o.print("(");
       
 10953                 return_type_symbol->accept(*this);
       
 10954                 s4o.print(")__int_to_time(");
       
 10955                 IN_param_value->accept(*this);
       
 10956                 s4o.print(")");
       
 10957                 return NULL;
       
 10958                 
       
 10959             }
       
 10960             
       
 10961             ERROR;
       
 10962         }
       
 10963         
       
 10964     }/*function_byte_to_time*/
       
 10965     break;
       
 10966 
       
 10967 /****
       
 10968  *BYTE_TO_DATE
       
 10969  */
       
 10970     case function_byte_to_date :
       
 10971     {
       
 10972         symbol_c *last_type_symbol = NULL;
       
 10973 
       
 10974         {
       
 10975             identifier_c param_name("IN");
       
 10976             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10977             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10978             
       
 10979             /* Get the value from a foo(<param_value>) style call */
       
 10980             if (IN_param_value == NULL)
       
 10981               IN_param_value = function_call_param_iterator.next();
       
 10982             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10983             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10984             
       
 10985             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 10986             {
       
 10987         
       
 10988                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 10989                 s4o.print("(");
       
 10990                 return_type_symbol->accept(*this);
       
 10991                 s4o.print(")__int_to_time(");
       
 10992                 IN_param_value->accept(*this);
       
 10993                 s4o.print(")");
       
 10994                 return NULL;
       
 10995                 
       
 10996             }
       
 10997             
       
 10998             ERROR;
       
 10999         }
       
 11000         
       
 11001     }/*function_byte_to_date*/
       
 11002     break;
       
 11003 
       
 11004 /****
       
 11005  *BYTE_TO_TOD
       
 11006  */
       
 11007     case function_byte_to_tod :
       
 11008     {
       
 11009         symbol_c *last_type_symbol = NULL;
       
 11010 
       
 11011         {
       
 11012             identifier_c param_name("IN");
       
 11013             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11014             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11015             
       
 11016             /* Get the value from a foo(<param_value>) style call */
       
 11017             if (IN_param_value == NULL)
       
 11018               IN_param_value = function_call_param_iterator.next();
       
 11019             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11020             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11021             
       
 11022             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 11023             {
       
 11024         
       
 11025                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 11026                 s4o.print("(");
       
 11027                 return_type_symbol->accept(*this);
       
 11028                 s4o.print(")__int_to_time(");
       
 11029                 IN_param_value->accept(*this);
       
 11030                 s4o.print(")");
       
 11031                 return NULL;
       
 11032                 
       
 11033             }
       
 11034             
       
 11035             ERROR;
       
 11036         }
       
 11037         
       
 11038     }/*function_byte_to_tod*/
       
 11039     break;
       
 11040 
       
 11041 /****
       
 11042  *BYTE_TO_DT
       
 11043  */
       
 11044     case function_byte_to_dt :
       
 11045     {
       
 11046         symbol_c *last_type_symbol = NULL;
       
 11047 
       
 11048         {
       
 11049             identifier_c param_name("IN");
       
 11050             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11051             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11052             
       
 11053             /* Get the value from a foo(<param_value>) style call */
       
 11054             if (IN_param_value == NULL)
       
 11055               IN_param_value = function_call_param_iterator.next();
       
 11056             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11057             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11058             
       
 11059             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 11060             {
       
 11061         
       
 11062                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 11063                 s4o.print("(");
       
 11064                 return_type_symbol->accept(*this);
       
 11065                 s4o.print(")__int_to_time(");
       
 11066                 IN_param_value->accept(*this);
       
 11067                 s4o.print(")");
       
 11068                 return NULL;
       
 11069                 
       
 11070             }
       
 11071             
       
 11072             ERROR;
       
 11073         }
       
 11074         
       
 11075     }/*function_byte_to_dt*/
       
 11076     break;
       
 11077 
       
 11078 /****
       
 11079  *BYTE_TO_STRING
       
 11080  */
       
 11081     case function_byte_to_string :
       
 11082     {
       
 11083         symbol_c *last_type_symbol = NULL;
       
 11084 
       
 11085         {
       
 11086             identifier_c param_name("IN");
       
 11087             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11088             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11089             
       
 11090             /* Get the value from a foo(<param_value>) style call */
       
 11091             if (IN_param_value == NULL)
       
 11092               IN_param_value = function_call_param_iterator.next();
       
 11093             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11094             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11095             
       
 11096             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 11097             {
       
 11098         
       
 11099                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 11100                 s4o.print("(");
       
 11101                 return_type_symbol->accept(*this);
       
 11102                 s4o.print(")__bit_to_string(");
       
 11103                 IN_param_value->accept(*this);
       
 11104                 s4o.print(")");
       
 11105                 return NULL;
       
 11106                 
       
 11107             }
       
 11108             
       
 11109             ERROR;
       
 11110         }
       
 11111         
       
 11112     }/*function_byte_to_string*/
       
 11113     break;
       
 11114 
       
 11115 /****
       
 11116  *BYTE_TO_WORD
       
 11117  */
       
 11118     case function_byte_to_word :
       
 11119     {
       
 11120         symbol_c *last_type_symbol = NULL;
       
 11121 
       
 11122         {
       
 11123             identifier_c param_name("IN");
       
 11124             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11125             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11126             
       
 11127             /* Get the value from a foo(<param_value>) style call */
       
 11128             if (IN_param_value == NULL)
       
 11129               IN_param_value = function_call_param_iterator.next();
       
 11130             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11131             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11132             
       
 11133             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 11134             {
       
 11135         
       
 11136                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 11137                 s4o.print("(");
       
 11138                 return_type_symbol->accept(*this);
       
 11139                 s4o.print(")");
       
 11140                 IN_param_value->accept(*this);
       
 11141                 return NULL;
       
 11142                 
       
 11143             }
       
 11144             
       
 11145             ERROR;
       
 11146         }
       
 11147         
       
 11148     }/*function_byte_to_word*/
       
 11149     break;
       
 11150 
       
 11151 /****
       
 11152  *BYTE_TO_DWORD
       
 11153  */
       
 11154     case function_byte_to_dword :
       
 11155     {
       
 11156         symbol_c *last_type_symbol = NULL;
       
 11157 
       
 11158         {
       
 11159             identifier_c param_name("IN");
       
 11160             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11161             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11162             
       
 11163             /* Get the value from a foo(<param_value>) style call */
       
 11164             if (IN_param_value == NULL)
       
 11165               IN_param_value = function_call_param_iterator.next();
       
 11166             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11167             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11168             
       
 11169             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 11170             {
       
 11171         
       
 11172                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 11173                 s4o.print("(");
       
 11174                 return_type_symbol->accept(*this);
       
 11175                 s4o.print(")");
       
 11176                 IN_param_value->accept(*this);
       
 11177                 return NULL;
       
 11178                 
       
 11179             }
       
 11180             
       
 11181             ERROR;
       
 11182         }
       
 11183         
       
 11184     }/*function_byte_to_dword*/
       
 11185     break;
       
 11186 
       
 11187 /****
       
 11188  *BYTE_TO_LWORD
       
 11189  */
       
 11190     case function_byte_to_lword :
       
 11191     {
       
 11192         symbol_c *last_type_symbol = NULL;
       
 11193 
       
 11194         {
       
 11195             identifier_c param_name("IN");
       
 11196             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11197             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11198             
       
 11199             /* Get the value from a foo(<param_value>) style call */
       
 11200             if (IN_param_value == NULL)
       
 11201               IN_param_value = function_call_param_iterator.next();
       
 11202             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11203             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11204             
       
 11205             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 11206             {
       
 11207         
       
 11208                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 11209                 s4o.print("(");
       
 11210                 return_type_symbol->accept(*this);
       
 11211                 s4o.print(")");
       
 11212                 IN_param_value->accept(*this);
       
 11213                 return NULL;
       
 11214                 
       
 11215             }
       
 11216             
       
 11217             ERROR;
       
 11218         }
       
 11219         
       
 11220     }/*function_byte_to_lword*/
       
 11221     break;
       
 11222 
       
 11223 /****
       
 11224  *WORD_TO_BOOL
       
 11225  */
       
 11226     case function_word_to_bool :
       
 11227     {
       
 11228         symbol_c *last_type_symbol = NULL;
       
 11229 
       
 11230         {
       
 11231             identifier_c param_name("IN");
       
 11232             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11233             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11234             
       
 11235             /* Get the value from a foo(<param_value>) style call */
       
 11236             if (IN_param_value == NULL)
       
 11237               IN_param_value = function_call_param_iterator.next();
       
 11238             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11239             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11240             
       
 11241             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11242             {
       
 11243         
       
 11244                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 11245                 s4o.print("(");
       
 11246                 return_type_symbol->accept(*this);
       
 11247                 s4o.print(")");
       
 11248                 IN_param_value->accept(*this);
       
 11249                 return NULL;
       
 11250                 
       
 11251             }
       
 11252             
       
 11253             ERROR;
       
 11254         }
       
 11255         
       
 11256     }/*function_word_to_bool*/
       
 11257     break;
       
 11258 
       
 11259 /****
       
 11260  *WORD_TO_SINT
       
 11261  */
       
 11262     case function_word_to_sint :
       
 11263     {
       
 11264         symbol_c *last_type_symbol = NULL;
       
 11265 
       
 11266         {
       
 11267             identifier_c param_name("IN");
       
 11268             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11269             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11270             
       
 11271             /* Get the value from a foo(<param_value>) style call */
       
 11272             if (IN_param_value == NULL)
       
 11273               IN_param_value = function_call_param_iterator.next();
       
 11274             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11275             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11276             
       
 11277             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11278             {
       
 11279         
       
 11280                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 11281                 s4o.print("(");
       
 11282                 return_type_symbol->accept(*this);
       
 11283                 s4o.print(")");
       
 11284                 IN_param_value->accept(*this);
       
 11285                 return NULL;
       
 11286                 
       
 11287             }
       
 11288             
       
 11289             ERROR;
       
 11290         }
       
 11291         
       
 11292     }/*function_word_to_sint*/
       
 11293     break;
       
 11294 
       
 11295 /****
       
 11296  *WORD_TO_INT
       
 11297  */
       
 11298     case function_word_to_int :
       
 11299     {
       
 11300         symbol_c *last_type_symbol = NULL;
       
 11301 
       
 11302         {
       
 11303             identifier_c param_name("IN");
       
 11304             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11305             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11306             
       
 11307             /* Get the value from a foo(<param_value>) style call */
       
 11308             if (IN_param_value == NULL)
       
 11309               IN_param_value = function_call_param_iterator.next();
       
 11310             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11311             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11312             
       
 11313             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11314             {
       
 11315         
       
 11316                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 11317                 s4o.print("(");
       
 11318                 return_type_symbol->accept(*this);
       
 11319                 s4o.print(")");
       
 11320                 IN_param_value->accept(*this);
       
 11321                 return NULL;
       
 11322                 
       
 11323             }
       
 11324             
       
 11325             ERROR;
       
 11326         }
       
 11327         
       
 11328     }/*function_word_to_int*/
       
 11329     break;
       
 11330 
       
 11331 /****
       
 11332  *WORD_TO_DINT
       
 11333  */
       
 11334     case function_word_to_dint :
       
 11335     {
       
 11336         symbol_c *last_type_symbol = NULL;
       
 11337 
       
 11338         {
       
 11339             identifier_c param_name("IN");
       
 11340             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11341             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11342             
       
 11343             /* Get the value from a foo(<param_value>) style call */
       
 11344             if (IN_param_value == NULL)
       
 11345               IN_param_value = function_call_param_iterator.next();
       
 11346             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11347             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11348             
       
 11349             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11350             {
       
 11351         
       
 11352                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 11353                 s4o.print("(");
       
 11354                 return_type_symbol->accept(*this);
       
 11355                 s4o.print(")");
       
 11356                 IN_param_value->accept(*this);
       
 11357                 return NULL;
       
 11358                 
       
 11359             }
       
 11360             
       
 11361             ERROR;
       
 11362         }
       
 11363         
       
 11364     }/*function_word_to_dint*/
       
 11365     break;
       
 11366 
       
 11367 /****
       
 11368  *WORD_TO_LINT
       
 11369  */
       
 11370     case function_word_to_lint :
       
 11371     {
       
 11372         symbol_c *last_type_symbol = NULL;
       
 11373 
       
 11374         {
       
 11375             identifier_c param_name("IN");
       
 11376             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11377             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11378             
       
 11379             /* Get the value from a foo(<param_value>) style call */
       
 11380             if (IN_param_value == NULL)
       
 11381               IN_param_value = function_call_param_iterator.next();
       
 11382             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11383             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11384             
       
 11385             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11386             {
       
 11387         
       
 11388                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 11389                 s4o.print("(");
       
 11390                 return_type_symbol->accept(*this);
       
 11391                 s4o.print(")");
       
 11392                 IN_param_value->accept(*this);
       
 11393                 return NULL;
       
 11394                 
       
 11395             }
       
 11396             
       
 11397             ERROR;
       
 11398         }
       
 11399         
       
 11400     }/*function_word_to_lint*/
       
 11401     break;
       
 11402 
       
 11403 /****
       
 11404  *WORD_TO_USINT
       
 11405  */
       
 11406     case function_word_to_usint :
       
 11407     {
       
 11408         symbol_c *last_type_symbol = NULL;
       
 11409 
       
 11410         {
       
 11411             identifier_c param_name("IN");
       
 11412             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11413             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11414             
       
 11415             /* Get the value from a foo(<param_value>) style call */
       
 11416             if (IN_param_value == NULL)
       
 11417               IN_param_value = function_call_param_iterator.next();
       
 11418             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11419             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11420             
       
 11421             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11422             {
       
 11423         
       
 11424                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 11425                 s4o.print("(");
       
 11426                 return_type_symbol->accept(*this);
       
 11427                 s4o.print(")");
       
 11428                 IN_param_value->accept(*this);
       
 11429                 return NULL;
       
 11430                 
       
 11431             }
       
 11432             
       
 11433             ERROR;
       
 11434         }
       
 11435         
       
 11436     }/*function_word_to_usint*/
       
 11437     break;
       
 11438 
       
 11439 /****
       
 11440  *WORD_TO_UINT
       
 11441  */
       
 11442     case function_word_to_uint :
       
 11443     {
       
 11444         symbol_c *last_type_symbol = NULL;
       
 11445 
       
 11446         {
       
 11447             identifier_c param_name("IN");
       
 11448             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11449             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11450             
       
 11451             /* Get the value from a foo(<param_value>) style call */
       
 11452             if (IN_param_value == NULL)
       
 11453               IN_param_value = function_call_param_iterator.next();
       
 11454             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11455             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11456             
       
 11457             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11458             {
       
 11459         
       
 11460                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 11461                 s4o.print("(");
       
 11462                 return_type_symbol->accept(*this);
       
 11463                 s4o.print(")");
       
 11464                 IN_param_value->accept(*this);
       
 11465                 return NULL;
       
 11466                 
       
 11467             }
       
 11468             
       
 11469             ERROR;
       
 11470         }
       
 11471         
       
 11472     }/*function_word_to_uint*/
       
 11473     break;
       
 11474 
       
 11475 /****
       
 11476  *WORD_TO_UDINT
       
 11477  */
       
 11478     case function_word_to_udint :
       
 11479     {
       
 11480         symbol_c *last_type_symbol = NULL;
       
 11481 
       
 11482         {
       
 11483             identifier_c param_name("IN");
       
 11484             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11485             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11486             
       
 11487             /* Get the value from a foo(<param_value>) style call */
       
 11488             if (IN_param_value == NULL)
       
 11489               IN_param_value = function_call_param_iterator.next();
       
 11490             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11491             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11492             
       
 11493             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11494             {
       
 11495         
       
 11496                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 11497                 s4o.print("(");
       
 11498                 return_type_symbol->accept(*this);
       
 11499                 s4o.print(")");
       
 11500                 IN_param_value->accept(*this);
       
 11501                 return NULL;
       
 11502                 
       
 11503             }
       
 11504             
       
 11505             ERROR;
       
 11506         }
       
 11507         
       
 11508     }/*function_word_to_udint*/
       
 11509     break;
       
 11510 
       
 11511 /****
       
 11512  *WORD_TO_ULINT
       
 11513  */
       
 11514     case function_word_to_ulint :
       
 11515     {
       
 11516         symbol_c *last_type_symbol = NULL;
       
 11517 
       
 11518         {
       
 11519             identifier_c param_name("IN");
       
 11520             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11521             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11522             
       
 11523             /* Get the value from a foo(<param_value>) style call */
       
 11524             if (IN_param_value == NULL)
       
 11525               IN_param_value = function_call_param_iterator.next();
       
 11526             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11527             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11528             
       
 11529             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11530             {
       
 11531         
       
 11532                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 11533                 s4o.print("(");
       
 11534                 return_type_symbol->accept(*this);
       
 11535                 s4o.print(")");
       
 11536                 IN_param_value->accept(*this);
       
 11537                 return NULL;
       
 11538                 
       
 11539             }
       
 11540             
       
 11541             ERROR;
       
 11542         }
       
 11543         
       
 11544     }/*function_word_to_ulint*/
       
 11545     break;
       
 11546 
       
 11547 /****
       
 11548  *WORD_TO_REAL
       
 11549  */
       
 11550     case function_word_to_real :
       
 11551     {
       
 11552         symbol_c *last_type_symbol = NULL;
       
 11553 
       
 11554         {
       
 11555             identifier_c param_name("IN");
       
 11556             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11557             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11558             
       
 11559             /* Get the value from a foo(<param_value>) style call */
       
 11560             if (IN_param_value == NULL)
       
 11561               IN_param_value = function_call_param_iterator.next();
       
 11562             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11563             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11564             
       
 11565             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11566             {
       
 11567         
       
 11568                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 11569                 s4o.print("(");
       
 11570                 return_type_symbol->accept(*this);
       
 11571                 s4o.print(")");
       
 11572                 IN_param_value->accept(*this);
       
 11573                 return NULL;
       
 11574                 
       
 11575             }
       
 11576             
       
 11577             ERROR;
       
 11578         }
       
 11579         
       
 11580     }/*function_word_to_real*/
       
 11581     break;
       
 11582 
       
 11583 /****
       
 11584  *WORD_TO_LREAL
       
 11585  */
       
 11586     case function_word_to_lreal :
       
 11587     {
       
 11588         symbol_c *last_type_symbol = NULL;
       
 11589 
       
 11590         {
       
 11591             identifier_c param_name("IN");
       
 11592             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11593             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11594             
       
 11595             /* Get the value from a foo(<param_value>) style call */
       
 11596             if (IN_param_value == NULL)
       
 11597               IN_param_value = function_call_param_iterator.next();
       
 11598             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11599             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11600             
       
 11601             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11602             {
       
 11603         
       
 11604                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 11605                 s4o.print("(");
       
 11606                 return_type_symbol->accept(*this);
       
 11607                 s4o.print(")");
       
 11608                 IN_param_value->accept(*this);
       
 11609                 return NULL;
       
 11610                 
       
 11611             }
       
 11612             
       
 11613             ERROR;
       
 11614         }
       
 11615         
       
 11616     }/*function_word_to_lreal*/
       
 11617     break;
       
 11618 
       
 11619 /****
       
 11620  *WORD_TO_TIME
       
 11621  */
       
 11622     case function_word_to_time :
       
 11623     {
       
 11624         symbol_c *last_type_symbol = NULL;
       
 11625 
       
 11626         {
       
 11627             identifier_c param_name("IN");
       
 11628             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11629             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11630             
       
 11631             /* Get the value from a foo(<param_value>) style call */
       
 11632             if (IN_param_value == NULL)
       
 11633               IN_param_value = function_call_param_iterator.next();
       
 11634             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11635             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11636             
       
 11637             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11638             {
       
 11639         
       
 11640                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 11641                 s4o.print("(");
       
 11642                 return_type_symbol->accept(*this);
       
 11643                 s4o.print(")__int_to_time(");
       
 11644                 IN_param_value->accept(*this);
       
 11645                 s4o.print(")");
       
 11646                 return NULL;
       
 11647                 
       
 11648             }
       
 11649             
       
 11650             ERROR;
       
 11651         }
       
 11652         
       
 11653     }/*function_word_to_time*/
       
 11654     break;
       
 11655 
       
 11656 /****
       
 11657  *WORD_TO_DATE
       
 11658  */
       
 11659     case function_word_to_date :
       
 11660     {
       
 11661         symbol_c *last_type_symbol = NULL;
       
 11662 
       
 11663         {
       
 11664             identifier_c param_name("IN");
       
 11665             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11666             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11667             
       
 11668             /* Get the value from a foo(<param_value>) style call */
       
 11669             if (IN_param_value == NULL)
       
 11670               IN_param_value = function_call_param_iterator.next();
       
 11671             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11672             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11673             
       
 11674             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11675             {
       
 11676         
       
 11677                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 11678                 s4o.print("(");
       
 11679                 return_type_symbol->accept(*this);
       
 11680                 s4o.print(")__int_to_time(");
       
 11681                 IN_param_value->accept(*this);
       
 11682                 s4o.print(")");
       
 11683                 return NULL;
       
 11684                 
       
 11685             }
       
 11686             
       
 11687             ERROR;
       
 11688         }
       
 11689         
       
 11690     }/*function_word_to_date*/
       
 11691     break;
       
 11692 
       
 11693 /****
       
 11694  *WORD_TO_TOD
       
 11695  */
       
 11696     case function_word_to_tod :
       
 11697     {
       
 11698         symbol_c *last_type_symbol = NULL;
       
 11699 
       
 11700         {
       
 11701             identifier_c param_name("IN");
       
 11702             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11703             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11704             
       
 11705             /* Get the value from a foo(<param_value>) style call */
       
 11706             if (IN_param_value == NULL)
       
 11707               IN_param_value = function_call_param_iterator.next();
       
 11708             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11709             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11710             
       
 11711             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11712             {
       
 11713         
       
 11714                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 11715                 s4o.print("(");
       
 11716                 return_type_symbol->accept(*this);
       
 11717                 s4o.print(")__int_to_time(");
       
 11718                 IN_param_value->accept(*this);
       
 11719                 s4o.print(")");
       
 11720                 return NULL;
       
 11721                 
       
 11722             }
       
 11723             
       
 11724             ERROR;
       
 11725         }
       
 11726         
       
 11727     }/*function_word_to_tod*/
       
 11728     break;
       
 11729 
       
 11730 /****
       
 11731  *WORD_TO_DT
       
 11732  */
       
 11733     case function_word_to_dt :
       
 11734     {
       
 11735         symbol_c *last_type_symbol = NULL;
       
 11736 
       
 11737         {
       
 11738             identifier_c param_name("IN");
       
 11739             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11740             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11741             
       
 11742             /* Get the value from a foo(<param_value>) style call */
       
 11743             if (IN_param_value == NULL)
       
 11744               IN_param_value = function_call_param_iterator.next();
       
 11745             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11746             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11747             
       
 11748             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11749             {
       
 11750         
       
 11751                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 11752                 s4o.print("(");
       
 11753                 return_type_symbol->accept(*this);
       
 11754                 s4o.print(")__int_to_time(");
       
 11755                 IN_param_value->accept(*this);
       
 11756                 s4o.print(")");
       
 11757                 return NULL;
       
 11758                 
       
 11759             }
       
 11760             
       
 11761             ERROR;
       
 11762         }
       
 11763         
       
 11764     }/*function_word_to_dt*/
       
 11765     break;
       
 11766 
       
 11767 /****
       
 11768  *WORD_TO_STRING
       
 11769  */
       
 11770     case function_word_to_string :
       
 11771     {
       
 11772         symbol_c *last_type_symbol = NULL;
       
 11773 
       
 11774         {
       
 11775             identifier_c param_name("IN");
       
 11776             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11777             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11778             
       
 11779             /* Get the value from a foo(<param_value>) style call */
       
 11780             if (IN_param_value == NULL)
       
 11781               IN_param_value = function_call_param_iterator.next();
       
 11782             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11783             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11784             
       
 11785             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11786             {
       
 11787         
       
 11788                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 11789                 s4o.print("(");
       
 11790                 return_type_symbol->accept(*this);
       
 11791                 s4o.print(")__bit_to_string(");
       
 11792                 IN_param_value->accept(*this);
       
 11793                 s4o.print(")");
       
 11794                 return NULL;
       
 11795                 
       
 11796             }
       
 11797             
       
 11798             ERROR;
       
 11799         }
       
 11800         
       
 11801     }/*function_word_to_string*/
       
 11802     break;
       
 11803 
       
 11804 /****
       
 11805  *WORD_TO_BYTE
       
 11806  */
       
 11807     case function_word_to_byte :
       
 11808     {
       
 11809         symbol_c *last_type_symbol = NULL;
       
 11810 
       
 11811         {
       
 11812             identifier_c param_name("IN");
       
 11813             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11814             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11815             
       
 11816             /* Get the value from a foo(<param_value>) style call */
       
 11817             if (IN_param_value == NULL)
       
 11818               IN_param_value = function_call_param_iterator.next();
       
 11819             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11820             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11821             
       
 11822             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11823             {
       
 11824         
       
 11825                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 11826                 s4o.print("(");
       
 11827                 return_type_symbol->accept(*this);
       
 11828                 s4o.print(")");
       
 11829                 IN_param_value->accept(*this);
       
 11830                 return NULL;
       
 11831                 
       
 11832             }
       
 11833             
       
 11834             ERROR;
       
 11835         }
       
 11836         
       
 11837     }/*function_word_to_byte*/
       
 11838     break;
       
 11839 
       
 11840 /****
       
 11841  *WORD_TO_DWORD
       
 11842  */
       
 11843     case function_word_to_dword :
       
 11844     {
       
 11845         symbol_c *last_type_symbol = NULL;
       
 11846 
       
 11847         {
       
 11848             identifier_c param_name("IN");
       
 11849             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11850             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11851             
       
 11852             /* Get the value from a foo(<param_value>) style call */
       
 11853             if (IN_param_value == NULL)
       
 11854               IN_param_value = function_call_param_iterator.next();
       
 11855             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11856             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11857             
       
 11858             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11859             {
       
 11860         
       
 11861                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 11862                 s4o.print("(");
       
 11863                 return_type_symbol->accept(*this);
       
 11864                 s4o.print(")");
       
 11865                 IN_param_value->accept(*this);
       
 11866                 return NULL;
       
 11867                 
       
 11868             }
       
 11869             
       
 11870             ERROR;
       
 11871         }
       
 11872         
       
 11873     }/*function_word_to_dword*/
       
 11874     break;
       
 11875 
       
 11876 /****
       
 11877  *WORD_TO_LWORD
       
 11878  */
       
 11879     case function_word_to_lword :
       
 11880     {
       
 11881         symbol_c *last_type_symbol = NULL;
       
 11882 
       
 11883         {
       
 11884             identifier_c param_name("IN");
       
 11885             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11886             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11887             
       
 11888             /* Get the value from a foo(<param_value>) style call */
       
 11889             if (IN_param_value == NULL)
       
 11890               IN_param_value = function_call_param_iterator.next();
       
 11891             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11892             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11893             
       
 11894             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 11895             {
       
 11896         
       
 11897                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 11898                 s4o.print("(");
       
 11899                 return_type_symbol->accept(*this);
       
 11900                 s4o.print(")");
       
 11901                 IN_param_value->accept(*this);
       
 11902                 return NULL;
       
 11903                 
       
 11904             }
       
 11905             
       
 11906             ERROR;
       
 11907         }
       
 11908         
       
 11909     }/*function_word_to_lword*/
       
 11910     break;
       
 11911 
       
 11912 /****
       
 11913  *DWORD_TO_BOOL
       
 11914  */
       
 11915     case function_dword_to_bool :
       
 11916     {
       
 11917         symbol_c *last_type_symbol = NULL;
       
 11918 
       
 11919         {
       
 11920             identifier_c param_name("IN");
       
 11921             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11922             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11923             
       
 11924             /* Get the value from a foo(<param_value>) style call */
       
 11925             if (IN_param_value == NULL)
       
 11926               IN_param_value = function_call_param_iterator.next();
       
 11927             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11928             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11929             
       
 11930             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 11931             {
       
 11932         
       
 11933                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 11934                 s4o.print("(");
       
 11935                 return_type_symbol->accept(*this);
       
 11936                 s4o.print(")");
       
 11937                 IN_param_value->accept(*this);
       
 11938                 return NULL;
       
 11939                 
       
 11940             }
       
 11941             
       
 11942             ERROR;
       
 11943         }
       
 11944         
       
 11945     }/*function_dword_to_bool*/
       
 11946     break;
       
 11947 
       
 11948 /****
       
 11949  *DWORD_TO_SINT
       
 11950  */
       
 11951     case function_dword_to_sint :
       
 11952     {
       
 11953         symbol_c *last_type_symbol = NULL;
       
 11954 
       
 11955         {
       
 11956             identifier_c param_name("IN");
       
 11957             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11958             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11959             
       
 11960             /* Get the value from a foo(<param_value>) style call */
       
 11961             if (IN_param_value == NULL)
       
 11962               IN_param_value = function_call_param_iterator.next();
       
 11963             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11964             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11965             
       
 11966             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 11967             {
       
 11968         
       
 11969                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 11970                 s4o.print("(");
       
 11971                 return_type_symbol->accept(*this);
       
 11972                 s4o.print(")");
       
 11973                 IN_param_value->accept(*this);
       
 11974                 return NULL;
       
 11975                 
       
 11976             }
       
 11977             
       
 11978             ERROR;
       
 11979         }
       
 11980         
       
 11981     }/*function_dword_to_sint*/
       
 11982     break;
       
 11983 
       
 11984 /****
       
 11985  *DWORD_TO_INT
       
 11986  */
       
 11987     case function_dword_to_int :
       
 11988     {
       
 11989         symbol_c *last_type_symbol = NULL;
       
 11990 
       
 11991         {
       
 11992             identifier_c param_name("IN");
       
 11993             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11994             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11995             
       
 11996             /* Get the value from a foo(<param_value>) style call */
       
 11997             if (IN_param_value == NULL)
       
 11998               IN_param_value = function_call_param_iterator.next();
       
 11999             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12000             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12001             
       
 12002             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12003             {
       
 12004         
       
 12005                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 12006                 s4o.print("(");
       
 12007                 return_type_symbol->accept(*this);
       
 12008                 s4o.print(")");
       
 12009                 IN_param_value->accept(*this);
       
 12010                 return NULL;
       
 12011                 
       
 12012             }
       
 12013             
       
 12014             ERROR;
       
 12015         }
       
 12016         
       
 12017     }/*function_dword_to_int*/
       
 12018     break;
       
 12019 
       
 12020 /****
       
 12021  *DWORD_TO_DINT
       
 12022  */
       
 12023     case function_dword_to_dint :
       
 12024     {
       
 12025         symbol_c *last_type_symbol = NULL;
       
 12026 
       
 12027         {
       
 12028             identifier_c param_name("IN");
       
 12029             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12030             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12031             
       
 12032             /* Get the value from a foo(<param_value>) style call */
       
 12033             if (IN_param_value == NULL)
       
 12034               IN_param_value = function_call_param_iterator.next();
       
 12035             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12036             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12037             
       
 12038             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12039             {
       
 12040         
       
 12041                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 12042                 s4o.print("(");
       
 12043                 return_type_symbol->accept(*this);
       
 12044                 s4o.print(")");
       
 12045                 IN_param_value->accept(*this);
       
 12046                 return NULL;
       
 12047                 
       
 12048             }
       
 12049             
       
 12050             ERROR;
       
 12051         }
       
 12052         
       
 12053     }/*function_dword_to_dint*/
       
 12054     break;
       
 12055 
       
 12056 /****
       
 12057  *DWORD_TO_LINT
       
 12058  */
       
 12059     case function_dword_to_lint :
       
 12060     {
       
 12061         symbol_c *last_type_symbol = NULL;
       
 12062 
       
 12063         {
       
 12064             identifier_c param_name("IN");
       
 12065             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12066             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12067             
       
 12068             /* Get the value from a foo(<param_value>) style call */
       
 12069             if (IN_param_value == NULL)
       
 12070               IN_param_value = function_call_param_iterator.next();
       
 12071             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12072             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12073             
       
 12074             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12075             {
       
 12076         
       
 12077                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 12078                 s4o.print("(");
       
 12079                 return_type_symbol->accept(*this);
       
 12080                 s4o.print(")");
       
 12081                 IN_param_value->accept(*this);
       
 12082                 return NULL;
       
 12083                 
       
 12084             }
       
 12085             
       
 12086             ERROR;
       
 12087         }
       
 12088         
       
 12089     }/*function_dword_to_lint*/
       
 12090     break;
       
 12091 
       
 12092 /****
       
 12093  *DWORD_TO_USINT
       
 12094  */
       
 12095     case function_dword_to_usint :
       
 12096     {
       
 12097         symbol_c *last_type_symbol = NULL;
       
 12098 
       
 12099         {
       
 12100             identifier_c param_name("IN");
       
 12101             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12102             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12103             
       
 12104             /* Get the value from a foo(<param_value>) style call */
       
 12105             if (IN_param_value == NULL)
       
 12106               IN_param_value = function_call_param_iterator.next();
       
 12107             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12108             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12109             
       
 12110             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12111             {
       
 12112         
       
 12113                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 12114                 s4o.print("(");
       
 12115                 return_type_symbol->accept(*this);
       
 12116                 s4o.print(")");
       
 12117                 IN_param_value->accept(*this);
       
 12118                 return NULL;
       
 12119                 
       
 12120             }
       
 12121             
       
 12122             ERROR;
       
 12123         }
       
 12124         
       
 12125     }/*function_dword_to_usint*/
       
 12126     break;
       
 12127 
       
 12128 /****
       
 12129  *DWORD_TO_UINT
       
 12130  */
       
 12131     case function_dword_to_uint :
       
 12132     {
       
 12133         symbol_c *last_type_symbol = NULL;
       
 12134 
       
 12135         {
       
 12136             identifier_c param_name("IN");
       
 12137             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12138             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12139             
       
 12140             /* Get the value from a foo(<param_value>) style call */
       
 12141             if (IN_param_value == NULL)
       
 12142               IN_param_value = function_call_param_iterator.next();
       
 12143             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12144             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12145             
       
 12146             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12147             {
       
 12148         
       
 12149                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 12150                 s4o.print("(");
       
 12151                 return_type_symbol->accept(*this);
       
 12152                 s4o.print(")");
       
 12153                 IN_param_value->accept(*this);
       
 12154                 return NULL;
       
 12155                 
       
 12156             }
       
 12157             
       
 12158             ERROR;
       
 12159         }
       
 12160         
       
 12161     }/*function_dword_to_uint*/
       
 12162     break;
       
 12163 
       
 12164 /****
       
 12165  *DWORD_TO_UDINT
       
 12166  */
       
 12167     case function_dword_to_udint :
       
 12168     {
       
 12169         symbol_c *last_type_symbol = NULL;
       
 12170 
       
 12171         {
       
 12172             identifier_c param_name("IN");
       
 12173             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12174             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12175             
       
 12176             /* Get the value from a foo(<param_value>) style call */
       
 12177             if (IN_param_value == NULL)
       
 12178               IN_param_value = function_call_param_iterator.next();
       
 12179             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12180             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12181             
       
 12182             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12183             {
       
 12184         
       
 12185                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 12186                 s4o.print("(");
       
 12187                 return_type_symbol->accept(*this);
       
 12188                 s4o.print(")");
       
 12189                 IN_param_value->accept(*this);
       
 12190                 return NULL;
       
 12191                 
       
 12192             }
       
 12193             
       
 12194             ERROR;
       
 12195         }
       
 12196         
       
 12197     }/*function_dword_to_udint*/
       
 12198     break;
       
 12199 
       
 12200 /****
       
 12201  *DWORD_TO_ULINT
       
 12202  */
       
 12203     case function_dword_to_ulint :
       
 12204     {
       
 12205         symbol_c *last_type_symbol = NULL;
       
 12206 
       
 12207         {
       
 12208             identifier_c param_name("IN");
       
 12209             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12210             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12211             
       
 12212             /* Get the value from a foo(<param_value>) style call */
       
 12213             if (IN_param_value == NULL)
       
 12214               IN_param_value = function_call_param_iterator.next();
       
 12215             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12216             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12217             
       
 12218             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12219             {
       
 12220         
       
 12221                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 12222                 s4o.print("(");
       
 12223                 return_type_symbol->accept(*this);
       
 12224                 s4o.print(")");
       
 12225                 IN_param_value->accept(*this);
       
 12226                 return NULL;
       
 12227                 
       
 12228             }
       
 12229             
       
 12230             ERROR;
       
 12231         }
       
 12232         
       
 12233     }/*function_dword_to_ulint*/
       
 12234     break;
       
 12235 
       
 12236 /****
       
 12237  *DWORD_TO_REAL
       
 12238  */
       
 12239     case function_dword_to_real :
       
 12240     {
       
 12241         symbol_c *last_type_symbol = NULL;
       
 12242 
       
 12243         {
       
 12244             identifier_c param_name("IN");
       
 12245             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12246             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12247             
       
 12248             /* Get the value from a foo(<param_value>) style call */
       
 12249             if (IN_param_value == NULL)
       
 12250               IN_param_value = function_call_param_iterator.next();
       
 12251             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12252             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12253             
       
 12254             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12255             {
       
 12256         
       
 12257                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 12258                 s4o.print("(");
       
 12259                 return_type_symbol->accept(*this);
       
 12260                 s4o.print(")");
       
 12261                 IN_param_value->accept(*this);
       
 12262                 return NULL;
       
 12263                 
       
 12264             }
       
 12265             
       
 12266             ERROR;
       
 12267         }
       
 12268         
       
 12269     }/*function_dword_to_real*/
       
 12270     break;
       
 12271 
       
 12272 /****
       
 12273  *DWORD_TO_LREAL
       
 12274  */
       
 12275     case function_dword_to_lreal :
       
 12276     {
       
 12277         symbol_c *last_type_symbol = NULL;
       
 12278 
       
 12279         {
       
 12280             identifier_c param_name("IN");
       
 12281             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12282             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12283             
       
 12284             /* Get the value from a foo(<param_value>) style call */
       
 12285             if (IN_param_value == NULL)
       
 12286               IN_param_value = function_call_param_iterator.next();
       
 12287             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12288             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12289             
       
 12290             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12291             {
       
 12292         
       
 12293                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 12294                 s4o.print("(");
       
 12295                 return_type_symbol->accept(*this);
       
 12296                 s4o.print(")");
       
 12297                 IN_param_value->accept(*this);
       
 12298                 return NULL;
       
 12299                 
       
 12300             }
       
 12301             
       
 12302             ERROR;
       
 12303         }
       
 12304         
       
 12305     }/*function_dword_to_lreal*/
       
 12306     break;
       
 12307 
       
 12308 /****
       
 12309  *DWORD_TO_TIME
       
 12310  */
       
 12311     case function_dword_to_time :
       
 12312     {
       
 12313         symbol_c *last_type_symbol = NULL;
       
 12314 
       
 12315         {
       
 12316             identifier_c param_name("IN");
       
 12317             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12318             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12319             
       
 12320             /* Get the value from a foo(<param_value>) style call */
       
 12321             if (IN_param_value == NULL)
       
 12322               IN_param_value = function_call_param_iterator.next();
       
 12323             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12324             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12325             
       
 12326             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12327             {
       
 12328         
       
 12329                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 12330                 s4o.print("(");
       
 12331                 return_type_symbol->accept(*this);
       
 12332                 s4o.print(")__int_to_time(");
       
 12333                 IN_param_value->accept(*this);
       
 12334                 s4o.print(")");
       
 12335                 return NULL;
       
 12336                 
       
 12337             }
       
 12338             
       
 12339             ERROR;
       
 12340         }
       
 12341         
       
 12342     }/*function_dword_to_time*/
       
 12343     break;
       
 12344 
       
 12345 /****
       
 12346  *DWORD_TO_DATE
       
 12347  */
       
 12348     case function_dword_to_date :
       
 12349     {
       
 12350         symbol_c *last_type_symbol = NULL;
       
 12351 
       
 12352         {
       
 12353             identifier_c param_name("IN");
       
 12354             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12355             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12356             
       
 12357             /* Get the value from a foo(<param_value>) style call */
       
 12358             if (IN_param_value == NULL)
       
 12359               IN_param_value = function_call_param_iterator.next();
       
 12360             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12361             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12362             
       
 12363             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12364             {
       
 12365         
       
 12366                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 12367                 s4o.print("(");
       
 12368                 return_type_symbol->accept(*this);
       
 12369                 s4o.print(")__int_to_time(");
       
 12370                 IN_param_value->accept(*this);
       
 12371                 s4o.print(")");
       
 12372                 return NULL;
       
 12373                 
       
 12374             }
       
 12375             
       
 12376             ERROR;
       
 12377         }
       
 12378         
       
 12379     }/*function_dword_to_date*/
       
 12380     break;
       
 12381 
       
 12382 /****
       
 12383  *DWORD_TO_TOD
       
 12384  */
       
 12385     case function_dword_to_tod :
       
 12386     {
       
 12387         symbol_c *last_type_symbol = NULL;
       
 12388 
       
 12389         {
       
 12390             identifier_c param_name("IN");
       
 12391             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12392             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12393             
       
 12394             /* Get the value from a foo(<param_value>) style call */
       
 12395             if (IN_param_value == NULL)
       
 12396               IN_param_value = function_call_param_iterator.next();
       
 12397             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12398             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12399             
       
 12400             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12401             {
       
 12402         
       
 12403                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 12404                 s4o.print("(");
       
 12405                 return_type_symbol->accept(*this);
       
 12406                 s4o.print(")__int_to_time(");
       
 12407                 IN_param_value->accept(*this);
       
 12408                 s4o.print(")");
       
 12409                 return NULL;
       
 12410                 
       
 12411             }
       
 12412             
       
 12413             ERROR;
       
 12414         }
       
 12415         
       
 12416     }/*function_dword_to_tod*/
       
 12417     break;
       
 12418 
       
 12419 /****
       
 12420  *DWORD_TO_DT
       
 12421  */
       
 12422     case function_dword_to_dt :
       
 12423     {
       
 12424         symbol_c *last_type_symbol = NULL;
       
 12425 
       
 12426         {
       
 12427             identifier_c param_name("IN");
       
 12428             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12429             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12430             
       
 12431             /* Get the value from a foo(<param_value>) style call */
       
 12432             if (IN_param_value == NULL)
       
 12433               IN_param_value = function_call_param_iterator.next();
       
 12434             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12435             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12436             
       
 12437             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12438             {
       
 12439         
       
 12440                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 12441                 s4o.print("(");
       
 12442                 return_type_symbol->accept(*this);
       
 12443                 s4o.print(")__int_to_time(");
       
 12444                 IN_param_value->accept(*this);
       
 12445                 s4o.print(")");
       
 12446                 return NULL;
       
 12447                 
       
 12448             }
       
 12449             
       
 12450             ERROR;
       
 12451         }
       
 12452         
       
 12453     }/*function_dword_to_dt*/
       
 12454     break;
       
 12455 
       
 12456 /****
       
 12457  *DWORD_TO_STRING
       
 12458  */
       
 12459     case function_dword_to_string :
       
 12460     {
       
 12461         symbol_c *last_type_symbol = NULL;
       
 12462 
       
 12463         {
       
 12464             identifier_c param_name("IN");
       
 12465             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12466             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12467             
       
 12468             /* Get the value from a foo(<param_value>) style call */
       
 12469             if (IN_param_value == NULL)
       
 12470               IN_param_value = function_call_param_iterator.next();
       
 12471             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12472             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12473             
       
 12474             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12475             {
       
 12476         
       
 12477                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 12478                 s4o.print("(");
       
 12479                 return_type_symbol->accept(*this);
       
 12480                 s4o.print(")__bit_to_string(");
       
 12481                 IN_param_value->accept(*this);
       
 12482                 s4o.print(")");
       
 12483                 return NULL;
       
 12484                 
       
 12485             }
       
 12486             
       
 12487             ERROR;
       
 12488         }
       
 12489         
       
 12490     }/*function_dword_to_string*/
       
 12491     break;
       
 12492 
       
 12493 /****
       
 12494  *DWORD_TO_BYTE
       
 12495  */
       
 12496     case function_dword_to_byte :
       
 12497     {
       
 12498         symbol_c *last_type_symbol = NULL;
       
 12499 
       
 12500         {
       
 12501             identifier_c param_name("IN");
       
 12502             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12503             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12504             
       
 12505             /* Get the value from a foo(<param_value>) style call */
       
 12506             if (IN_param_value == NULL)
       
 12507               IN_param_value = function_call_param_iterator.next();
       
 12508             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12509             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12510             
       
 12511             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12512             {
       
 12513         
       
 12514                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 12515                 s4o.print("(");
       
 12516                 return_type_symbol->accept(*this);
       
 12517                 s4o.print(")");
       
 12518                 IN_param_value->accept(*this);
       
 12519                 return NULL;
       
 12520                 
       
 12521             }
       
 12522             
       
 12523             ERROR;
       
 12524         }
       
 12525         
       
 12526     }/*function_dword_to_byte*/
       
 12527     break;
       
 12528 
       
 12529 /****
       
 12530  *DWORD_TO_WORD
       
 12531  */
       
 12532     case function_dword_to_word :
       
 12533     {
       
 12534         symbol_c *last_type_symbol = NULL;
       
 12535 
       
 12536         {
       
 12537             identifier_c param_name("IN");
       
 12538             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12539             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12540             
       
 12541             /* Get the value from a foo(<param_value>) style call */
       
 12542             if (IN_param_value == NULL)
       
 12543               IN_param_value = function_call_param_iterator.next();
       
 12544             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12545             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12546             
       
 12547             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12548             {
       
 12549         
       
 12550                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 12551                 s4o.print("(");
       
 12552                 return_type_symbol->accept(*this);
       
 12553                 s4o.print(")");
       
 12554                 IN_param_value->accept(*this);
       
 12555                 return NULL;
       
 12556                 
       
 12557             }
       
 12558             
       
 12559             ERROR;
       
 12560         }
       
 12561         
       
 12562     }/*function_dword_to_word*/
       
 12563     break;
       
 12564 
       
 12565 /****
       
 12566  *DWORD_TO_LWORD
       
 12567  */
       
 12568     case function_dword_to_lword :
       
 12569     {
       
 12570         symbol_c *last_type_symbol = NULL;
       
 12571 
       
 12572         {
       
 12573             identifier_c param_name("IN");
       
 12574             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12575             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12576             
       
 12577             /* Get the value from a foo(<param_value>) style call */
       
 12578             if (IN_param_value == NULL)
       
 12579               IN_param_value = function_call_param_iterator.next();
       
 12580             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12581             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12582             
       
 12583             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 12584             {
       
 12585         
       
 12586                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 12587                 s4o.print("(");
       
 12588                 return_type_symbol->accept(*this);
       
 12589                 s4o.print(")");
       
 12590                 IN_param_value->accept(*this);
       
 12591                 return NULL;
       
 12592                 
       
 12593             }
       
 12594             
       
 12595             ERROR;
       
 12596         }
       
 12597         
       
 12598     }/*function_dword_to_lword*/
       
 12599     break;
       
 12600 
       
 12601 /****
       
 12602  *LWORD_TO_BOOL
       
 12603  */
       
 12604     case function_lword_to_bool :
       
 12605     {
       
 12606         symbol_c *last_type_symbol = NULL;
       
 12607 
       
 12608         {
       
 12609             identifier_c param_name("IN");
       
 12610             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12611             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12612             
       
 12613             /* Get the value from a foo(<param_value>) style call */
       
 12614             if (IN_param_value == NULL)
       
 12615               IN_param_value = function_call_param_iterator.next();
       
 12616             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12617             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12618             
       
 12619             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 12620             {
       
 12621         
       
 12622                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 12623                 s4o.print("(");
       
 12624                 return_type_symbol->accept(*this);
       
 12625                 s4o.print(")");
       
 12626                 IN_param_value->accept(*this);
       
 12627                 return NULL;
       
 12628                 
       
 12629             }
       
 12630             
       
 12631             ERROR;
       
 12632         }
       
 12633         
       
 12634     }/*function_lword_to_bool*/
       
 12635     break;
       
 12636 
       
 12637 /****
       
 12638  *LWORD_TO_SINT
       
 12639  */
       
 12640     case function_lword_to_sint :
       
 12641     {
       
 12642         symbol_c *last_type_symbol = NULL;
       
 12643 
       
 12644         {
       
 12645             identifier_c param_name("IN");
       
 12646             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12647             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12648             
       
 12649             /* Get the value from a foo(<param_value>) style call */
       
 12650             if (IN_param_value == NULL)
       
 12651               IN_param_value = function_call_param_iterator.next();
       
 12652             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12653             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12654             
       
 12655             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 12656             {
       
 12657         
       
 12658                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 12659                 s4o.print("(");
       
 12660                 return_type_symbol->accept(*this);
       
 12661                 s4o.print(")");
       
 12662                 IN_param_value->accept(*this);
       
 12663                 return NULL;
       
 12664                 
       
 12665             }
       
 12666             
       
 12667             ERROR;
       
 12668         }
       
 12669         
       
 12670     }/*function_lword_to_sint*/
       
 12671     break;
       
 12672 
       
 12673 /****
       
 12674  *LWORD_TO_INT
       
 12675  */
       
 12676     case function_lword_to_int :
       
 12677     {
       
 12678         symbol_c *last_type_symbol = NULL;
       
 12679 
       
 12680         {
       
 12681             identifier_c param_name("IN");
       
 12682             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12683             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12684             
       
 12685             /* Get the value from a foo(<param_value>) style call */
       
 12686             if (IN_param_value == NULL)
       
 12687               IN_param_value = function_call_param_iterator.next();
       
 12688             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12689             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12690             
       
 12691             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 12692             {
       
 12693         
       
 12694                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 12695                 s4o.print("(");
       
 12696                 return_type_symbol->accept(*this);
       
 12697                 s4o.print(")");
       
 12698                 IN_param_value->accept(*this);
       
 12699                 return NULL;
       
 12700                 
       
 12701             }
       
 12702             
       
 12703             ERROR;
       
 12704         }
       
 12705         
       
 12706     }/*function_lword_to_int*/
       
 12707     break;
       
 12708 
       
 12709 /****
       
 12710  *LWORD_TO_DINT
       
 12711  */
       
 12712     case function_lword_to_dint :
       
 12713     {
       
 12714         symbol_c *last_type_symbol = NULL;
       
 12715 
       
 12716         {
       
 12717             identifier_c param_name("IN");
       
 12718             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12719             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12720             
       
 12721             /* Get the value from a foo(<param_value>) style call */
       
 12722             if (IN_param_value == NULL)
       
 12723               IN_param_value = function_call_param_iterator.next();
       
 12724             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12725             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12726             
       
 12727             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 12728             {
       
 12729         
       
 12730                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 12731                 s4o.print("(");
       
 12732                 return_type_symbol->accept(*this);
       
 12733                 s4o.print(")");
       
 12734                 IN_param_value->accept(*this);
       
 12735                 return NULL;
       
 12736                 
       
 12737             }
       
 12738             
       
 12739             ERROR;
       
 12740         }
       
 12741         
       
 12742     }/*function_lword_to_dint*/
       
 12743     break;
       
 12744 
       
 12745 /****
       
 12746  *LWORD_TO_LINT
       
 12747  */
       
 12748     case function_lword_to_lint :
       
 12749     {
       
 12750         symbol_c *last_type_symbol = NULL;
       
 12751 
       
 12752         {
       
 12753             identifier_c param_name("IN");
       
 12754             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12755             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12756             
       
 12757             /* Get the value from a foo(<param_value>) style call */
       
 12758             if (IN_param_value == NULL)
       
 12759               IN_param_value = function_call_param_iterator.next();
       
 12760             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12761             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12762             
       
 12763             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 12764             {
       
 12765         
       
 12766                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 12767                 s4o.print("(");
       
 12768                 return_type_symbol->accept(*this);
       
 12769                 s4o.print(")");
       
 12770                 IN_param_value->accept(*this);
       
 12771                 return NULL;
       
 12772                 
       
 12773             }
       
 12774             
       
 12775             ERROR;
       
 12776         }
       
 12777         
       
 12778     }/*function_lword_to_lint*/
       
 12779     break;
       
 12780 
       
 12781 /****
       
 12782  *LWORD_TO_USINT
       
 12783  */
       
 12784     case function_lword_to_usint :
       
 12785     {
       
 12786         symbol_c *last_type_symbol = NULL;
       
 12787 
       
 12788         {
       
 12789             identifier_c param_name("IN");
       
 12790             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12791             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12792             
       
 12793             /* Get the value from a foo(<param_value>) style call */
       
 12794             if (IN_param_value == NULL)
       
 12795               IN_param_value = function_call_param_iterator.next();
       
 12796             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12797             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12798             
       
 12799             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 12800             {
       
 12801         
       
 12802                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 12803                 s4o.print("(");
       
 12804                 return_type_symbol->accept(*this);
       
 12805                 s4o.print(")");
       
 12806                 IN_param_value->accept(*this);
       
 12807                 return NULL;
       
 12808                 
       
 12809             }
       
 12810             
       
 12811             ERROR;
       
 12812         }
       
 12813         
       
 12814     }/*function_lword_to_usint*/
       
 12815     break;
       
 12816 
       
 12817 /****
       
 12818  *LWORD_TO_UINT
       
 12819  */
       
 12820     case function_lword_to_uint :
       
 12821     {
       
 12822         symbol_c *last_type_symbol = NULL;
       
 12823 
       
 12824         {
       
 12825             identifier_c param_name("IN");
       
 12826             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12827             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12828             
       
 12829             /* Get the value from a foo(<param_value>) style call */
       
 12830             if (IN_param_value == NULL)
       
 12831               IN_param_value = function_call_param_iterator.next();
       
 12832             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12833             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12834             
       
 12835             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 12836             {
       
 12837         
       
 12838                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 12839                 s4o.print("(");
       
 12840                 return_type_symbol->accept(*this);
       
 12841                 s4o.print(")");
       
 12842                 IN_param_value->accept(*this);
       
 12843                 return NULL;
       
 12844                 
       
 12845             }
       
 12846             
       
 12847             ERROR;
       
 12848         }
       
 12849         
       
 12850     }/*function_lword_to_uint*/
       
 12851     break;
       
 12852 
       
 12853 /****
       
 12854  *LWORD_TO_UDINT
       
 12855  */
       
 12856     case function_lword_to_udint :
       
 12857     {
       
 12858         symbol_c *last_type_symbol = NULL;
       
 12859 
       
 12860         {
       
 12861             identifier_c param_name("IN");
       
 12862             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12863             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12864             
       
 12865             /* Get the value from a foo(<param_value>) style call */
       
 12866             if (IN_param_value == NULL)
       
 12867               IN_param_value = function_call_param_iterator.next();
       
 12868             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12869             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12870             
       
 12871             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 12872             {
       
 12873         
       
 12874                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 12875                 s4o.print("(");
       
 12876                 return_type_symbol->accept(*this);
       
 12877                 s4o.print(")");
       
 12878                 IN_param_value->accept(*this);
       
 12879                 return NULL;
       
 12880                 
       
 12881             }
       
 12882             
       
 12883             ERROR;
       
 12884         }
       
 12885         
       
 12886     }/*function_lword_to_udint*/
       
 12887     break;
       
 12888 
       
 12889 /****
       
 12890  *LWORD_TO_ULINT
       
 12891  */
       
 12892     case function_lword_to_ulint :
       
 12893     {
       
 12894         symbol_c *last_type_symbol = NULL;
       
 12895 
       
 12896         {
       
 12897             identifier_c param_name("IN");
       
 12898             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12899             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12900             
       
 12901             /* Get the value from a foo(<param_value>) style call */
       
 12902             if (IN_param_value == NULL)
       
 12903               IN_param_value = function_call_param_iterator.next();
       
 12904             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12905             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12906             
       
 12907             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 12908             {
       
 12909         
       
 12910                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 12911                 s4o.print("(");
       
 12912                 return_type_symbol->accept(*this);
       
 12913                 s4o.print(")");
       
 12914                 IN_param_value->accept(*this);
       
 12915                 return NULL;
       
 12916                 
       
 12917             }
       
 12918             
       
 12919             ERROR;
       
 12920         }
       
 12921         
       
 12922     }/*function_lword_to_ulint*/
       
 12923     break;
       
 12924 
       
 12925 /****
       
 12926  *LWORD_TO_REAL
       
 12927  */
       
 12928     case function_lword_to_real :
       
 12929     {
       
 12930         symbol_c *last_type_symbol = NULL;
       
 12931 
       
 12932         {
       
 12933             identifier_c param_name("IN");
       
 12934             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12935             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12936             
       
 12937             /* Get the value from a foo(<param_value>) style call */
       
 12938             if (IN_param_value == NULL)
       
 12939               IN_param_value = function_call_param_iterator.next();
       
 12940             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12941             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12942             
       
 12943             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 12944             {
       
 12945         
       
 12946                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 12947                 s4o.print("(");
       
 12948                 return_type_symbol->accept(*this);
       
 12949                 s4o.print(")");
       
 12950                 IN_param_value->accept(*this);
       
 12951                 return NULL;
       
 12952                 
       
 12953             }
       
 12954             
       
 12955             ERROR;
       
 12956         }
       
 12957         
       
 12958     }/*function_lword_to_real*/
       
 12959     break;
       
 12960 
       
 12961 /****
       
 12962  *LWORD_TO_LREAL
       
 12963  */
       
 12964     case function_lword_to_lreal :
       
 12965     {
       
 12966         symbol_c *last_type_symbol = NULL;
       
 12967 
       
 12968         {
       
 12969             identifier_c param_name("IN");
       
 12970             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12971             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12972             
       
 12973             /* Get the value from a foo(<param_value>) style call */
       
 12974             if (IN_param_value == NULL)
       
 12975               IN_param_value = function_call_param_iterator.next();
       
 12976             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12977             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12978             
       
 12979             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 12980             {
       
 12981         
       
 12982                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 12983                 s4o.print("(");
       
 12984                 return_type_symbol->accept(*this);
       
 12985                 s4o.print(")");
       
 12986                 IN_param_value->accept(*this);
       
 12987                 return NULL;
       
 12988                 
       
 12989             }
       
 12990             
       
 12991             ERROR;
       
 12992         }
       
 12993         
       
 12994     }/*function_lword_to_lreal*/
       
 12995     break;
       
 12996 
       
 12997 /****
       
 12998  *LWORD_TO_TIME
       
 12999  */
       
 13000     case function_lword_to_time :
       
 13001     {
       
 13002         symbol_c *last_type_symbol = NULL;
       
 13003 
       
 13004         {
       
 13005             identifier_c param_name("IN");
       
 13006             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13007             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13008             
       
 13009             /* Get the value from a foo(<param_value>) style call */
       
 13010             if (IN_param_value == NULL)
       
 13011               IN_param_value = function_call_param_iterator.next();
       
 13012             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13013             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13014             
       
 13015             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 13016             {
       
 13017         
       
 13018                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 13019                 s4o.print("(");
       
 13020                 return_type_symbol->accept(*this);
       
 13021                 s4o.print(")__int_to_time(");
       
 13022                 IN_param_value->accept(*this);
       
 13023                 s4o.print(")");
       
 13024                 return NULL;
       
 13025                 
       
 13026             }
       
 13027             
       
 13028             ERROR;
       
 13029         }
       
 13030         
       
 13031     }/*function_lword_to_time*/
       
 13032     break;
       
 13033 
       
 13034 /****
       
 13035  *LWORD_TO_DATE
       
 13036  */
       
 13037     case function_lword_to_date :
       
 13038     {
       
 13039         symbol_c *last_type_symbol = NULL;
       
 13040 
       
 13041         {
       
 13042             identifier_c param_name("IN");
       
 13043             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13044             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13045             
       
 13046             /* Get the value from a foo(<param_value>) style call */
       
 13047             if (IN_param_value == NULL)
       
 13048               IN_param_value = function_call_param_iterator.next();
       
 13049             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13050             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13051             
       
 13052             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 13053             {
       
 13054         
       
 13055                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 13056                 s4o.print("(");
       
 13057                 return_type_symbol->accept(*this);
       
 13058                 s4o.print(")__int_to_time(");
       
 13059                 IN_param_value->accept(*this);
       
 13060                 s4o.print(")");
       
 13061                 return NULL;
       
 13062                 
       
 13063             }
       
 13064             
       
 13065             ERROR;
       
 13066         }
       
 13067         
       
 13068     }/*function_lword_to_date*/
       
 13069     break;
       
 13070 
       
 13071 /****
       
 13072  *LWORD_TO_TOD
       
 13073  */
       
 13074     case function_lword_to_tod :
       
 13075     {
       
 13076         symbol_c *last_type_symbol = NULL;
       
 13077 
       
 13078         {
       
 13079             identifier_c param_name("IN");
       
 13080             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13081             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13082             
       
 13083             /* Get the value from a foo(<param_value>) style call */
       
 13084             if (IN_param_value == NULL)
       
 13085               IN_param_value = function_call_param_iterator.next();
       
 13086             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13087             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13088             
       
 13089             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 13090             {
       
 13091         
       
 13092                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 13093                 s4o.print("(");
       
 13094                 return_type_symbol->accept(*this);
       
 13095                 s4o.print(")__int_to_time(");
       
 13096                 IN_param_value->accept(*this);
       
 13097                 s4o.print(")");
       
 13098                 return NULL;
       
 13099                 
       
 13100             }
       
 13101             
       
 13102             ERROR;
       
 13103         }
       
 13104         
       
 13105     }/*function_lword_to_tod*/
       
 13106     break;
       
 13107 
       
 13108 /****
       
 13109  *LWORD_TO_DT
       
 13110  */
       
 13111     case function_lword_to_dt :
       
 13112     {
       
 13113         symbol_c *last_type_symbol = NULL;
       
 13114 
       
 13115         {
       
 13116             identifier_c param_name("IN");
       
 13117             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13118             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13119             
       
 13120             /* Get the value from a foo(<param_value>) style call */
       
 13121             if (IN_param_value == NULL)
       
 13122               IN_param_value = function_call_param_iterator.next();
       
 13123             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13124             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13125             
       
 13126             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 13127             {
       
 13128         
       
 13129                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 13130                 s4o.print("(");
       
 13131                 return_type_symbol->accept(*this);
       
 13132                 s4o.print(")__int_to_time(");
       
 13133                 IN_param_value->accept(*this);
       
 13134                 s4o.print(")");
       
 13135                 return NULL;
       
 13136                 
       
 13137             }
       
 13138             
       
 13139             ERROR;
       
 13140         }
       
 13141         
       
 13142     }/*function_lword_to_dt*/
       
 13143     break;
       
 13144 
       
 13145 /****
       
 13146  *LWORD_TO_STRING
       
 13147  */
       
 13148     case function_lword_to_string :
       
 13149     {
       
 13150         symbol_c *last_type_symbol = NULL;
       
 13151 
       
 13152         {
       
 13153             identifier_c param_name("IN");
       
 13154             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13155             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13156             
       
 13157             /* Get the value from a foo(<param_value>) style call */
       
 13158             if (IN_param_value == NULL)
       
 13159               IN_param_value = function_call_param_iterator.next();
       
 13160             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13161             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13162             
       
 13163             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 13164             {
       
 13165         
       
 13166                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 13167                 s4o.print("(");
       
 13168                 return_type_symbol->accept(*this);
       
 13169                 s4o.print(")__bit_to_string(");
       
 13170                 IN_param_value->accept(*this);
       
 13171                 s4o.print(")");
       
 13172                 return NULL;
       
 13173                 
       
 13174             }
       
 13175             
       
 13176             ERROR;
       
 13177         }
       
 13178         
       
 13179     }/*function_lword_to_string*/
       
 13180     break;
       
 13181 
       
 13182 /****
       
 13183  *LWORD_TO_BYTE
       
 13184  */
       
 13185     case function_lword_to_byte :
       
 13186     {
       
 13187         symbol_c *last_type_symbol = NULL;
       
 13188 
       
 13189         {
       
 13190             identifier_c param_name("IN");
       
 13191             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13192             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13193             
       
 13194             /* Get the value from a foo(<param_value>) style call */
       
 13195             if (IN_param_value == NULL)
       
 13196               IN_param_value = function_call_param_iterator.next();
       
 13197             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13198             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13199             
       
 13200             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 13201             {
       
 13202         
       
 13203                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 13204                 s4o.print("(");
       
 13205                 return_type_symbol->accept(*this);
       
 13206                 s4o.print(")");
       
 13207                 IN_param_value->accept(*this);
       
 13208                 return NULL;
       
 13209                 
       
 13210             }
       
 13211             
       
 13212             ERROR;
       
 13213         }
       
 13214         
       
 13215     }/*function_lword_to_byte*/
       
 13216     break;
       
 13217 
       
 13218 /****
       
 13219  *LWORD_TO_WORD
       
 13220  */
       
 13221     case function_lword_to_word :
       
 13222     {
       
 13223         symbol_c *last_type_symbol = NULL;
       
 13224 
       
 13225         {
       
 13226             identifier_c param_name("IN");
       
 13227             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13228             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13229             
       
 13230             /* Get the value from a foo(<param_value>) style call */
       
 13231             if (IN_param_value == NULL)
       
 13232               IN_param_value = function_call_param_iterator.next();
       
 13233             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13234             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13235             
       
 13236             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 13237             {
       
 13238         
       
 13239                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 13240                 s4o.print("(");
       
 13241                 return_type_symbol->accept(*this);
       
 13242                 s4o.print(")");
       
 13243                 IN_param_value->accept(*this);
       
 13244                 return NULL;
       
 13245                 
       
 13246             }
       
 13247             
       
 13248             ERROR;
       
 13249         }
       
 13250         
       
 13251     }/*function_lword_to_word*/
       
 13252     break;
       
 13253 
       
 13254 /****
       
 13255  *LWORD_TO_DWORD
       
 13256  */
       
 13257     case function_lword_to_dword :
       
 13258     {
       
 13259         symbol_c *last_type_symbol = NULL;
       
 13260 
       
 13261         {
       
 13262             identifier_c param_name("IN");
       
 13263             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13264             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13265             
       
 13266             /* Get the value from a foo(<param_value>) style call */
       
 13267             if (IN_param_value == NULL)
       
 13268               IN_param_value = function_call_param_iterator.next();
       
 13269             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13270             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13271             
       
 13272             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 13273             {
       
 13274         
       
 13275                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 13276                 s4o.print("(");
       
 13277                 return_type_symbol->accept(*this);
       
 13278                 s4o.print(")");
       
 13279                 IN_param_value->accept(*this);
       
 13280                 return NULL;
       
 13281                 
       
 13282             }
       
 13283             
       
 13284             ERROR;
       
 13285         }
       
 13286         
       
 13287     }/*function_lword_to_dword*/
       
 13288     break;
       
 13289 
       
 13290 /****
       
 13291  *TRUNC
       
 13292  */
       
 13293     case function_trunc :
       
 13294     {
 13360     {
 13295         symbol_c *last_type_symbol = NULL;
 13361         symbol_c *last_type_symbol = NULL;
 13296 
 13362 
 13297         {
 13363         {
 13298             identifier_c param_name("IN");
 13364             identifier_c param_name("IN");
 13306             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13372             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13307             
 13373             
 13308             if(search_expression_type->is_real_type(IN_type_symbol))
 13374             if(search_expression_type->is_real_type(IN_type_symbol))
 13309             {
 13375             {
 13310         
 13376         
 13311                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
 13377                 function_name = (symbol_c*)(new pragma_c("sqrt"));
 13312                 s4o.print("(int)");
 13378                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
 13313                 IN_param_value->accept(*this);
       
 13314                 return NULL;
       
 13315                 
       
 13316             }
       
 13317             
       
 13318             ERROR;
       
 13319         }
       
 13320         
       
 13321     }/*function_trunc*/
       
 13322     break;
       
 13323 
       
 13324 /****
       
 13325  *BCD_TO_USINT
       
 13326  */
       
 13327     case function_bcd_to_usint :
       
 13328     {
       
 13329         symbol_c *last_type_symbol = NULL;
       
 13330 
       
 13331         {
       
 13332             identifier_c param_name("IN");
       
 13333             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13334             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13335             
       
 13336             /* Get the value from a foo(<param_value>) style call */
       
 13337             if (IN_param_value == NULL)
       
 13338               IN_param_value = function_call_param_iterator.next();
       
 13339             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13340             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13341             
       
 13342             if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
       
 13343             {
       
 13344         
       
 13345                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 13346                 s4o.print("(");
       
 13347                 return_type_symbol->accept(*this);
       
 13348                 s4o.print(")__bcd_to_uint(");
       
 13349                 IN_param_value->accept(*this);
       
 13350                 s4o.print(")");
       
 13351                 return NULL;
       
 13352                 
       
 13353             }
       
 13354             
       
 13355             ERROR;
       
 13356         }
       
 13357         
       
 13358     }/*function_bcd_to_usint*/
       
 13359     break;
       
 13360 
       
 13361 /****
       
 13362  *BCD_TO_UINT
       
 13363  */
       
 13364     case function_bcd_to_uint :
       
 13365     {
       
 13366         symbol_c *last_type_symbol = NULL;
       
 13367 
       
 13368         {
       
 13369             identifier_c param_name("IN");
       
 13370             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13371             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13372             
       
 13373             /* Get the value from a foo(<param_value>) style call */
       
 13374             if (IN_param_value == NULL)
       
 13375               IN_param_value = function_call_param_iterator.next();
       
 13376             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13377             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13378             
       
 13379             if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
       
 13380             {
       
 13381         
       
 13382                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 13383                 s4o.print("(");
       
 13384                 return_type_symbol->accept(*this);
       
 13385                 s4o.print(")__bcd_to_uint(");
       
 13386                 IN_param_value->accept(*this);
       
 13387                 s4o.print(")");
       
 13388                 return NULL;
       
 13389                 
       
 13390             }
       
 13391             
       
 13392             ERROR;
       
 13393         }
       
 13394         
       
 13395     }/*function_bcd_to_uint*/
       
 13396     break;
       
 13397 
       
 13398 /****
       
 13399  *BCD_TO_UDINT
       
 13400  */
       
 13401     case function_bcd_to_udint :
       
 13402     {
       
 13403         symbol_c *last_type_symbol = NULL;
       
 13404 
       
 13405         {
       
 13406             identifier_c param_name("IN");
       
 13407             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13408             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13409             
       
 13410             /* Get the value from a foo(<param_value>) style call */
       
 13411             if (IN_param_value == NULL)
       
 13412               IN_param_value = function_call_param_iterator.next();
       
 13413             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13414             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13415             
       
 13416             if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
       
 13417             {
       
 13418         
       
 13419                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 13420                 s4o.print("(");
       
 13421                 return_type_symbol->accept(*this);
       
 13422                 s4o.print(")__bcd_to_uint(");
       
 13423                 IN_param_value->accept(*this);
       
 13424                 s4o.print(")");
       
 13425                 return NULL;
       
 13426                 
       
 13427             }
       
 13428             
       
 13429             ERROR;
       
 13430         }
       
 13431         
       
 13432     }/*function_bcd_to_udint*/
       
 13433     break;
       
 13434 
       
 13435 /****
       
 13436  *BCD_TO_ULINT
       
 13437  */
       
 13438     case function_bcd_to_ulint :
       
 13439     {
       
 13440         symbol_c *last_type_symbol = NULL;
       
 13441 
       
 13442         {
       
 13443             identifier_c param_name("IN");
       
 13444             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13445             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13446             
       
 13447             /* Get the value from a foo(<param_value>) style call */
       
 13448             if (IN_param_value == NULL)
       
 13449               IN_param_value = function_call_param_iterator.next();
       
 13450             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13451             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13452             
       
 13453             if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
       
 13454             {
       
 13455         
       
 13456                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 13457                 s4o.print("(");
       
 13458                 return_type_symbol->accept(*this);
       
 13459                 s4o.print(")__bcd_to_uint(");
       
 13460                 IN_param_value->accept(*this);
       
 13461                 s4o.print(")");
       
 13462                 return NULL;
       
 13463                 
       
 13464             }
       
 13465             
       
 13466             ERROR;
       
 13467         }
       
 13468         
       
 13469     }/*function_bcd_to_ulint*/
       
 13470     break;
       
 13471 
       
 13472 /****
       
 13473  *USINT_TO_BCD
       
 13474  */
       
 13475     case function_usint_to_bcd :
       
 13476     {
       
 13477         symbol_c *last_type_symbol = NULL;
       
 13478 
       
 13479         {
       
 13480             identifier_c param_name("IN");
       
 13481             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13482             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13483             
       
 13484             /* Get the value from a foo(<param_value>) style call */
       
 13485             if (IN_param_value == NULL)
       
 13486               IN_param_value = function_call_param_iterator.next();
       
 13487             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13488             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13489             
       
 13490             if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
       
 13491             {
       
 13492         
       
 13493                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
       
 13494                 s4o.print("(");
       
 13495                 return_type_symbol->accept(*this);
       
 13496                 s4o.print(")__uint_to_bcd(");
       
 13497                 IN_param_value->accept(*this);
       
 13498                 s4o.print(")");
       
 13499                 return NULL;
       
 13500                 
       
 13501             }
       
 13502             
       
 13503             ERROR;
       
 13504         }
       
 13505         
       
 13506     }/*function_usint_to_bcd*/
       
 13507     break;
       
 13508 
       
 13509 /****
       
 13510  *UINT_TO_BCD
       
 13511  */
       
 13512     case function_uint_to_bcd :
       
 13513     {
       
 13514         symbol_c *last_type_symbol = NULL;
       
 13515 
       
 13516         {
       
 13517             identifier_c param_name("IN");
       
 13518             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13519             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13520             
       
 13521             /* Get the value from a foo(<param_value>) style call */
       
 13522             if (IN_param_value == NULL)
       
 13523               IN_param_value = function_call_param_iterator.next();
       
 13524             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13525             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13526             
       
 13527             if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
       
 13528             {
       
 13529         
       
 13530                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
       
 13531                 s4o.print("(");
       
 13532                 return_type_symbol->accept(*this);
       
 13533                 s4o.print(")__uint_to_bcd(");
       
 13534                 IN_param_value->accept(*this);
       
 13535                 s4o.print(")");
       
 13536                 return NULL;
       
 13537                 
       
 13538             }
       
 13539             
       
 13540             ERROR;
       
 13541         }
       
 13542         
       
 13543     }/*function_uint_to_bcd*/
       
 13544     break;
       
 13545 
       
 13546 /****
       
 13547  *UDINT_TO_BCD
       
 13548  */
       
 13549     case function_udint_to_bcd :
       
 13550     {
       
 13551         symbol_c *last_type_symbol = NULL;
       
 13552 
       
 13553         {
       
 13554             identifier_c param_name("IN");
       
 13555             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13556             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13557             
       
 13558             /* Get the value from a foo(<param_value>) style call */
       
 13559             if (IN_param_value == NULL)
       
 13560               IN_param_value = function_call_param_iterator.next();
       
 13561             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13562             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13563             
       
 13564             if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
       
 13565             {
       
 13566         
       
 13567                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
       
 13568                 s4o.print("(");
       
 13569                 return_type_symbol->accept(*this);
       
 13570                 s4o.print(")__uint_to_bcd(");
       
 13571                 IN_param_value->accept(*this);
       
 13572                 s4o.print(")");
       
 13573                 return NULL;
       
 13574                 
       
 13575             }
       
 13576             
       
 13577             ERROR;
       
 13578         }
       
 13579         
       
 13580     }/*function_udint_to_bcd*/
       
 13581     break;
       
 13582 
       
 13583 /****
       
 13584  *ULINT_TO_BCD
       
 13585  */
       
 13586     case function_ulint_to_bcd :
       
 13587     {
       
 13588         symbol_c *last_type_symbol = NULL;
       
 13589 
       
 13590         {
       
 13591             identifier_c param_name("IN");
       
 13592             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13593             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13594             
       
 13595             /* Get the value from a foo(<param_value>) style call */
       
 13596             if (IN_param_value == NULL)
       
 13597               IN_param_value = function_call_param_iterator.next();
       
 13598             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13599             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13600             
       
 13601             if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
       
 13602             {
       
 13603         
       
 13604                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
       
 13605                 s4o.print("(");
       
 13606                 return_type_symbol->accept(*this);
       
 13607                 s4o.print(")__uint_to_bcd(");
       
 13608                 IN_param_value->accept(*this);
       
 13609                 s4o.print(")");
       
 13610                 return NULL;
       
 13611                 
       
 13612             }
       
 13613             
       
 13614             ERROR;
       
 13615         }
       
 13616         
       
 13617     }/*function_ulint_to_bcd*/
       
 13618     break;
       
 13619 
       
 13620 /****
       
 13621  *DATE_AND_TIME_TO_TIME_OF_DAY
       
 13622  */
       
 13623     case function_date_and_time_to_time_of_day :
       
 13624     {
       
 13625         symbol_c *last_type_symbol = NULL;
       
 13626 
       
 13627         {
       
 13628             identifier_c param_name("IN");
       
 13629             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13630             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13631             
       
 13632             /* Get the value from a foo(<param_value>) style call */
       
 13633             if (IN_param_value == NULL)
       
 13634               IN_param_value = function_call_param_iterator.next();
       
 13635             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13636             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13637             
       
 13638             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
 13639             {
       
 13640         
       
 13641                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 13642                 s4o.print("__date_and_time_to_time_of_day(");
       
 13643                 IN_param_value->accept(*this);
       
 13644                 s4o.print(")");
       
 13645                 return NULL;
       
 13646                 
       
 13647             }
       
 13648             
       
 13649             ERROR;
       
 13650         }
       
 13651         
       
 13652     }/*function_date_and_time_to_time_of_day*/
       
 13653     break;
       
 13654 
       
 13655 /****
       
 13656  *DATE_AND_TIME_TO_DATE
       
 13657  */
       
 13658     case function_date_and_time_to_date :
       
 13659     {
       
 13660         symbol_c *last_type_symbol = NULL;
       
 13661 
       
 13662         {
       
 13663             identifier_c param_name("IN");
       
 13664             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13665             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13666             
       
 13667             /* Get the value from a foo(<param_value>) style call */
       
 13668             if (IN_param_value == NULL)
       
 13669               IN_param_value = function_call_param_iterator.next();
       
 13670             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13671             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13672             
       
 13673             if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
       
 13674             {
       
 13675         
       
 13676                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 13677                 s4o.print("__date_and_time_to_date(");
       
 13678                 IN_param_value->accept(*this);
       
 13679                 s4o.print(")");
       
 13680                 return NULL;
       
 13681                 
       
 13682             }
       
 13683             
       
 13684             ERROR;
       
 13685         }
       
 13686         
       
 13687     }/*function_date_and_time_to_date*/
       
 13688     break;
       
 13689 
       
 13690 /****
       
 13691  *ABS
       
 13692  */
       
 13693     case function_abs :
       
 13694     {
       
 13695         symbol_c *last_type_symbol = NULL;
       
 13696 
       
 13697         {
       
 13698             identifier_c param_name("IN");
       
 13699             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13700             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13701             
       
 13702             /* Get the value from a foo(<param_value>) style call */
       
 13703             if (IN_param_value == NULL)
       
 13704               IN_param_value = function_call_param_iterator.next();
       
 13705             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13706             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13707             
       
 13708             if(search_expression_type->is_num_type(IN_type_symbol))
       
 13709             {
       
 13710         
       
 13711                 symbol_c * return_type_symbol = IN_type_symbol;
 13379                 symbol_c * return_type_symbol = IN_type_symbol;
 13712                 s4o.print("__abs_");
 13380                 break;
 13713                 IN_type_symbol->accept(*this);
 13381                 
 13714                 s4o.print("(");
 13382             }
 13715                 IN_param_value->accept(*this);
 13383             
 13716                 s4o.print(")");
 13384             
 13717                 return NULL;
 13385             ERROR;
 13718                 
 13386         }
 13719             }
 13387         
 13720             
 13388     }/*function_sqrt*/
 13721             ERROR;
 13389     break;
 13722         }
 13390 
 13723         
 13391 /****
 13724     }/*function_abs*/
 13392  *LN
 13725     break;
 13393  */
 13726 
 13394     case function_ln :
 13727 /****
       
 13728  *SQRT
       
 13729  */
       
 13730     case function_sqrt :
       
 13731     {
 13395     {
 13732         symbol_c *last_type_symbol = NULL;
 13396         symbol_c *last_type_symbol = NULL;
 13733 
 13397 
 13734         {
 13398         {
 13735             identifier_c param_name("IN");
 13399             identifier_c param_name("IN");
 13743             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13407             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13744             
 13408             
 13745             if(search_expression_type->is_real_type(IN_type_symbol))
 13409             if(search_expression_type->is_real_type(IN_type_symbol))
 13746             {
 13410             {
 13747         
 13411         
       
 13412                 function_name = (symbol_c*)(new pragma_c("ln"));
       
 13413                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
 13748                 symbol_c * return_type_symbol = IN_type_symbol;
 13414                 symbol_c * return_type_symbol = IN_type_symbol;
 13749                 s4o.print("sqrt(");
 13415                 break;
 13750                 IN_param_value->accept(*this);
 13416                 
 13751                 s4o.print(")");
 13417             }
 13752                 return NULL;
 13418             
 13753                 
 13419             
 13754             }
 13420             ERROR;
 13755             
 13421         }
 13756             ERROR;
 13422         
 13757         }
 13423     }/*function_ln*/
 13758         
 13424     break;
 13759     }/*function_sqrt*/
 13425 
 13760     break;
 13426 /****
 13761 
 13427  *LOG
 13762 /****
 13428  */
 13763  *LN
 13429     case function_log :
 13764  */
       
 13765     case function_ln :
       
 13766     {
 13430     {
 13767         symbol_c *last_type_symbol = NULL;
 13431         symbol_c *last_type_symbol = NULL;
 13768 
 13432 
 13769         {
 13433         {
 13770             identifier_c param_name("IN");
 13434             identifier_c param_name("IN");
 13778             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13442             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13779             
 13443             
 13780             if(search_expression_type->is_real_type(IN_type_symbol))
 13444             if(search_expression_type->is_real_type(IN_type_symbol))
 13781             {
 13445             {
 13782         
 13446         
       
 13447                 function_name = (symbol_c*)(new pragma_c("log"));
       
 13448                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
 13783                 symbol_c * return_type_symbol = IN_type_symbol;
 13449                 symbol_c * return_type_symbol = IN_type_symbol;
 13784                 s4o.print("ln(");
 13450                 break;
 13785                 IN_param_value->accept(*this);
 13451                 
 13786                 s4o.print(")");
 13452             }
 13787                 return NULL;
 13453             
 13788                 
 13454             
 13789             }
 13455             ERROR;
 13790             
 13456         }
 13791             ERROR;
 13457         
 13792         }
 13458     }/*function_log*/
 13793         
 13459     break;
 13794     }/*function_ln*/
 13460 
 13795     break;
 13461 /****
 13796 
 13462  *EXP
 13797 /****
 13463  */
 13798  *LOG
 13464     case function_exp :
 13799  */
       
 13800     case function_log :
       
 13801     {
 13465     {
 13802         symbol_c *last_type_symbol = NULL;
 13466         symbol_c *last_type_symbol = NULL;
 13803 
 13467 
 13804         {
 13468         {
 13805             identifier_c param_name("IN");
 13469             identifier_c param_name("IN");
 13813             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13477             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13814             
 13478             
 13815             if(search_expression_type->is_real_type(IN_type_symbol))
 13479             if(search_expression_type->is_real_type(IN_type_symbol))
 13816             {
 13480             {
 13817         
 13481         
       
 13482                 function_name = (symbol_c*)(new pragma_c("exp"));
       
 13483                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
 13818                 symbol_c * return_type_symbol = IN_type_symbol;
 13484                 symbol_c * return_type_symbol = IN_type_symbol;
 13819                 s4o.print("log(");
 13485                 break;
 13820                 IN_param_value->accept(*this);
 13486                 
 13821                 s4o.print(")");
 13487             }
 13822                 return NULL;
 13488             
 13823                 
 13489             
 13824             }
 13490             ERROR;
 13825             
 13491         }
 13826             ERROR;
 13492         
 13827         }
 13493     }/*function_exp*/
 13828         
 13494     break;
 13829     }/*function_log*/
 13495 
 13830     break;
 13496 /****
 13831 
 13497  *SIN
 13832 /****
 13498  */
 13833  *EXP
 13499     case function_sin :
 13834  */
       
 13835     case function_exp :
       
 13836     {
 13500     {
 13837         symbol_c *last_type_symbol = NULL;
 13501         symbol_c *last_type_symbol = NULL;
 13838 
 13502 
 13839         {
 13503         {
 13840             identifier_c param_name("IN");
 13504             identifier_c param_name("IN");
 13848             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13512             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13849             
 13513             
 13850             if(search_expression_type->is_real_type(IN_type_symbol))
 13514             if(search_expression_type->is_real_type(IN_type_symbol))
 13851             {
 13515             {
 13852         
 13516         
       
 13517                 function_name = (symbol_c*)(new pragma_c("sin"));
       
 13518                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
 13853                 symbol_c * return_type_symbol = IN_type_symbol;
 13519                 symbol_c * return_type_symbol = IN_type_symbol;
 13854                 s4o.print("exp(");
 13520                 break;
 13855                 IN_param_value->accept(*this);
 13521                 
 13856                 s4o.print(")");
 13522             }
 13857                 return NULL;
 13523             
 13858                 
 13524             
 13859             }
 13525             ERROR;
 13860             
 13526         }
 13861             ERROR;
 13527         
 13862         }
 13528     }/*function_sin*/
 13863         
 13529     break;
 13864     }/*function_exp*/
 13530 
 13865     break;
 13531 /****
 13866 
 13532  *COS
 13867 /****
 13533  */
 13868  *SIN
 13534     case function_cos :
 13869  */
       
 13870     case function_sin :
       
 13871     {
 13535     {
 13872         symbol_c *last_type_symbol = NULL;
 13536         symbol_c *last_type_symbol = NULL;
 13873 
 13537 
 13874         {
 13538         {
 13875             identifier_c param_name("IN");
 13539             identifier_c param_name("IN");
 13883             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13547             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13884             
 13548             
 13885             if(search_expression_type->is_real_type(IN_type_symbol))
 13549             if(search_expression_type->is_real_type(IN_type_symbol))
 13886             {
 13550             {
 13887         
 13551         
       
 13552                 function_name = (symbol_c*)(new pragma_c("cos"));
       
 13553                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
 13888                 symbol_c * return_type_symbol = IN_type_symbol;
 13554                 symbol_c * return_type_symbol = IN_type_symbol;
 13889                 s4o.print("sin(");
 13555                 break;
 13890                 IN_param_value->accept(*this);
 13556                 
 13891                 s4o.print(")");
 13557             }
 13892                 return NULL;
 13558             
 13893                 
 13559             
 13894             }
 13560             ERROR;
 13895             
 13561         }
 13896             ERROR;
 13562         
 13897         }
 13563     }/*function_cos*/
 13898         
 13564     break;
 13899     }/*function_sin*/
 13565 
 13900     break;
 13566 /****
 13901 
 13567  *TAN
 13902 /****
 13568  */
 13903  *COS
 13569     case function_tan :
 13904  */
       
 13905     case function_cos :
       
 13906     {
 13570     {
 13907         symbol_c *last_type_symbol = NULL;
 13571         symbol_c *last_type_symbol = NULL;
 13908 
 13572 
 13909         {
 13573         {
 13910             identifier_c param_name("IN");
 13574             identifier_c param_name("IN");
 13918             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13582             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13919             
 13583             
 13920             if(search_expression_type->is_real_type(IN_type_symbol))
 13584             if(search_expression_type->is_real_type(IN_type_symbol))
 13921             {
 13585             {
 13922         
 13586         
       
 13587                 function_name = (symbol_c*)(new pragma_c("tan"));
       
 13588                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
 13923                 symbol_c * return_type_symbol = IN_type_symbol;
 13589                 symbol_c * return_type_symbol = IN_type_symbol;
 13924                 s4o.print("cos(");
 13590                 break;
 13925                 IN_param_value->accept(*this);
 13591                 
 13926                 s4o.print(")");
 13592             }
 13927                 return NULL;
 13593             
 13928                 
 13594             
 13929             }
 13595             ERROR;
 13930             
 13596         }
 13931             ERROR;
 13597         
 13932         }
 13598     }/*function_tan*/
 13933         
 13599     break;
 13934     }/*function_cos*/
 13600 
 13935     break;
 13601 /****
 13936 
 13602  *ASIN
 13937 /****
 13603  */
 13938  *TAN
 13604     case function_asin :
 13939  */
       
 13940     case function_tan :
       
 13941     {
 13605     {
 13942         symbol_c *last_type_symbol = NULL;
 13606         symbol_c *last_type_symbol = NULL;
 13943 
 13607 
 13944         {
 13608         {
 13945             identifier_c param_name("IN");
 13609             identifier_c param_name("IN");
 13953             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13617             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13954             
 13618             
 13955             if(search_expression_type->is_real_type(IN_type_symbol))
 13619             if(search_expression_type->is_real_type(IN_type_symbol))
 13956             {
 13620             {
 13957         
 13621         
       
 13622                 function_name = (symbol_c*)(new pragma_c("asin"));
       
 13623                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
 13958                 symbol_c * return_type_symbol = IN_type_symbol;
 13624                 symbol_c * return_type_symbol = IN_type_symbol;
 13959                 s4o.print("tan(");
 13625                 break;
 13960                 IN_param_value->accept(*this);
 13626                 
 13961                 s4o.print(")");
 13627             }
 13962                 return NULL;
 13628             
 13963                 
 13629             
 13964             }
 13630             ERROR;
 13965             
 13631         }
 13966             ERROR;
 13632         
 13967         }
 13633     }/*function_asin*/
 13968         
 13634     break;
 13969     }/*function_tan*/
 13635 
 13970     break;
 13636 /****
 13971 
 13637  *ACOS
 13972 /****
 13638  */
 13973  *ASIN
 13639     case function_acos :
 13974  */
       
 13975     case function_asin :
       
 13976     {
 13640     {
 13977         symbol_c *last_type_symbol = NULL;
 13641         symbol_c *last_type_symbol = NULL;
 13978 
 13642 
 13979         {
 13643         {
 13980             identifier_c param_name("IN");
 13644             identifier_c param_name("IN");
 13988             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13652             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13989             
 13653             
 13990             if(search_expression_type->is_real_type(IN_type_symbol))
 13654             if(search_expression_type->is_real_type(IN_type_symbol))
 13991             {
 13655             {
 13992         
 13656         
       
 13657                 function_name = (symbol_c*)(new pragma_c("acos"));
       
 13658                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
 13993                 symbol_c * return_type_symbol = IN_type_symbol;
 13659                 symbol_c * return_type_symbol = IN_type_symbol;
 13994                 s4o.print("asin(");
 13660                 break;
 13995                 IN_param_value->accept(*this);
 13661                 
 13996                 s4o.print(")");
 13662             }
 13997                 return NULL;
 13663             
 13998                 
 13664             
 13999             }
 13665             ERROR;
 14000             
 13666         }
 14001             ERROR;
 13667         
 14002         }
 13668     }/*function_acos*/
 14003         
 13669     break;
 14004     }/*function_asin*/
 13670 
 14005     break;
 13671 /****
 14006 
 13672  *ATAN
 14007 /****
 13673  */
 14008  *ACOS
 13674     case function_atan :
 14009  */
       
 14010     case function_acos :
       
 14011     {
 13675     {
 14012         symbol_c *last_type_symbol = NULL;
 13676         symbol_c *last_type_symbol = NULL;
 14013 
 13677 
 14014         {
 13678         {
 14015             identifier_c param_name("IN");
 13679             identifier_c param_name("IN");
 14023             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13687             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 14024             
 13688             
 14025             if(search_expression_type->is_real_type(IN_type_symbol))
 13689             if(search_expression_type->is_real_type(IN_type_symbol))
 14026             {
 13690             {
 14027         
 13691         
       
 13692                 function_name = (symbol_c*)(new pragma_c("atan"));
       
 13693                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
 14028                 symbol_c * return_type_symbol = IN_type_symbol;
 13694                 symbol_c * return_type_symbol = IN_type_symbol;
 14029                 s4o.print("acos(");
 13695                 break;
 14030                 IN_param_value->accept(*this);
 13696                 
 14031                 s4o.print(")");
 13697             }
 14032                 return NULL;
 13698             
 14033                 
       
 14034             }
       
 14035             
       
 14036             ERROR;
       
 14037         }
       
 14038         
       
 14039     }/*function_acos*/
       
 14040     break;
       
 14041 
       
 14042 /****
       
 14043  *ATAN
       
 14044  */
       
 14045     case function_atan :
       
 14046     {
       
 14047         symbol_c *last_type_symbol = NULL;
       
 14048 
       
 14049         {
       
 14050             identifier_c param_name("IN");
       
 14051             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14052             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14053             
       
 14054             /* Get the value from a foo(<param_value>) style call */
       
 14055             if (IN_param_value == NULL)
       
 14056               IN_param_value = function_call_param_iterator.next();
       
 14057             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14058             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14059             
       
 14060             if(search_expression_type->is_real_type(IN_type_symbol))
       
 14061             {
       
 14062         
       
 14063                 symbol_c * return_type_symbol = IN_type_symbol;
       
 14064                 s4o.print("atan(");
       
 14065                 IN_param_value->accept(*this);
       
 14066                 s4o.print(")");
       
 14067                 return NULL;
       
 14068                 
       
 14069             }
       
 14070             
 13699             
 14071             ERROR;
 13700             ERROR;
 14072         }
 13701         }
 14073         
 13702         
 14074     }/*function_atan*/
 13703     }/*function_atan*/
 14107                     last_type_symbol = last_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 ;
 13736                     last_type_symbol = last_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 ;
 14108                     
 13737                     
 14109                     if(search_expression_type->is_num_type(IN2_type_symbol))
 13738                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14110                     {
 13739                     {
 14111                 
 13740                 
 14112                         symbol_c * return_type_symbol = last_type_symbol;
 13741                         function_name = (symbol_c*)(new pragma_c("__add_"));
 14113                         s4o.indent_right();
 13742                         
 14114                         s4o.print("(\n" + s4o.indent_spaces);
 13743                         char nb_param_str[10];
 14115                         IN1_param_value->accept(*this);
 13744                         sprintf(nb_param_str, "%d", nb_param);
 14116                         s4o.print("+\n" + s4o.indent_spaces);
 13745                         ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 14117                         IN2_param_value->accept(*this);
 13746                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 13747                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14118                         
 13748                         
 14119                         int base_num = 3;
 13749                         int base_num = 3;
 14120                         symbol_c *param_value = NULL;
 13750                         symbol_c *param_value = NULL;
 14121                         do{
 13751                         do{
 14122                             char my_name[10];
 13752                             char my_name[10];
 14132                             if (param_value != NULL){
 13762                             if (param_value != NULL){
 14133                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 13763                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 14134                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 13764                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 14135                             
 13765                             
 14136                                 /*Function specific CODE */
 13766                                 /*Function specific CODE */
 14137                                 s4o.print("+\n" + s4o.indent_spaces);
 13767                                 ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 14138                                 param_value->accept(*this);
       
 14139                                 
       
 14140                             }
 13768                             }
 14141                             
 13769                             
 14142                         }while(param_value != NULL);
 13770                         }while(param_value != NULL);
 14143                         s4o.print(")");
 13771                         symbol_c * return_type_symbol = last_type_symbol;
 14144                         s4o.indent_left();
 13772                         function_type_suffix = return_type_symbol;
 14145                         return NULL;
 13773                         break;
 14146                         
       
 14147                         
 13774                         
 14148                     }
 13775                     }
       
 13776                     
 14149                     
 13777                     
 14150                     ERROR;
 13778                     ERROR;
 14151                 }
 13779                 }
 14152                 
 13780                 
 14153             }
 13781             }
 14167                     last_type_symbol = last_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 ;
 13795                     last_type_symbol = last_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 ;
 14168                     
 13796                     
 14169                     if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 13797                     if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14170                     {
 13798                     {
 14171                 
 13799                 
       
 13800                         function_name = (symbol_c*)(new pragma_c("__time_add"));
       
 13801                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 13802                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14172                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
 13803                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
 14173                         s4o.print("__time_add(");
 13804                         break;
 14174                         IN1_param_value->accept(*this);
       
 14175                         s4o.print(", ");
       
 14176                         IN2_param_value->accept(*this);
       
 14177                         s4o.print(")");
       
 14178                         return NULL;
       
 14179                         
 13805                         
 14180                     }
 13806                     }
       
 13807                     
 14181                     
 13808                     
 14182                     ERROR;
 13809                     ERROR;
 14183                 }
 13810                 }
 14184                 
 13811                 
 14185             }
 13812             }
 14199                     last_type_symbol = last_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 ;
 13826                     last_type_symbol = last_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 ;
 14200                     
 13827                     
 14201                     if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 13828                     if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14202                     {
 13829                     {
 14203                 
 13830                 
       
 13831                         function_name = (symbol_c*)(new pragma_c("__time_add"));
       
 13832                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 13833                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14204                         symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
 13834                         symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
 14205                         s4o.print("__time_add(");
 13835                         break;
 14206                         IN1_param_value->accept(*this);
       
 14207                         s4o.print(", ");
       
 14208                         IN2_param_value->accept(*this);
       
 14209                         s4o.print(")");
       
 14210                         return NULL;
       
 14211                         
 13836                         
 14212                     }
 13837                     }
       
 13838                     
 14213                     
 13839                     
 14214                     ERROR;
 13840                     ERROR;
 14215                 }
 13841                 }
 14216                 
 13842                 
 14217             }
 13843             }
 14231                     last_type_symbol = last_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 ;
 13857                     last_type_symbol = last_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 ;
 14232                     
 13858                     
 14233                     if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 13859                     if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14234                     {
 13860                     {
 14235                 
 13861                 
       
 13862                         function_name = (symbol_c*)(new pragma_c("__time_add"));
       
 13863                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 13864                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14236                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 13865                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14237                         s4o.print("__time_add(");
 13866                         break;
 14238                         IN1_param_value->accept(*this);
       
 14239                         s4o.print(", ");
       
 14240                         IN2_param_value->accept(*this);
       
 14241                         s4o.print(")");
       
 14242                         return NULL;
       
 14243                         
 13867                         
 14244                     }
 13868                     }
 14245                     
 13869                     
       
 13870                     
 14246                     ERROR;
 13871                     ERROR;
 14247                 }
 13872                 }
 14248                 
 13873                 
 14249             }
 13874             }
       
 13875             
 14250             
 13876             
 14251             ERROR;
 13877             ERROR;
 14252         }
 13878         }
 14253         
 13879         
 14254     }/*function_add*/
 13880     }/*function_add*/
 14287                     last_type_symbol = last_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 ;
 13913                     last_type_symbol = last_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 ;
 14288                     
 13914                     
 14289                     if(search_expression_type->is_num_type(IN2_type_symbol))
 13915                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14290                     {
 13916                     {
 14291                 
 13917                 
 14292                         symbol_c * return_type_symbol = last_type_symbol;
 13918                         function_name = (symbol_c*)(new pragma_c("__mul_"));
 14293                         s4o.indent_right();
 13919                         
 14294                         s4o.print("(\n" + s4o.indent_spaces);
 13920                         char nb_param_str[10];
 14295                         IN1_param_value->accept(*this);
 13921                         sprintf(nb_param_str, "%d", nb_param);
 14296                         s4o.print("*\n" + s4o.indent_spaces);
 13922                         ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 14297                         IN2_param_value->accept(*this);
 13923                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 13924                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14298                         
 13925                         
 14299                         int base_num = 3;
 13926                         int base_num = 3;
 14300                         symbol_c *param_value = NULL;
 13927                         symbol_c *param_value = NULL;
 14301                         do{
 13928                         do{
 14302                             char my_name[10];
 13929                             char my_name[10];
 14312                             if (param_value != NULL){
 13939                             if (param_value != NULL){
 14313                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 13940                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 14314                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 13941                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 14315                             
 13942                             
 14316                                 /*Function specific CODE */
 13943                                 /*Function specific CODE */
 14317                                 s4o.print("*\n" + s4o.indent_spaces);
 13944                                 ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 14318                                 param_value->accept(*this);
       
 14319                                 
       
 14320                             }
 13945                             }
 14321                             
 13946                             
 14322                         }while(param_value != NULL);
 13947                         }while(param_value != NULL);
 14323                         s4o.print(")");
 13948                         symbol_c * return_type_symbol = last_type_symbol;
 14324                         s4o.indent_left();
 13949                         function_type_suffix = return_type_symbol;
 14325                         return NULL;
 13950                         break;
 14326                         
       
 14327                         
 13951                         
 14328                     }
 13952                     }
       
 13953                     
 14329                     
 13954                     
 14330                     ERROR;
 13955                     ERROR;
 14331                 }
 13956                 }
 14332                 
 13957                 
 14333             }
 13958             }
 14347                     last_type_symbol = last_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 ;
 13972                     last_type_symbol = last_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 ;
 14348                     
 13973                     
 14349                     if(search_expression_type->is_num_type(IN2_type_symbol))
 13974                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14350                     {
 13975                     {
 14351                 
 13976                 
       
 13977                         function_name = (symbol_c*)(new pragma_c("__time_mul"));
       
 13978                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 13979                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14352                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 13980                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14353                         s4o.print("__time_mul(");
 13981                         break;
 14354                         IN1_param_value->accept(*this);
       
 14355                         s4o.print(", ");
       
 14356                         IN2_param_value->accept(*this);
       
 14357                         s4o.print(")");
       
 14358                         return NULL;
       
 14359                         
 13982                         
 14360                     }
 13983                     }
 14361                     
 13984                     
       
 13985                     
 14362                     ERROR;
 13986                     ERROR;
 14363                 }
 13987                 }
 14364                 
 13988                 
 14365             }
 13989             }
       
 13990             
 14366             
 13991             
 14367             ERROR;
 13992             ERROR;
 14368         }
 13993         }
 14369         
 13994         
 14370     }/*function_mul*/
 13995     }/*function_mul*/
 14403                     last_type_symbol = last_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 ;
 14028                     last_type_symbol = last_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 ;
 14404                     
 14029                     
 14405                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14030                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14406                     {
 14031                     {
 14407                 
 14032                 
       
 14033                         function_name = (symbol_c*)(new pragma_c("__sub_"));
       
 14034                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14035                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14408                         symbol_c * return_type_symbol = last_type_symbol;
 14036                         symbol_c * return_type_symbol = last_type_symbol;
 14409                         s4o.indent_right();
 14037                         function_type_suffix = return_type_symbol;
 14410                         s4o.print("(\n" + s4o.indent_spaces);
 14038                         break;
 14411                         IN1_param_value->accept(*this);
       
 14412                         s4o.print("-\n" + s4o.indent_spaces);
       
 14413                         IN2_param_value->accept(*this);
       
 14414                         s4o.print(")");
       
 14415                         s4o.indent_left();
       
 14416                         return NULL;
       
 14417                         
 14039                         
 14418                     }
 14040                     }
       
 14041                     
 14419                     
 14042                     
 14420                     ERROR;
 14043                     ERROR;
 14421                 }
 14044                 }
 14422                 
 14045                 
 14423             }
 14046             }
 14437                     last_type_symbol = last_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 ;
 14060                     last_type_symbol = last_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 ;
 14438                     
 14061                     
 14439                     if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
 14062                     if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
 14440                     {
 14063                     {
 14441                 
 14064                 
       
 14065                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
       
 14066                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14067                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14442                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14068                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14443                         s4o.print("__time_sub(");
 14069                         break;
 14444                         IN1_param_value->accept(*this);
       
 14445                         s4o.print(", ");
       
 14446                         IN2_param_value->accept(*this);
       
 14447                         s4o.print(")");
       
 14448                         return NULL;
       
 14449                         
 14070                         
 14450                     }
 14071                     }
       
 14072                     
 14451                     
 14073                     
 14452                     ERROR;
 14074                     ERROR;
 14453                 }
 14075                 }
 14454                 
 14076                 
 14455             }
 14077             }
 14469                     last_type_symbol = last_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 ;
 14091                     last_type_symbol = last_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 ;
 14470                     
 14092                     
 14471                     if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
 14093                     if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
 14472                     {
 14094                     {
 14473                 
 14095                 
       
 14096                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
       
 14097                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14098                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14474                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14099                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14475                         s4o.print("__time_sub(");
 14100                         break;
 14476                         IN1_param_value->accept(*this);
       
 14477                         s4o.print(", ");
       
 14478                         IN2_param_value->accept(*this);
       
 14479                         s4o.print(")");
       
 14480                         return NULL;
       
 14481                         
 14101                         
 14482                     }
 14102                     }
 14483                     
 14103                     
 14484                     if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14104                     if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14485                     {
 14105                     {
 14486                 
 14106                 
       
 14107                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
       
 14108                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14109                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14487                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
 14110                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
 14488                         s4o.print("__time_sub(");
 14111                         break;
 14489                         IN1_param_value->accept(*this);
       
 14490                         s4o.print(", ");
       
 14491                         IN2_param_value->accept(*this);
       
 14492                         s4o.print(")");
       
 14493                         return NULL;
       
 14494                         
 14112                         
 14495                     }
 14113                     }
       
 14114                     
 14496                     
 14115                     
 14497                     ERROR;
 14116                     ERROR;
 14498                 }
 14117                 }
 14499                 
 14118                 
 14500             }
 14119             }
 14514                     last_type_symbol = last_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 ;
 14133                     last_type_symbol = last_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 ;
 14515                     
 14134                     
 14516                     if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
 14135                     if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
 14517                     {
 14136                     {
 14518                 
 14137                 
       
 14138                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
       
 14139                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14140                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14519                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14141                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14520                         s4o.print("__time_sub(");
 14142                         break;
 14521                         IN1_param_value->accept(*this);
       
 14522                         s4o.print(", ");
       
 14523                         IN2_param_value->accept(*this);
       
 14524                         s4o.print(")");
       
 14525                         return NULL;
       
 14526                         
 14143                         
 14527                     }
 14144                     }
 14528                     
 14145                     
 14529                     if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14146                     if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14530                     {
 14147                     {
 14531                 
 14148                 
       
 14149                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
       
 14150                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14151                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14532                         symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
 14152                         symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
 14533                         s4o.print("__time_sub(");
 14153                         break;
 14534                         IN1_param_value->accept(*this);
       
 14535                         s4o.print(", ");
       
 14536                         IN2_param_value->accept(*this);
       
 14537                         s4o.print(")");
       
 14538                         return NULL;
       
 14539                         
 14154                         
 14540                     }
 14155                     }
       
 14156                     
 14541                     
 14157                     
 14542                     ERROR;
 14158                     ERROR;
 14543                 }
 14159                 }
 14544                 
 14160                 
 14545             }
 14161             }
 14559                     last_type_symbol = last_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 ;
 14175                     last_type_symbol = last_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 ;
 14560                     
 14176                     
 14561                     if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14177                     if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
 14562                     {
 14178                     {
 14563                 
 14179                 
       
 14180                         function_name = (symbol_c*)(new pragma_c("__time_sub"));
       
 14181                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14182                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14564                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14183                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14565                         s4o.print("__time_sub(");
 14184                         break;
 14566                         IN1_param_value->accept(*this);
       
 14567                         s4o.print(", ");
       
 14568                         IN2_param_value->accept(*this);
       
 14569                         s4o.print(")");
       
 14570                         return NULL;
       
 14571                         
 14185                         
 14572                     }
 14186                     }
 14573                     
 14187                     
       
 14188                     
 14574                     ERROR;
 14189                     ERROR;
 14575                 }
 14190                 }
 14576                 
 14191                 
 14577             }
 14192             }
       
 14193             
 14578             
 14194             
 14579             ERROR;
 14195             ERROR;
 14580         }
 14196         }
 14581         
 14197         
 14582     }/*function_sub*/
 14198     }/*function_sub*/
 14615                     last_type_symbol = last_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 ;
 14231                     last_type_symbol = last_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 ;
 14616                     
 14232                     
 14617                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14233                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14618                     {
 14234                     {
 14619                 
 14235                 
       
 14236                         function_name = (symbol_c*)(new pragma_c("__div_"));
       
 14237                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14238                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14620                         symbol_c * return_type_symbol = last_type_symbol;
 14239                         symbol_c * return_type_symbol = last_type_symbol;
 14621                         s4o.indent_right();
 14240                         function_type_suffix = return_type_symbol;
 14622                         s4o.print("(\n" + s4o.indent_spaces);
 14241                         break;
 14623                         IN1_param_value->accept(*this);
       
 14624                         s4o.print("/\n" + s4o.indent_spaces);
       
 14625                         IN2_param_value->accept(*this);
       
 14626                         s4o.print(")");
       
 14627                         s4o.indent_left();
       
 14628                         return NULL;
       
 14629                         
 14242                         
 14630                     }
 14243                     }
       
 14244                     
 14631                     
 14245                     
 14632                     ERROR;
 14246                     ERROR;
 14633                 }
 14247                 }
 14634                 
 14248                 
 14635             }
 14249             }
 14649                     last_type_symbol = last_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 ;
 14263                     last_type_symbol = last_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 ;
 14650                     
 14264                     
 14651                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14265                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14652                     {
 14266                     {
 14653                 
 14267                 
       
 14268                         function_name = (symbol_c*)(new pragma_c("__time_div"));
       
 14269                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14270                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14654                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14271                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14655                         s4o.print("__time_div(");
 14272                         break;
 14656                         IN1_param_value->accept(*this);
       
 14657                         s4o.print(", ");
       
 14658                         IN2_param_value->accept(*this);
       
 14659                         s4o.print(")");
       
 14660                         return NULL;
       
 14661                         
 14273                         
 14662                     }
 14274                     }
 14663                     
 14275                     
       
 14276                     
 14664                     ERROR;
 14277                     ERROR;
 14665                 }
 14278                 }
 14666                 
 14279                 
 14667             }
 14280             }
       
 14281             
 14668             
 14282             
 14669             ERROR;
 14283             ERROR;
 14670         }
 14284         }
 14671         
 14285         
 14672     }/*function_div*/
 14286     }/*function_div*/
 14705                     last_type_symbol = last_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 ;
 14319                     last_type_symbol = last_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 ;
 14706                     
 14320                     
 14707                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14321                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14708                     {
 14322                     {
 14709                 
 14323                 
       
 14324                         function_name = (symbol_c*)(new pragma_c("__mod_"));
       
 14325                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14326                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14710                         symbol_c * return_type_symbol = last_type_symbol;
 14327                         symbol_c * return_type_symbol = last_type_symbol;
 14711                         s4o.indent_right();
 14328                         function_type_suffix = return_type_symbol;
 14712                         s4o.print("(\n" + s4o.indent_spaces);
 14329                         break;
 14713                         IN1_param_value->accept(*this);
       
 14714                         s4o.print("%\n" + s4o.indent_spaces);
       
 14715                         IN2_param_value->accept(*this);
       
 14716                         s4o.print(")");
       
 14717                         s4o.indent_left();
       
 14718                         return NULL;
       
 14719                         
 14330                         
 14720                     }
 14331                     }
 14721                     
 14332                     
       
 14333                     
 14722                     ERROR;
 14334                     ERROR;
 14723                 }
 14335                 }
 14724                 
 14336                 
 14725             }
 14337             }
       
 14338             
 14726             
 14339             
 14727             ERROR;
 14340             ERROR;
 14728         }
 14341         }
 14729         
 14342         
 14730     }/*function_mod*/
 14343     }/*function_mod*/
 14763                     last_type_symbol = last_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 ;
 14376                     last_type_symbol = last_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 ;
 14764                     
 14377                     
 14765                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14378                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14766                     {
 14379                     {
 14767                 
 14380                 
       
 14381                         function_name = (symbol_c*)(new pragma_c("pow"));
       
 14382                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 14383                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 14768                         symbol_c * return_type_symbol = last_type_symbol;
 14384                         symbol_c * return_type_symbol = last_type_symbol;
 14769                         s4o.print("pow(");
 14385                         break;
 14770                         IN1_param_value->accept(*this);
       
 14771                         s4o.print(", ");
       
 14772                         IN2_param_value->accept(*this);
       
 14773                         s4o.print(")");
       
 14774                         return NULL;
       
 14775                         
 14386                         
 14776                     }
 14387                     }
 14777                     
 14388                     
       
 14389                     
 14778                     ERROR;
 14390                     ERROR;
 14779                 }
 14391                 }
 14780                 
 14392                 
 14781             }
 14393             }
 14782             
 14394             
       
 14395             
 14783             ERROR;
 14396             ERROR;
 14784         }
 14397         }
 14785         
 14398         
 14786     }/*function_expt*/
 14399     }/*function_expt*/
 14787     break;
 14400     break;
 14805             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 14418             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 14806             
 14419             
 14807             if(search_expression_type->is_num_type(IN_type_symbol))
 14420             if(search_expression_type->is_num_type(IN_type_symbol))
 14808             {
 14421             {
 14809         
 14422         
       
 14423                 function_name = (symbol_c*)(new pragma_c("__move_"));
       
 14424                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
 14810                 symbol_c * return_type_symbol = last_type_symbol;
 14425                 symbol_c * return_type_symbol = last_type_symbol;
 14811                 IN_param_value->accept(*this);
 14426                 function_type_suffix = return_type_symbol;
 14812                 return NULL;
 14427                 break;
 14813                 
 14428                 
 14814             }
 14429             }
       
 14430             
 14815             
 14431             
 14816             ERROR;
 14432             ERROR;
 14817         }
 14433         }
 14818         
 14434         
 14819     }/*function_move*/
 14435     }/*function_move*/
 14852                     last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
 14468                     last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
 14853                     
 14469                     
 14854                     if(search_expression_type->is_integer_type(N_type_symbol))
 14470                     if(search_expression_type->is_integer_type(N_type_symbol))
 14855                     {
 14471                     {
 14856                 
 14472                 
       
 14473                         function_name = (symbol_c*)(new pragma_c("__shl_"));
       
 14474                         ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 14475                         ADD_PARAM_LIST(N_param_value, N_type_symbol, function_param_iterator_c::direction_in)
 14857                         symbol_c * return_type_symbol = IN_type_symbol;
 14476                         symbol_c * return_type_symbol = IN_type_symbol;
 14858                         IN_param_value->accept(*this);
 14477                         function_type_suffix = IN_type_symbol;
 14859                         s4o.print("<<");
 14478                         break;
 14860                         N_param_value->accept(*this);
       
 14861                         return NULL;
       
 14862                         
 14479                         
 14863                     }
 14480                     }
 14864                     
 14481                     
       
 14482                     
 14865                     ERROR;
 14483                     ERROR;
 14866                 }
 14484                 }
 14867                 
 14485                 
 14868             }
 14486             }
       
 14487             
 14869             
 14488             
 14870             ERROR;
 14489             ERROR;
 14871         }
 14490         }
 14872         
 14491         
 14873     }/*function_shl*/
 14492     }/*function_shl*/
 14906                     last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
 14525                     last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
 14907                     
 14526                     
 14908                     if(search_expression_type->is_integer_type(N_type_symbol))
 14527                     if(search_expression_type->is_integer_type(N_type_symbol))
 14909                     {
 14528                     {
 14910                 
 14529                 
       
 14530                         function_name = (symbol_c*)(new pragma_c("__shr_"));
       
 14531                         ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 14532                         ADD_PARAM_LIST(N_param_value, N_type_symbol, function_param_iterator_c::direction_in)
 14911                         symbol_c * return_type_symbol = IN_type_symbol;
 14533                         symbol_c * return_type_symbol = IN_type_symbol;
 14912                         IN_param_value->accept(*this);
 14534                         function_type_suffix = IN_type_symbol;
 14913                         s4o.print(">>");
 14535                         break;
 14914                         N_param_value->accept(*this);
       
 14915                         return NULL;
       
 14916                         
 14536                         
 14917                     }
 14537                     }
 14918                     
 14538                     
       
 14539                     
 14919                     ERROR;
 14540                     ERROR;
 14920                 }
 14541                 }
 14921                 
 14542                 
 14922             }
 14543             }
       
 14544             
 14923             
 14545             
 14924             ERROR;
 14546             ERROR;
 14925         }
 14547         }
 14926         
 14548         
 14927     }/*function_shr*/
 14549     }/*function_shr*/
 14960                     last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
 14582                     last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
 14961                     
 14583                     
 14962                     if(search_expression_type->is_integer_type(N_type_symbol))
 14584                     if(search_expression_type->is_integer_type(N_type_symbol))
 14963                     {
 14585                     {
 14964                 
 14586                 
       
 14587                         function_name = (symbol_c*)(new pragma_c("__ror_"));
       
 14588                         ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 14589                         ADD_PARAM_LIST(N_param_value, N_type_symbol, function_param_iterator_c::direction_in)
 14965                         symbol_c * return_type_symbol = IN_type_symbol;
 14590                         symbol_c * return_type_symbol = IN_type_symbol;
 14966                         s4o.print("__ror_");
 14591                         function_type_suffix = IN_type_symbol;
 14967                         IN_type_symbol->accept(*this);
 14592                         break;
 14968                         s4o.print("(");
       
 14969                         IN_param_value->accept(*this);
       
 14970                         s4o.print(", ");
       
 14971                         N_param_value->accept(*this);
       
 14972                         s4o.print(")");
       
 14973                         return NULL;
       
 14974                         
 14593                         
 14975                     }
 14594                     }
 14976                     
 14595                     
       
 14596                     
 14977                     ERROR;
 14597                     ERROR;
 14978                 }
 14598                 }
 14979                 
 14599                 
 14980             }
 14600             }
       
 14601             
 14981             
 14602             
 14982             ERROR;
 14603             ERROR;
 14983         }
 14604         }
 14984         
 14605         
 14985     }/*function_ror*/
 14606     }/*function_ror*/
 15018                     last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
 14639                     last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
 15019                     
 14640                     
 15020                     if(search_expression_type->is_integer_type(N_type_symbol))
 14641                     if(search_expression_type->is_integer_type(N_type_symbol))
 15021                     {
 14642                     {
 15022                 
 14643                 
       
 14644                         function_name = (symbol_c*)(new pragma_c("__rol_"));
       
 14645                         ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 14646                         ADD_PARAM_LIST(N_param_value, N_type_symbol, function_param_iterator_c::direction_in)
 15023                         symbol_c * return_type_symbol = IN_type_symbol;
 14647                         symbol_c * return_type_symbol = IN_type_symbol;
 15024                         s4o.print("__rol_");
 14648                         function_type_suffix = IN_type_symbol;
 15025                         IN_type_symbol->accept(*this);
 14649                         break;
 15026                         s4o.print("(");
       
 15027                         IN_param_value->accept(*this);
       
 15028                         s4o.print(", ");
       
 15029                         N_param_value->accept(*this);
       
 15030                         s4o.print(")");
       
 15031                         return NULL;
       
 15032                         
 14650                         
 15033                     }
 14651                     }
 15034                     
 14652                     
       
 14653                     
 15035                     ERROR;
 14654                     ERROR;
 15036                 }
 14655                 }
 15037                 
 14656                 
 15038             }
 14657             }
       
 14658             
 15039             
 14659             
 15040             ERROR;
 14660             ERROR;
 15041         }
 14661         }
 15042         
 14662         
 15043     }/*function_rol*/
 14663     }/*function_rol*/
 15076                     last_type_symbol = last_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 ;
 14696                     last_type_symbol = last_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 ;
 15077                     
 14697                     
 15078                     if(search_expression_type->is_binary_type(IN2_type_symbol))
 14698                     if(search_expression_type->is_binary_type(IN2_type_symbol))
 15079                     {
 14699                     {
 15080                 
 14700                 
 15081                         symbol_c * return_type_symbol = last_type_symbol;
 14701                         function_name = (symbol_c*)(new pragma_c("__and_"));
 15082                         s4o.indent_right();
 14702                         
 15083                         s4o.print("(");
 14703                         char nb_param_str[10];
 15084                         if (search_expression_type->is_bool_type(last_type_symbol))
 14704                         sprintf(nb_param_str, "%d", nb_param);
 15085                           s4o.print("(\n" + s4o.indent_spaces);
 14705                         ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 15086                         IN1_param_value->accept(*this);
 14706                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 15087                         s4o.print("&\n" + s4o.indent_spaces);
 14707                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 15088                         IN2_param_value->accept(*this);
       
 15089                         
 14708                         
 15090                         int base_num = 3;
 14709                         int base_num = 3;
 15091                         symbol_c *param_value = NULL;
 14710                         symbol_c *param_value = NULL;
 15092                         do{
 14711                         do{
 15093                             char my_name[10];
 14712                             char my_name[10];
 15103                             if (param_value != NULL){
 14722                             if (param_value != NULL){
 15104                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 14723                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15105                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 14724                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15106                             
 14725                             
 15107                                 /*Function specific CODE */
 14726                                 /*Function specific CODE */
 15108                                 s4o.print("&\n" + s4o.indent_spaces);
 14727                                 ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 15109                                 param_value->accept(*this);
       
 15110                                 
       
 15111                             }
 14728                             }
 15112                             
 14729                             
 15113                         }while(param_value != NULL);
 14730                         }while(param_value != NULL);
 15114                         s4o.print(")");
 14731                         symbol_c * return_type_symbol = last_type_symbol;
 15115                         if (search_expression_type->is_bool_type(last_type_symbol)) {
 14732                         function_type_suffix = return_type_symbol;
 15116                           s4o.print("&1");
 14733                         break;
 15117                           s4o.print(")");
       
 15118                         }
       
 15119                         s4o.print("");
       
 15120                         s4o.indent_left();
       
 15121                         return NULL;
       
 15122                         
       
 15123                         
 14734                         
 15124                     }
 14735                     }
 15125                     
 14736                     
       
 14737                     
 15126                     ERROR;
 14738                     ERROR;
 15127                 }
 14739                 }
 15128                 
 14740                 
 15129             }
 14741             }
       
 14742             
 15130             
 14743             
 15131             ERROR;
 14744             ERROR;
 15132         }
 14745         }
 15133         
 14746         
 15134     }/*function_and*/
 14747     }/*function_and*/
 15167                     last_type_symbol = last_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 ;
 14780                     last_type_symbol = last_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 ;
 15168                     
 14781                     
 15169                     if(search_expression_type->is_binary_type(IN2_type_symbol))
 14782                     if(search_expression_type->is_binary_type(IN2_type_symbol))
 15170                     {
 14783                     {
 15171                 
 14784                 
 15172                         symbol_c * return_type_symbol = last_type_symbol;
 14785                         function_name = (symbol_c*)(new pragma_c("__or_"));
 15173                         s4o.indent_right();
 14786                         
 15174                         s4o.print("(");
 14787                         char nb_param_str[10];
 15175                         if (search_expression_type->is_bool_type(last_type_symbol))
 14788                         sprintf(nb_param_str, "%d", nb_param);
 15176                           s4o.print("(\n" + s4o.indent_spaces);
 14789                         ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 15177                         IN1_param_value->accept(*this);
 14790                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 15178                         s4o.print("|\n" + s4o.indent_spaces);
 14791                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 15179                         IN2_param_value->accept(*this);
       
 15180                         
 14792                         
 15181                         int base_num = 3;
 14793                         int base_num = 3;
 15182                         symbol_c *param_value = NULL;
 14794                         symbol_c *param_value = NULL;
 15183                         do{
 14795                         do{
 15184                             char my_name[10];
 14796                             char my_name[10];
 15194                             if (param_value != NULL){
 14806                             if (param_value != NULL){
 15195                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 14807                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15196                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 14808                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15197                             
 14809                             
 15198                                 /*Function specific CODE */
 14810                                 /*Function specific CODE */
 15199                                 s4o.print("|\n" + s4o.indent_spaces);
 14811                                 ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 15200                                 param_value->accept(*this);
       
 15201                                 
       
 15202                             }
 14812                             }
 15203                             
 14813                             
 15204                         }while(param_value != NULL);
 14814                         }while(param_value != NULL);
 15205                         s4o.print(")");
 14815                         symbol_c * return_type_symbol = last_type_symbol;
 15206                         if (search_expression_type->is_bool_type(last_type_symbol)) {
 14816                         function_type_suffix = return_type_symbol;
 15207                           s4o.print("&1");
 14817                         break;
 15208                           s4o.print(")");
       
 15209                         }
       
 15210                         s4o.print("");
       
 15211                         s4o.indent_left();
       
 15212                         return NULL;
       
 15213                         
       
 15214                         
 14818                         
 15215                     }
 14819                     }
 15216                     
 14820                     
       
 14821                     
 15217                     ERROR;
 14822                     ERROR;
 15218                 }
 14823                 }
 15219                 
 14824                 
 15220             }
 14825             }
       
 14826             
 15221             
 14827             
 15222             ERROR;
 14828             ERROR;
 15223         }
 14829         }
 15224         
 14830         
 15225     }/*function_or*/
 14831     }/*function_or*/
 15258                     last_type_symbol = last_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 ;
 14864                     last_type_symbol = last_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 ;
 15259                     
 14865                     
 15260                     if(search_expression_type->is_binary_type(IN2_type_symbol))
 14866                     if(search_expression_type->is_binary_type(IN2_type_symbol))
 15261                     {
 14867                     {
 15262                 
 14868                 
 15263                         symbol_c * return_type_symbol = last_type_symbol;
 14869                         function_name = (symbol_c*)(new pragma_c("__xor_"));
 15264                         s4o.indent_right();
 14870                         
 15265                         s4o.print("(");
 14871                         char nb_param_str[10];
 15266                         if (search_expression_type->is_bool_type(last_type_symbol))
 14872                         sprintf(nb_param_str, "%d", nb_param);
 15267                           s4o.print("(\n" + s4o.indent_spaces);
 14873                         ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 15268                         IN1_param_value->accept(*this);
 14874                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 15269                         s4o.print("^\n" + s4o.indent_spaces);
 14875                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 15270                         IN2_param_value->accept(*this);
       
 15271                         
 14876                         
 15272                         int base_num = 3;
 14877                         int base_num = 3;
 15273                         symbol_c *param_value = NULL;
 14878                         symbol_c *param_value = NULL;
 15274                         do{
 14879                         do{
 15275                             char my_name[10];
 14880                             char my_name[10];
 15285                             if (param_value != NULL){
 14890                             if (param_value != NULL){
 15286                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 14891                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15287                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 14892                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15288                             
 14893                             
 15289                                 /*Function specific CODE */
 14894                                 /*Function specific CODE */
 15290                                 s4o.print("^\n" + s4o.indent_spaces);
 14895                                 ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 15291                                 param_value->accept(*this);
       
 15292                                 
       
 15293                             }
 14896                             }
 15294                             
 14897                             
 15295                         }while(param_value != NULL);
 14898                         }while(param_value != NULL);
 15296                         s4o.print(")");
 14899                         symbol_c * return_type_symbol = last_type_symbol;
 15297                         if (search_expression_type->is_bool_type(last_type_symbol)) {
 14900                         function_type_suffix = return_type_symbol;
 15298                           s4o.print("&1");
 14901                         break;
 15299                           s4o.print(")");
       
 15300                         }
       
 15301                         s4o.print("");
       
 15302                         s4o.indent_left();
       
 15303                         return NULL;
       
 15304                         
       
 15305                         
 14902                         
 15306                     }
 14903                     }
 15307                     
 14904                     
       
 14905                     
 15308                     ERROR;
 14906                     ERROR;
 15309                 }
 14907                 }
 15310                 
 14908                 
 15311             }
 14909             }
 15312             
 14910             
       
 14911             
 15313             ERROR;
 14912             ERROR;
 15314         }
 14913         }
 15315         
 14914         
 15316     }/*function_xor*/
 14915     }/*function_xor*/
 15317     break;
 14916     break;
 15335             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 14934             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 15336             
 14935             
 15337             if(search_expression_type->is_binary_type(IN_type_symbol))
 14936             if(search_expression_type->is_binary_type(IN_type_symbol))
 15338             {
 14937             {
 15339         
 14938         
       
 14939                 function_name = (symbol_c*)(new pragma_c("__not_"));
       
 14940                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
 15340                 symbol_c * return_type_symbol = IN_type_symbol;
 14941                 symbol_c * return_type_symbol = IN_type_symbol;
 15341                 s4o.print("~");
 14942                 function_type_suffix = return_type_symbol;
 15342                 IN_param_value->accept(*this);
 14943                 break;
 15343                 return NULL;
 14944                 
 15344                 
 14945             }
 15345             }
 14946             
 15346             
 14947             
 15347             ERROR;
 14948             ERROR;
 15348         }
 14949         }
 15349         
 14950         
 15350     }/*function_not*/
 14951     }/*function_not*/
 15397                             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
 14998                             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
 15398                             
 14999                             
 15399                             
 15000                             
 15400                             {
 15001                             {
 15401                         
 15002                         
       
 15003                                 function_name = (symbol_c*)(new pragma_c("__sel_"));
       
 15004                                 ADD_PARAM_LIST(G_param_value, G_type_symbol, function_param_iterator_c::direction_in)
       
 15005                                 ADD_PARAM_LIST(IN0_param_value, IN0_type_symbol, function_param_iterator_c::direction_in)
       
 15006                                 ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 15402                                 symbol_c * return_type_symbol = last_type_symbol;
 15007                                 symbol_c * return_type_symbol = last_type_symbol;
 15403                                 G_param_value->accept(*this);
 15008                                 function_type_suffix = IN0_type_symbol;
 15404                                 s4o.print(" ? ");
 15009                                 break;
 15405                                 IN1_param_value->accept(*this);
       
 15406                                 s4o.print(" :  ");
       
 15407                                 IN0_param_value->accept(*this);
       
 15408                                 return NULL;
       
 15409                                 
 15010                                 
 15410                             }
 15011                             }
       
 15012                             
 15411                             
 15013                             
 15412                             ERROR;
 15014                             ERROR;
 15413                         }
 15015                         }
 15414                         
 15016                         
 15415                     }
 15017                     }
 15416                     
 15018                     
       
 15019                     
 15417                     ERROR;
 15020                     ERROR;
 15418                 }
 15021                 }
 15419                 
 15022                 
 15420             }
 15023             }
       
 15024             
 15421             
 15025             
 15422             ERROR;
 15026             ERROR;
 15423         }
 15027         }
 15424         
 15028         
 15425     }/*function_sel*/
 15029     }/*function_sel*/
 15458                     last_type_symbol = last_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 ;
 15062                     last_type_symbol = last_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 ;
 15459                     
 15063                     
 15460                     
 15064                     
 15461                     {
 15065                     {
 15462                 
 15066                 
 15463                         symbol_c * return_type_symbol = last_type_symbol;
 15067                         function_name = (symbol_c*)(new pragma_c("__max_"));
 15464                         s4o.indent_right();
 15068                         
 15465                         s4o.print("__max_");
 15069                         char nb_param_str[10];
 15466                         return_type_symbol->accept(*this);
 15070                         sprintf(nb_param_str, "%d", nb_param);
 15467                         s4o.print("(");
 15071                         ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 15468                         s4o.print_integer(nb_param);
 15072                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 15469                         s4o.print(",\n" + s4o.indent_spaces);
 15073                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 15470                         IN1_param_value->accept(*this);
       
 15471                         s4o.print(",\n" + s4o.indent_spaces);
       
 15472                         IN2_param_value->accept(*this);
       
 15473                         
 15074                         
 15474                         int base_num = 3;
 15075                         int base_num = 3;
 15475                         symbol_c *param_value = NULL;
 15076                         symbol_c *param_value = NULL;
 15476                         do{
 15077                         do{
 15477                             char my_name[10];
 15078                             char my_name[10];
 15487                             if (param_value != NULL){
 15088                             if (param_value != NULL){
 15488                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15089                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15489                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15090                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15490                             
 15091                             
 15491                                 /*Function specific CODE */
 15092                                 /*Function specific CODE */
 15492                                 s4o.print(",\n" + s4o.indent_spaces);
 15093                                 ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 15493                                 param_value->accept(*this);
       
 15494                                 
       
 15495                             }
 15094                             }
 15496                             
 15095                             
 15497                         }while(param_value != NULL);
 15096                         }while(param_value != NULL);
 15498                         s4o.print(")");
 15097                         symbol_c * return_type_symbol = last_type_symbol;
 15499                         s4o.indent_left();
 15098                         function_type_suffix = return_type_symbol;
 15500                         return NULL;
 15099                         break;
 15501                         
       
 15502                         
 15100                         
 15503                     }
 15101                     }
 15504                     
 15102                     
       
 15103                     
 15505                     ERROR;
 15104                     ERROR;
 15506                 }
 15105                 }
 15507                 
 15106                 
 15508             }
 15107             }
       
 15108             
 15509             
 15109             
 15510             ERROR;
 15110             ERROR;
 15511         }
 15111         }
 15512         
 15112         
 15513     }/*function_max*/
 15113     }/*function_max*/
 15546                     last_type_symbol = last_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 ;
 15146                     last_type_symbol = last_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 ;
 15547                     
 15147                     
 15548                     
 15148                     
 15549                     {
 15149                     {
 15550                 
 15150                 
 15551                         symbol_c * return_type_symbol = last_type_symbol;
 15151                         function_name = (symbol_c*)(new pragma_c("__min_"));
 15552                         s4o.indent_right();
 15152                         
 15553                         s4o.print("__min_");
 15153                         char nb_param_str[10];
 15554                         return_type_symbol->accept(*this);
 15154                         sprintf(nb_param_str, "%d", nb_param);
 15555                         s4o.print("(");
 15155                         ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 15556                         s4o.print_integer(nb_param);
 15156                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 15557                         s4o.print(",\n" + s4o.indent_spaces);
 15157                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 15558                         IN1_param_value->accept(*this);
       
 15559                         s4o.print(",\n" + s4o.indent_spaces);
       
 15560                         IN2_param_value->accept(*this);
       
 15561                         
 15158                         
 15562                         int base_num = 3;
 15159                         int base_num = 3;
 15563                         symbol_c *param_value = NULL;
 15160                         symbol_c *param_value = NULL;
 15564                         do{
 15161                         do{
 15565                             char my_name[10];
 15162                             char my_name[10];
 15575                             if (param_value != NULL){
 15172                             if (param_value != NULL){
 15576                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15173                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15577                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15174                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15578                             
 15175                             
 15579                                 /*Function specific CODE */
 15176                                 /*Function specific CODE */
 15580                                 s4o.print(",\n" + s4o.indent_spaces);
 15177                                 ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 15581                                 param_value->accept(*this);
       
 15582                                 
       
 15583                             }
 15178                             }
 15584                             
 15179                             
 15585                         }while(param_value != NULL);
 15180                         }while(param_value != NULL);
 15586                         s4o.print(")");
 15181                         symbol_c * return_type_symbol = last_type_symbol;
 15587                         s4o.indent_left();
 15182                         function_type_suffix = return_type_symbol;
 15588                         return NULL;
 15183                         break;
 15589                         
       
 15590                         
 15184                         
 15591                     }
 15185                     }
 15592                     
 15186                     
       
 15187                     
 15593                     ERROR;
 15188                     ERROR;
 15594                 }
 15189                 }
 15595                 
 15190                 
 15596             }
 15191             }
       
 15192             
 15597             
 15193             
 15598             ERROR;
 15194             ERROR;
 15599         }
 15195         }
 15600         
 15196         
 15601     }/*function_min*/
 15197     }/*function_min*/
 15648                             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(MX_type_symbol, last_type_symbol) ? search_expression_type->common_type(MX_type_symbol, last_type_symbol) : MX_type_symbol ;
 15244                             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(MX_type_symbol, last_type_symbol) ? search_expression_type->common_type(MX_type_symbol, last_type_symbol) : MX_type_symbol ;
 15649                             
 15245                             
 15650                             
 15246                             
 15651                             {
 15247                             {
 15652                         
 15248                         
       
 15249                                 function_name = (symbol_c*)(new pragma_c("__limit_"));
       
 15250                                 ADD_PARAM_LIST(MN_param_value, MN_type_symbol, function_param_iterator_c::direction_in)
       
 15251                                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 15252                                 ADD_PARAM_LIST(MX_param_value, MX_type_symbol, function_param_iterator_c::direction_in)
 15653                                 symbol_c * return_type_symbol = IN_type_symbol;
 15253                                 symbol_c * return_type_symbol = IN_type_symbol;
 15654                                 s4o.print("__limit_");
 15254                                 function_type_suffix = IN_type_symbol;
 15655                                 IN_type_symbol->accept(*this);
 15255                                 break;
 15656                                 s4o.print("(");
       
 15657                                 MN_param_value->accept(*this);
       
 15658                                 s4o.print(", ");
       
 15659                                 IN_param_value->accept(*this);
       
 15660                                 s4o.print(", ");
       
 15661                                 MX_param_value->accept(*this);
       
 15662                                 s4o.print(")");
       
 15663                                 return NULL;
       
 15664                                 
 15256                                 
 15665                             }
 15257                             }
       
 15258                             
 15666                             
 15259                             
 15667                             ERROR;
 15260                             ERROR;
 15668                         }
 15261                         }
 15669                         
 15262                         
 15670                     }
 15263                     }
 15671                     
 15264                     
       
 15265                     
 15672                     ERROR;
 15266                     ERROR;
 15673                 }
 15267                 }
 15674                 
 15268                 
 15675             }
 15269             }
       
 15270             
 15676             
 15271             
 15677             ERROR;
 15272             ERROR;
 15678         }
 15273         }
 15679         
 15274         
 15680     }/*function_limit*/
 15275     }/*function_limit*/
 15727                             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
 15322                             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
 15728                             
 15323                             
 15729                             
 15324                             
 15730                             {
 15325                             {
 15731                         
 15326                         
 15732                                 symbol_c * return_type_symbol = last_type_symbol;
 15327                                 function_name = (symbol_c*)(new pragma_c("__mux_"));
 15733                                 s4o.indent_right();
 15328                                 
 15734                                 s4o.print("__mux_");
 15329                                 char nb_param_str[10];
 15735                                 return_type_symbol->accept(*this);
 15330                                 sprintf(nb_param_str, "%d", nb_param);
 15736                                 s4o.print("(");
 15331                                 ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 15737                                 s4o.print_integer(nb_param);
 15332                                 ADD_PARAM_LIST(K_param_value, K_type_symbol, function_param_iterator_c::direction_in)
 15738                                 s4o.print(",\n" + s4o.indent_spaces);
 15333                                 ADD_PARAM_LIST(IN0_param_value, IN0_type_symbol, function_param_iterator_c::direction_in)
 15739                                 K_param_value->accept(*this);
 15334                                 ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 15740                                 s4o.print(",\n" + s4o.indent_spaces);
       
 15741                                 IN0_param_value->accept(*this);
       
 15742                                 s4o.print(",\n" + s4o.indent_spaces);
       
 15743                                 IN1_param_value->accept(*this);
       
 15744                                 
 15335                                 
 15745                                 int base_num = 2;
 15336                                 int base_num = 2;
 15746                                 symbol_c *param_value = NULL;
 15337                                 symbol_c *param_value = NULL;
 15747                                 do{
 15338                                 do{
 15748                                     char my_name[10];
 15339                                     char my_name[10];
 15758                                     if (param_value != NULL){
 15349                                     if (param_value != NULL){
 15759                                         symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15350                                         symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15760                                         last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15351                                         last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15761                                     
 15352                                     
 15762                                         /*Function specific CODE */
 15353                                         /*Function specific CODE */
 15763                                         s4o.print(",\n" + s4o.indent_spaces);
 15354                                         ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 15764                                         param_value->accept(*this);
       
 15765                                         
       
 15766                                     }
 15355                                     }
 15767                                     
 15356                                     
 15768                                 }while(param_value != NULL);
 15357                                 }while(param_value != NULL);
 15769                                 s4o.print(")");
 15358                                 symbol_c * return_type_symbol = last_type_symbol;
 15770                                 s4o.indent_left();
 15359                                 function_type_suffix = return_type_symbol;
 15771                                 return NULL;
 15360                                 break;
 15772                                 
       
 15773                                 
 15361                                 
 15774                             }
 15362                             }
       
 15363                             
 15775                             
 15364                             
 15776                             ERROR;
 15365                             ERROR;
 15777                         }
 15366                         }
 15778                         
 15367                         
 15779                     }
 15368                     }
 15780                     
 15369                     
       
 15370                     
 15781                     ERROR;
 15371                     ERROR;
 15782                 }
 15372                 }
 15783                 
 15373                 
 15784             }
 15374             }
       
 15375             
 15785             
 15376             
 15786             ERROR;
 15377             ERROR;
 15787         }
 15378         }
 15788         
 15379         
 15789     }/*function_mux*/
 15380     }/*function_mux*/
 15822                     last_type_symbol = last_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 ;
 15413                     last_type_symbol = last_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 ;
 15823                     
 15414                     
 15824                     
 15415                     
 15825                     {
 15416                     {
 15826                 
 15417                 
 15827                         symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
 15418                         function_name = (symbol_c*)(new pragma_c("__gt_"));
 15828                         s4o.indent_right();
 15419                         
 15829                         s4o.print("__gt_");
 15420                         char nb_param_str[10];
 15830                         last_type_symbol->accept(*this);
 15421                         sprintf(nb_param_str, "%d", nb_param);
 15831                         s4o.print("(");
 15422                         ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 15832                         s4o.print_integer(nb_param);
 15423                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 15833                         s4o.print(",\n" + s4o.indent_spaces);
 15424                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 15834                         IN1_param_value->accept(*this);
       
 15835                         s4o.print(",\n" + s4o.indent_spaces);
       
 15836                         IN2_param_value->accept(*this);
       
 15837                         
 15425                         
 15838                         int base_num = 3;
 15426                         int base_num = 3;
 15839                         symbol_c *param_value = NULL;
 15427                         symbol_c *param_value = NULL;
 15840                         do{
 15428                         do{
 15841                             char my_name[10];
 15429                             char my_name[10];
 15851                             if (param_value != NULL){
 15439                             if (param_value != NULL){
 15852                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15440                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15853                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15441                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15854                             
 15442                             
 15855                                 /*Function specific CODE */
 15443                                 /*Function specific CODE */
 15856                                 s4o.print(",\n" + s4o.indent_spaces);
 15444                                 ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 15857                                 param_value->accept(*this);
       
 15858                                 
       
 15859                             }
 15445                             }
 15860                             
 15446                             
 15861                         }while(param_value != NULL);
 15447                         }while(param_value != NULL);
 15862                         s4o.print(")");
 15448                         symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
 15863                         s4o.indent_left();
 15449                         function_type_suffix = last_type_symbol;
 15864                         return NULL;
 15450                         break;
 15865                         
       
 15866                         
 15451                         
 15867                     }
 15452                     }
 15868                     
 15453                     
       
 15454                     
 15869                     ERROR;
 15455                     ERROR;
 15870                 }
 15456                 }
 15871                 
 15457                 
 15872             }
 15458             }
       
 15459             
 15873             
 15460             
 15874             ERROR;
 15461             ERROR;
 15875         }
 15462         }
 15876         
 15463         
 15877     }/*function_gt*/
 15464     }/*function_gt*/
 15910                     last_type_symbol = last_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 ;
 15497                     last_type_symbol = last_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 ;
 15911                     
 15498                     
 15912                     
 15499                     
 15913                     {
 15500                     {
 15914                 
 15501                 
 15915                         symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
 15502                         function_name = (symbol_c*)(new pragma_c("__ge_"));
 15916                         s4o.indent_right();
 15503                         
 15917                         s4o.print("__ge_");
 15504                         char nb_param_str[10];
 15918                         last_type_symbol->accept(*this);
 15505                         sprintf(nb_param_str, "%d", nb_param);
 15919                         s4o.print("(");
 15506                         ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 15920                         s4o.print_integer(nb_param);
 15507                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 15921                         s4o.print(",\n" + s4o.indent_spaces);
 15508                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 15922                         IN1_param_value->accept(*this);
       
 15923                         s4o.print(",\n" + s4o.indent_spaces);
       
 15924                         IN2_param_value->accept(*this);
       
 15925                         
 15509                         
 15926                         int base_num = 3;
 15510                         int base_num = 3;
 15927                         symbol_c *param_value = NULL;
 15511                         symbol_c *param_value = NULL;
 15928                         do{
 15512                         do{
 15929                             char my_name[10];
 15513                             char my_name[10];
 15939                             if (param_value != NULL){
 15523                             if (param_value != NULL){
 15940                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15524                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15941                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15525                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15942                             
 15526                             
 15943                                 /*Function specific CODE */
 15527                                 /*Function specific CODE */
 15944                                 s4o.print(",\n" + s4o.indent_spaces);
 15528                                 ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 15945                                 param_value->accept(*this);
       
 15946                                 
       
 15947                             }
 15529                             }
 15948                             
 15530                             
 15949                         }while(param_value != NULL);
 15531                         }while(param_value != NULL);
 15950                         s4o.print(")");
 15532                         symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
 15951                         s4o.indent_left();
 15533                         function_type_suffix = last_type_symbol;
 15952                         return NULL;
 15534                         break;
 15953                         
       
 15954                         
 15535                         
 15955                     }
 15536                     }
 15956                     
 15537                     
       
 15538                     
 15957                     ERROR;
 15539                     ERROR;
 15958                 }
 15540                 }
 15959                 
 15541                 
 15960             }
 15542             }
       
 15543             
 15961             
 15544             
 15962             ERROR;
 15545             ERROR;
 15963         }
 15546         }
 15964         
 15547         
 15965     }/*function_ge*/
 15548     }/*function_ge*/
 15998                     last_type_symbol = last_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 ;
 15581                     last_type_symbol = last_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 ;
 15999                     
 15582                     
 16000                     
 15583                     
 16001                     {
 15584                     {
 16002                 
 15585                 
 16003                         symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
 15586                         function_name = (symbol_c*)(new pragma_c("__eq_"));
 16004                         s4o.indent_right();
 15587                         
 16005                         s4o.print("__eq_");
 15588                         char nb_param_str[10];
 16006                         last_type_symbol->accept(*this);
 15589                         sprintf(nb_param_str, "%d", nb_param);
 16007                         s4o.print("(");
 15590                         ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 16008                         s4o.print_integer(nb_param);
 15591                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 16009                         s4o.print(",\n" + s4o.indent_spaces);
 15592                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 16010                         IN1_param_value->accept(*this);
       
 16011                         s4o.print(",\n" + s4o.indent_spaces);
       
 16012                         IN2_param_value->accept(*this);
       
 16013                         
 15593                         
 16014                         int base_num = 3;
 15594                         int base_num = 3;
 16015                         symbol_c *param_value = NULL;
 15595                         symbol_c *param_value = NULL;
 16016                         do{
 15596                         do{
 16017                             char my_name[10];
 15597                             char my_name[10];
 16027                             if (param_value != NULL){
 15607                             if (param_value != NULL){
 16028                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15608                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 16029                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15609                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 16030                             
 15610                             
 16031                                 /*Function specific CODE */
 15611                                 /*Function specific CODE */
 16032                                 s4o.print(",\n" + s4o.indent_spaces);
 15612                                 ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 16033                                 param_value->accept(*this);
       
 16034                                 
       
 16035                             }
 15613                             }
 16036                             
 15614                             
 16037                         }while(param_value != NULL);
 15615                         }while(param_value != NULL);
 16038                         s4o.print(")");
 15616                         symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
 16039                         s4o.indent_left();
 15617                         function_type_suffix = last_type_symbol;
 16040                         return NULL;
 15618                         break;
 16041                         
       
 16042                         
 15619                         
 16043                     }
 15620                     }
 16044                     
 15621                     
       
 15622                     
 16045                     ERROR;
 15623                     ERROR;
 16046                 }
 15624                 }
 16047                 
 15625                 
 16048             }
 15626             }
       
 15627             
 16049             
 15628             
 16050             ERROR;
 15629             ERROR;
 16051         }
 15630         }
 16052         
 15631         
 16053     }/*function_eq*/
 15632     }/*function_eq*/
 16086                     last_type_symbol = last_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 ;
 15665                     last_type_symbol = last_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 ;
 16087                     
 15666                     
 16088                     
 15667                     
 16089                     {
 15668                     {
 16090                 
 15669                 
 16091                         symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
 15670                         function_name = (symbol_c*)(new pragma_c("__lt_"));
 16092                         s4o.indent_right();
 15671                         
 16093                         s4o.print("__lt_");
 15672                         char nb_param_str[10];
 16094                         last_type_symbol->accept(*this);
 15673                         sprintf(nb_param_str, "%d", nb_param);
 16095                         s4o.print("(");
 15674                         ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 16096                         s4o.print_integer(nb_param);
 15675                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 16097                         s4o.print(",\n" + s4o.indent_spaces);
 15676                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 16098                         IN1_param_value->accept(*this);
       
 16099                         s4o.print(",\n" + s4o.indent_spaces);
       
 16100                         IN2_param_value->accept(*this);
       
 16101                         
 15677                         
 16102                         int base_num = 3;
 15678                         int base_num = 3;
 16103                         symbol_c *param_value = NULL;
 15679                         symbol_c *param_value = NULL;
 16104                         do{
 15680                         do{
 16105                             char my_name[10];
 15681                             char my_name[10];
 16115                             if (param_value != NULL){
 15691                             if (param_value != NULL){
 16116                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15692                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 16117                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15693                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 16118                             
 15694                             
 16119                                 /*Function specific CODE */
 15695                                 /*Function specific CODE */
 16120                                 s4o.print(",\n" + s4o.indent_spaces);
 15696                                 ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 16121                                 param_value->accept(*this);
       
 16122                                 
       
 16123                             }
 15697                             }
 16124                             
 15698                             
 16125                         }while(param_value != NULL);
 15699                         }while(param_value != NULL);
 16126                         s4o.print(")");
 15700                         symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
 16127                         s4o.indent_left();
 15701                         function_type_suffix = last_type_symbol;
 16128                         return NULL;
 15702                         break;
 16129                         
       
 16130                         
 15703                         
 16131                     }
 15704                     }
 16132                     
 15705                     
       
 15706                     
 16133                     ERROR;
 15707                     ERROR;
 16134                 }
 15708                 }
 16135                 
 15709                 
 16136             }
 15710             }
       
 15711             
 16137             
 15712             
 16138             ERROR;
 15713             ERROR;
 16139         }
 15714         }
 16140         
 15715         
 16141     }/*function_lt*/
 15716     }/*function_lt*/
 16174                     last_type_symbol = last_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 ;
 15749                     last_type_symbol = last_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 ;
 16175                     
 15750                     
 16176                     
 15751                     
 16177                     {
 15752                     {
 16178                 
 15753                 
 16179                         symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
 15754                         function_name = (symbol_c*)(new pragma_c("__le_"));
 16180                         s4o.indent_right();
 15755                         
 16181                         s4o.print("__le_");
 15756                         char nb_param_str[10];
 16182                         last_type_symbol->accept(*this);
 15757                         sprintf(nb_param_str, "%d", nb_param);
 16183                         s4o.print("(");
 15758                         ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 16184                         s4o.print_integer(nb_param);
 15759                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 16185                         s4o.print(",\n" + s4o.indent_spaces);
 15760                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 16186                         IN1_param_value->accept(*this);
       
 16187                         s4o.print(",\n" + s4o.indent_spaces);
       
 16188                         IN2_param_value->accept(*this);
       
 16189                         
 15761                         
 16190                         int base_num = 3;
 15762                         int base_num = 3;
 16191                         symbol_c *param_value = NULL;
 15763                         symbol_c *param_value = NULL;
 16192                         do{
 15764                         do{
 16193                             char my_name[10];
 15765                             char my_name[10];
 16203                             if (param_value != NULL){
 15775                             if (param_value != NULL){
 16204                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15776                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 16205                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15777                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 16206                             
 15778                             
 16207                                 /*Function specific CODE */
 15779                                 /*Function specific CODE */
 16208                                 s4o.print(",\n" + s4o.indent_spaces);
 15780                                 ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 16209                                 param_value->accept(*this);
       
 16210                                 
       
 16211                             }
 15781                             }
 16212                             
 15782                             
 16213                         }while(param_value != NULL);
 15783                         }while(param_value != NULL);
 16214                         s4o.print(")");
 15784                         symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
 16215                         s4o.indent_left();
 15785                         function_type_suffix = last_type_symbol;
 16216                         return NULL;
 15786                         break;
 16217                         
       
 16218                         
 15787                         
 16219                     }
 15788                     }
 16220                     
 15789                     
       
 15790                     
 16221                     ERROR;
 15791                     ERROR;
 16222                 }
 15792                 }
 16223                 
 15793                 
 16224             }
 15794             }
       
 15795             
 16225             
 15796             
 16226             ERROR;
 15797             ERROR;
 16227         }
 15798         }
 16228         
 15799         
 16229     }/*function_le*/
 15800     }/*function_le*/
 16262                     last_type_symbol = last_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 ;
 15833                     last_type_symbol = last_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 ;
 16263                     
 15834                     
 16264                     
 15835                     
 16265                     {
 15836                     {
 16266                 
 15837                 
 16267                         symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
 15838                         function_name = (symbol_c*)(new pragma_c("__ne_"));
 16268                         s4o.indent_right();
 15839                         
 16269                         s4o.print("__ne_");
 15840                         char nb_param_str[10];
 16270                         last_type_symbol->accept(*this);
 15841                         sprintf(nb_param_str, "%d", nb_param);
 16271                         s4o.print("(");
 15842                         ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 16272                         s4o.print_integer(nb_param);
 15843                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 16273                         s4o.print(",\n" + s4o.indent_spaces);
 15844                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 16274                         IN1_param_value->accept(*this);
       
 16275                         s4o.print(",\n" + s4o.indent_spaces);
       
 16276                         IN2_param_value->accept(*this);
       
 16277                         
 15845                         
 16278                         int base_num = 3;
 15846                         int base_num = 3;
 16279                         symbol_c *param_value = NULL;
 15847                         symbol_c *param_value = NULL;
 16280                         do{
 15848                         do{
 16281                             char my_name[10];
 15849                             char my_name[10];
 16291                             if (param_value != NULL){
 15859                             if (param_value != NULL){
 16292                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 15860                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 16293                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 15861                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 16294                             
 15862                             
 16295                                 /*Function specific CODE */
 15863                                 /*Function specific CODE */
 16296                                 s4o.print(",\n" + s4o.indent_spaces);
 15864                                 ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 16297                                 param_value->accept(*this);
       
 16298                                 
       
 16299                             }
 15865                             }
 16300                             
 15866                             
 16301                         }while(param_value != NULL);
 15867                         }while(param_value != NULL);
 16302                         s4o.print(")");
 15868                         symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
 16303                         s4o.indent_left();
 15869                         function_type_suffix = last_type_symbol;
 16304                         return NULL;
 15870                         break;
 16305                         
       
 16306                         
 15871                         
 16307                     }
 15872                     }
 16308                     
 15873                     
       
 15874                     
 16309                     ERROR;
 15875                     ERROR;
 16310                 }
 15876                 }
 16311                 
 15877                 
 16312             }
 15878             }
 16313             
 15879             
       
 15880             
 16314             ERROR;
 15881             ERROR;
 16315         }
 15882         }
 16316         
 15883         
 16317     }/*function_ne*/
 15884     }/*function_ne*/
 16318     break;
 15885     break;
 16336             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 15903             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 16337             
 15904             
 16338             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
 15905             if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
 16339             {
 15906             {
 16340         
 15907         
       
 15908                 function_name = (symbol_c*)(new pragma_c("__len"));
       
 15909                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
 16341                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
 15910                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
 16342                 s4o.print("__len(");
 15911                 break;
 16343                 IN_param_value->accept(*this);
 15912                 
 16344                 s4o.print(")");
 15913             }
 16345                 return NULL;
 15914             
 16346                 
       
 16347             }
       
 16348             
 15915             
 16349             ERROR;
 15916             ERROR;
 16350         }
 15917         }
 16351         
 15918         
 16352     }/*function_len*/
 15919     }/*function_len*/
 16385                     last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
 15952                     last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
 16386                     
 15953                     
 16387                     if(search_expression_type->is_integer_type(L_type_symbol))
 15954                     if(search_expression_type->is_integer_type(L_type_symbol))
 16388                     {
 15955                     {
 16389                 
 15956                 
       
 15957                         function_name = (symbol_c*)(new pragma_c("__left"));
       
 15958                         ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 15959                         ADD_PARAM_LIST(L_param_value, L_type_symbol, function_param_iterator_c::direction_in)
 16390                         symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 15960                         symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16391                         s4o.print("__left(");
 15961                         break;
 16392                         IN_param_value->accept(*this);
       
 16393                         s4o.print(", ");
       
 16394                         L_param_value->accept(*this);
       
 16395                         s4o.print(")");
       
 16396                         return NULL;
       
 16397                         
 15962                         
 16398                     }
 15963                     }
 16399                     
 15964                     
       
 15965                     
 16400                     ERROR;
 15966                     ERROR;
 16401                 }
 15967                 }
 16402                 
 15968                 
 16403             }
 15969             }
       
 15970             
 16404             
 15971             
 16405             ERROR;
 15972             ERROR;
 16406         }
 15973         }
 16407         
 15974         
 16408     }/*function_left*/
 15975     }/*function_left*/
 16441                     last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
 16008                     last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
 16442                     
 16009                     
 16443                     if(search_expression_type->is_integer_type(L_type_symbol))
 16010                     if(search_expression_type->is_integer_type(L_type_symbol))
 16444                     {
 16011                     {
 16445                 
 16012                 
       
 16013                         function_name = (symbol_c*)(new pragma_c("__right"));
       
 16014                         ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 16015                         ADD_PARAM_LIST(L_param_value, L_type_symbol, function_param_iterator_c::direction_in)
 16446                         symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16016                         symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16447                         s4o.print("__right(");
 16017                         break;
 16448                         IN_param_value->accept(*this);
       
 16449                         s4o.print(", ");
       
 16450                         L_param_value->accept(*this);
       
 16451                         s4o.print(")");
       
 16452                         return NULL;
       
 16453                         
 16018                         
 16454                     }
 16019                     }
 16455                     
 16020                     
       
 16021                     
 16456                     ERROR;
 16022                     ERROR;
 16457                 }
 16023                 }
 16458                 
 16024                 
 16459             }
 16025             }
       
 16026             
 16460             
 16027             
 16461             ERROR;
 16028             ERROR;
 16462         }
 16029         }
 16463         
 16030         
 16464     }/*function_right*/
 16031     }/*function_right*/
 16511                             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
 16078                             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
 16512                             
 16079                             
 16513                             if(search_expression_type->is_integer_type(P_type_symbol))
 16080                             if(search_expression_type->is_integer_type(P_type_symbol))
 16514                             {
 16081                             {
 16515                         
 16082                         
       
 16083                                 function_name = (symbol_c*)(new pragma_c("__mid"));
       
 16084                                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 16085                                 ADD_PARAM_LIST(L_param_value, L_type_symbol, function_param_iterator_c::direction_in)
       
 16086                                 ADD_PARAM_LIST(P_param_value, P_type_symbol, function_param_iterator_c::direction_in)
 16516                                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16087                                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16517                                 s4o.print("__mid(");
 16088                                 break;
 16518                                 IN_param_value->accept(*this);
       
 16519                                 s4o.print(", ");
       
 16520                                 L_param_value->accept(*this);
       
 16521                                 s4o.print(", ");
       
 16522                                 P_param_value->accept(*this);
       
 16523                                 s4o.print(")");
       
 16524                                 return NULL;
       
 16525                                 
 16089                                 
 16526                             }
 16090                             }
       
 16091                             
 16527                             
 16092                             
 16528                             ERROR;
 16093                             ERROR;
 16529                         }
 16094                         }
 16530                         
 16095                         
 16531                     }
 16096                     }
 16532                     
 16097                     
       
 16098                     
 16533                     ERROR;
 16099                     ERROR;
 16534                 }
 16100                 }
 16535                 
 16101                 
 16536             }
 16102             }
       
 16103             
 16537             
 16104             
 16538             ERROR;
 16105             ERROR;
 16539         }
 16106         }
 16540         
 16107         
 16541     }/*function_mid*/
 16108     }/*function_mid*/
 16574                     last_type_symbol = last_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 ;
 16141                     last_type_symbol = last_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 ;
 16575                     
 16142                     
 16576                     if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
 16143                     if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
 16577                     {
 16144                     {
 16578                 
 16145                 
       
 16146                         function_name = (symbol_c*)(new pragma_c("__time_add"));
       
 16147                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 16148                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 16579                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
 16149                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
 16580                         s4o.print("__time_add(");
 16150                         break;
 16581                         IN1_param_value->accept(*this);
       
 16582                         s4o.print(", ");
       
 16583                         IN2_param_value->accept(*this);
       
 16584                         s4o.print(")");
       
 16585                         return NULL;
       
 16586                         
 16151                         
 16587                     }
 16152                     }
       
 16153                     
 16588                     
 16154                     
 16589                     ERROR;
 16155                     ERROR;
 16590                 }
 16156                 }
 16591                 
 16157                 
 16592             }
 16158             }
 16606                     last_type_symbol = last_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 ;
 16172                     last_type_symbol = last_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 ;
 16607                     
 16173                     
 16608                     if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
 16174                     if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
 16609                     {
 16175                     {
 16610                 
 16176                 
 16611                         symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16177                         function_name = (symbol_c*)(new pragma_c("__concat"));
 16612                         s4o.indent_right();
 16178                         
 16613                         s4o.print("__concat(");
 16179                         char nb_param_str[10];
 16614                         s4o.print_integer(nb_param);
 16180                         sprintf(nb_param_str, "%d", nb_param);
 16615                         s4o.print(",\n" + s4o.indent_spaces);
 16181                         ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 16616                         IN1_param_value->accept(*this);
 16182                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
 16617                         s4o.print(",\n" + s4o.indent_spaces);
 16183                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 16618                         IN2_param_value->accept(*this);
       
 16619                         
 16184                         
 16620                         int base_num = 3;
 16185                         int base_num = 3;
 16621                         symbol_c *param_value = NULL;
 16186                         symbol_c *param_value = NULL;
 16622                         do{
 16187                         do{
 16623                             char my_name[10];
 16188                             char my_name[10];
 16633                             if (param_value != NULL){
 16198                             if (param_value != NULL){
 16634                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 16199                                 symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
 16635                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 16200                                 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
 16636                             
 16201                             
 16637                                 /*Function specific CODE */
 16202                                 /*Function specific CODE */
 16638                                 s4o.print(",\n" + s4o.indent_spaces);
 16203                                 ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
 16639                                 param_value->accept(*this);
       
 16640                                 
       
 16641                             }
 16204                             }
 16642                             
 16205                             
 16643                         }while(param_value != NULL);
 16206                         }while(param_value != NULL);
 16644                         s4o.print(")");
 16207                         symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16645                         s4o.indent_left();
 16208                         break;
 16646                         return NULL;
       
 16647                         
       
 16648                         
 16209                         
 16649                     }
 16210                     }
 16650                     
 16211                     
       
 16212                     
 16651                     ERROR;
 16213                     ERROR;
 16652                 }
 16214                 }
 16653                 
 16215                 
 16654             }
 16216             }
       
 16217             
 16655             
 16218             
 16656             ERROR;
 16219             ERROR;
 16657         }
 16220         }
 16658         
 16221         
 16659     }/*function_concat*/
 16222     }/*function_concat*/
 16706                             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
 16269                             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
 16707                             
 16270                             
 16708                             if(search_expression_type->is_integer_type(P_type_symbol))
 16271                             if(search_expression_type->is_integer_type(P_type_symbol))
 16709                             {
 16272                             {
 16710                         
 16273                         
       
 16274                                 function_name = (symbol_c*)(new pragma_c("__insert"));
       
 16275                                 ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 16276                                 ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 16277                                 ADD_PARAM_LIST(P_param_value, P_type_symbol, function_param_iterator_c::direction_in)
 16711                                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16278                                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16712                                 s4o.print("__insert(");
 16279                                 break;
 16713                                 IN1_param_value->accept(*this);
       
 16714                                 s4o.print(", ");
       
 16715                                 IN2_param_value->accept(*this);
       
 16716                                 s4o.print(", ");
       
 16717                                 P_param_value->accept(*this);
       
 16718                                 s4o.print(")");
       
 16719                                 return NULL;
       
 16720                                 
 16280                                 
 16721                             }
 16281                             }
       
 16282                             
 16722                             
 16283                             
 16723                             ERROR;
 16284                             ERROR;
 16724                         }
 16285                         }
 16725                         
 16286                         
 16726                     }
 16287                     }
 16727                     
 16288                     
       
 16289                     
 16728                     ERROR;
 16290                     ERROR;
 16729                 }
 16291                 }
 16730                 
 16292                 
 16731             }
 16293             }
       
 16294             
 16732             
 16295             
 16733             ERROR;
 16296             ERROR;
 16734         }
 16297         }
 16735         
 16298         
 16736     }/*function_insert*/
 16299     }/*function_insert*/
 16783                             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
 16346                             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
 16784                             
 16347                             
 16785                             if(search_expression_type->is_integer_type(P_type_symbol))
 16348                             if(search_expression_type->is_integer_type(P_type_symbol))
 16786                             {
 16349                             {
 16787                         
 16350                         
       
 16351                                 function_name = (symbol_c*)(new pragma_c("__delete"));
       
 16352                                 ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
       
 16353                                 ADD_PARAM_LIST(L_param_value, L_type_symbol, function_param_iterator_c::direction_in)
       
 16354                                 ADD_PARAM_LIST(P_param_value, P_type_symbol, function_param_iterator_c::direction_in)
 16788                                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16355                                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16789                                 s4o.print("__delete(");
 16356                                 break;
 16790                                 IN_param_value->accept(*this);
       
 16791                                 s4o.print(", ");
       
 16792                                 L_param_value->accept(*this);
       
 16793                                 s4o.print(", ");
       
 16794                                 P_param_value->accept(*this);
       
 16795                                 s4o.print(")");
       
 16796                                 return NULL;
       
 16797                                 
 16357                                 
 16798                             }
 16358                             }
       
 16359                             
 16799                             
 16360                             
 16800                             ERROR;
 16361                             ERROR;
 16801                         }
 16362                         }
 16802                         
 16363                         
 16803                     }
 16364                     }
 16804                     
 16365                     
       
 16366                     
 16805                     ERROR;
 16367                     ERROR;
 16806                 }
 16368                 }
 16807                 
 16369                 
 16808             }
 16370             }
       
 16371             
 16809             
 16372             
 16810             ERROR;
 16373             ERROR;
 16811         }
 16374         }
 16812         
 16375         
 16813     }/*function_delete*/
 16376     }/*function_delete*/
 16874                                     last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
 16437                                     last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
 16875                                     
 16438                                     
 16876                                     if(search_expression_type->is_integer_type(P_type_symbol))
 16439                                     if(search_expression_type->is_integer_type(P_type_symbol))
 16877                                     {
 16440                                     {
 16878                                 
 16441                                 
       
 16442                                         function_name = (symbol_c*)(new pragma_c("__replace"));
       
 16443                                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 16444                                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
       
 16445                                         ADD_PARAM_LIST(L_param_value, L_type_symbol, function_param_iterator_c::direction_in)
       
 16446                                         ADD_PARAM_LIST(P_param_value, P_type_symbol, function_param_iterator_c::direction_in)
 16879                                         symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16447                                         symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16880                                         s4o.print("__replace(");
 16448                                         break;
 16881                                         IN1_param_value->accept(*this);
       
 16882                                         s4o.print(", ");
       
 16883                                         IN2_param_value->accept(*this);
       
 16884                                         s4o.print(", ");
       
 16885                                         L_param_value->accept(*this);
       
 16886                                         s4o.print(", ");
       
 16887                                         P_param_value->accept(*this);
       
 16888                                         s4o.print(")");
       
 16889                                         return NULL;
       
 16890                                         
 16449                                         
 16891                                     }
 16450                                     }
       
 16451                                     
 16892                                     
 16452                                     
 16893                                     ERROR;
 16453                                     ERROR;
 16894                                 }
 16454                                 }
 16895                                 
 16455                                 
 16896                             }
 16456                             }
 16897                             
 16457                             
       
 16458                             
 16898                             ERROR;
 16459                             ERROR;
 16899                         }
 16460                         }
 16900                         
 16461                         
 16901                     }
 16462                     }
 16902                     
 16463                     
       
 16464                     
 16903                     ERROR;
 16465                     ERROR;
 16904                 }
 16466                 }
 16905                 
 16467                 
 16906             }
 16468             }
       
 16469             
 16907             
 16470             
 16908             ERROR;
 16471             ERROR;
 16909         }
 16472         }
 16910         
 16473         
 16911     }/*function_replace*/
 16474     }/*function_replace*/
 16944                     last_type_symbol = last_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 ;
 16507                     last_type_symbol = last_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                     
 16508                     
 16946                     if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
 16509                     if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
 16947                     {
 16510                     {
 16948                 
 16511                 
       
 16512                         function_name = (symbol_c*)(new pragma_c("__find"));
       
 16513                         ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
       
 16514                         ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
 16949                         symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
 16515                         symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
 16950                         s4o.print("__find(");
 16516                         break;
 16951                         IN1_param_value->accept(*this);
       
 16952                         s4o.print(", ");
       
 16953                         IN2_param_value->accept(*this);
       
 16954                         s4o.print(")");
       
 16955                         return NULL;
       
 16956                         
 16517                         
 16957                     }
 16518                     }
 16958                     
 16519                     
       
 16520                     
 16959                     ERROR;
 16521                     ERROR;
 16960                 }
 16522                 }
 16961                 
 16523                 
 16962             }
 16524             }
       
 16525             
 16963             
 16526             
 16964             ERROR;
 16527             ERROR;
 16965         }
 16528         }
 16966         
 16529         
 16967     }/*function_find*/
 16530     }/*function_find*/
 16968     break;
 16531     break;
 16969 
 16532 
 16970     case function_none :
 16533     case function_none :
 16971     ERROR;
 16534     ERROR;
 16972 }
 16535 }
 16973 return NULL;