stage4/generate_cc/st_code_gen.c
changeset 38 6cce7d14647e
parent 35 9f3d6c089533
child 40 873a5b60a7ea
equal deleted inserted replaced
37:4d54ce47ee12 38:6cce7d14647e
   351             {
   351             {
   352         
   352         
   353                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
   353                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
   354                 s4o.print("(");
   354                 s4o.print("(");
   355                 return_type_symbol->accept(*this);
   355                 return_type_symbol->accept(*this);
   356                 s4o.print(")real_to_time(");
   356                 s4o.print(")__real_to_time(");
   357                 IN_param_value->accept(*this);
   357                 IN_param_value->accept(*this);
   358                 s4o.print(")");
   358                 s4o.print(")");
   359                 return NULL;
   359                 return NULL;
   360                 
   360                 
   361             }
   361             }
   568             {
   568             {
   569         
   569         
   570                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
   570                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
   571                 s4o.print("(");
   571                 s4o.print("(");
   572                 return_type_symbol->accept(*this);
   572                 return_type_symbol->accept(*this);
   573                 s4o.print(")int_to_string(");
   573                 s4o.print(")__real_to_string(");
   574                 IN_param_value->accept(*this);
   574                 IN_param_value->accept(*this);
   575                 s4o.print(", 10)");
   575                 s4o.print(")");
   576                 return NULL;
   576                 return NULL;
   577                 
   577                 
   578             }
   578             }
   579             
   579             
   580             ERROR;
   580             ERROR;
   582         
   582         
   583     }/*function_real_to_string*/
   583     }/*function_real_to_string*/
   584     break;
   584     break;
   585 
   585 
   586 /****
   586 /****
   587  *REAL_TO_WSTRING
   587  *REAL_TO_DATE
   588  */
   588  */
   589     case function_real_to_wstring :
   589     case function_real_to_date :
   590     {
   590     {
   591         symbol_c *last_type_symbol = NULL;
   591         symbol_c *last_type_symbol = NULL;
   592 
   592 
   593         {
   593         {
   594             identifier_c param_name("IN");
   594             identifier_c param_name("IN");
   602             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   602             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   603             
   603             
   604             if (typeid(*last_type_symbol) == typeid(real_type_name_c))
   604             if (typeid(*last_type_symbol) == typeid(real_type_name_c))
   605             {
   605             {
   606         
   606         
   607                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
   607                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
   608                 s4o.print("(");
   608                 s4o.print("(");
   609                 return_type_symbol->accept(*this);
   609                 return_type_symbol->accept(*this);
   610                 s4o.print(")int_to_string(");
   610                 s4o.print(")__real_to_time(");
   611                 IN_param_value->accept(*this);
   611                 IN_param_value->accept(*this);
   612                 s4o.print(", 10)");
   612                 s4o.print(")");
   613                 return NULL;
   613                 return NULL;
   614                 
   614                 
   615             }
   615             }
   616             
   616             
   617             ERROR;
   617             ERROR;
   618         }
   618         }
   619         
   619         
   620     }/*function_real_to_wstring*/
   620     }/*function_real_to_date*/
   621     break;
   621     break;
   622 
   622 
   623 /****
   623 /****
   624  *REAL_TO_DATE
   624  *REAL_TO_TOD
   625  */
   625  */
   626     case function_real_to_date :
   626     case function_real_to_tod :
   627     {
   627     {
   628         symbol_c *last_type_symbol = NULL;
   628         symbol_c *last_type_symbol = NULL;
   629 
   629 
   630         {
   630         {
   631             identifier_c param_name("IN");
   631             identifier_c param_name("IN");
   639             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   639             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   640             
   640             
   641             if (typeid(*last_type_symbol) == typeid(real_type_name_c))
   641             if (typeid(*last_type_symbol) == typeid(real_type_name_c))
   642             {
   642             {
   643         
   643         
       
   644                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
   645                 s4o.print("(");
       
   646                 return_type_symbol->accept(*this);
       
   647                 s4o.print(")__real_to_time(");
       
   648                 IN_param_value->accept(*this);
       
   649                 s4o.print(")");
       
   650                 return NULL;
       
   651                 
       
   652             }
       
   653             
       
   654             ERROR;
       
   655         }
       
   656         
       
   657     }/*function_real_to_tod*/
       
   658     break;
       
   659 
       
   660 /****
       
   661  *REAL_TO_DT
       
   662  */
       
   663     case function_real_to_dt :
       
   664     {
       
   665         symbol_c *last_type_symbol = NULL;
       
   666 
       
   667         {
       
   668             identifier_c param_name("IN");
       
   669             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   670             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   671             
       
   672             /* Get the value from a foo(<param_value>) style call */
       
   673             if (IN_param_value == NULL)
       
   674               IN_param_value = function_call_param_iterator.next();
       
   675             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   676             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   677             
       
   678             if (typeid(*last_type_symbol) == typeid(real_type_name_c))
       
   679             {
       
   680         
       
   681                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
   682                 s4o.print("(");
       
   683                 return_type_symbol->accept(*this);
       
   684                 s4o.print(")__real_to_time(");
       
   685                 IN_param_value->accept(*this);
       
   686                 s4o.print(")");
       
   687                 return NULL;
       
   688                 
       
   689             }
       
   690             
       
   691             ERROR;
       
   692         }
       
   693         
       
   694     }/*function_real_to_dt*/
       
   695     break;
       
   696 
       
   697 /****
       
   698  *LREAL_TO_REAL
       
   699  */
       
   700     case function_lreal_to_real :
       
   701     {
       
   702         symbol_c *last_type_symbol = NULL;
       
   703 
       
   704         {
       
   705             identifier_c param_name("IN");
       
   706             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   707             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   708             
       
   709             /* Get the value from a foo(<param_value>) style call */
       
   710             if (IN_param_value == NULL)
       
   711               IN_param_value = function_call_param_iterator.next();
       
   712             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   713             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   714             
       
   715             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
   716             {
       
   717         
       
   718                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
   719                 s4o.print("(");
       
   720                 return_type_symbol->accept(*this);
       
   721                 s4o.print(")");
       
   722                 IN_param_value->accept(*this);
       
   723                 return NULL;
       
   724                 
       
   725             }
       
   726             
       
   727             ERROR;
       
   728         }
       
   729         
       
   730     }/*function_lreal_to_real*/
       
   731     break;
       
   732 
       
   733 /****
       
   734  *LREAL_TO_SINT
       
   735  */
       
   736     case function_lreal_to_sint :
       
   737     {
       
   738         symbol_c *last_type_symbol = NULL;
       
   739 
       
   740         {
       
   741             identifier_c param_name("IN");
       
   742             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   743             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   744             
       
   745             /* Get the value from a foo(<param_value>) style call */
       
   746             if (IN_param_value == NULL)
       
   747               IN_param_value = function_call_param_iterator.next();
       
   748             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   749             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   750             
       
   751             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
   752             {
       
   753         
       
   754                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
   755                 s4o.print("(");
       
   756                 return_type_symbol->accept(*this);
       
   757                 s4o.print(")");
       
   758                 IN_param_value->accept(*this);
       
   759                 return NULL;
       
   760                 
       
   761             }
       
   762             
       
   763             ERROR;
       
   764         }
       
   765         
       
   766     }/*function_lreal_to_sint*/
       
   767     break;
       
   768 
       
   769 /****
       
   770  *LREAL_TO_INT
       
   771  */
       
   772     case function_lreal_to_int :
       
   773     {
       
   774         symbol_c *last_type_symbol = NULL;
       
   775 
       
   776         {
       
   777             identifier_c param_name("IN");
       
   778             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   779             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   780             
       
   781             /* Get the value from a foo(<param_value>) style call */
       
   782             if (IN_param_value == NULL)
       
   783               IN_param_value = function_call_param_iterator.next();
       
   784             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   785             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   786             
       
   787             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
   788             {
       
   789         
       
   790                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
   791                 s4o.print("(");
       
   792                 return_type_symbol->accept(*this);
       
   793                 s4o.print(")");
       
   794                 IN_param_value->accept(*this);
       
   795                 return NULL;
       
   796                 
       
   797             }
       
   798             
       
   799             ERROR;
       
   800         }
       
   801         
       
   802     }/*function_lreal_to_int*/
       
   803     break;
       
   804 
       
   805 /****
       
   806  *LREAL_TO_DINT
       
   807  */
       
   808     case function_lreal_to_dint :
       
   809     {
       
   810         symbol_c *last_type_symbol = NULL;
       
   811 
       
   812         {
       
   813             identifier_c param_name("IN");
       
   814             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   815             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   816             
       
   817             /* Get the value from a foo(<param_value>) style call */
       
   818             if (IN_param_value == NULL)
       
   819               IN_param_value = function_call_param_iterator.next();
       
   820             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   821             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   822             
       
   823             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
   824             {
       
   825         
       
   826                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
   827                 s4o.print("(");
       
   828                 return_type_symbol->accept(*this);
       
   829                 s4o.print(")");
       
   830                 IN_param_value->accept(*this);
       
   831                 return NULL;
       
   832                 
       
   833             }
       
   834             
       
   835             ERROR;
       
   836         }
       
   837         
       
   838     }/*function_lreal_to_dint*/
       
   839     break;
       
   840 
       
   841 /****
       
   842  *LREAL_TO_LINT
       
   843  */
       
   844     case function_lreal_to_lint :
       
   845     {
       
   846         symbol_c *last_type_symbol = NULL;
       
   847 
       
   848         {
       
   849             identifier_c param_name("IN");
       
   850             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   851             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   852             
       
   853             /* Get the value from a foo(<param_value>) style call */
       
   854             if (IN_param_value == NULL)
       
   855               IN_param_value = function_call_param_iterator.next();
       
   856             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   857             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   858             
       
   859             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
   860             {
       
   861         
       
   862                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
   863                 s4o.print("(");
       
   864                 return_type_symbol->accept(*this);
       
   865                 s4o.print(")");
       
   866                 IN_param_value->accept(*this);
       
   867                 return NULL;
       
   868                 
       
   869             }
       
   870             
       
   871             ERROR;
       
   872         }
       
   873         
       
   874     }/*function_lreal_to_lint*/
       
   875     break;
       
   876 
       
   877 /****
       
   878  *LREAL_TO_USINT
       
   879  */
       
   880     case function_lreal_to_usint :
       
   881     {
       
   882         symbol_c *last_type_symbol = NULL;
       
   883 
       
   884         {
       
   885             identifier_c param_name("IN");
       
   886             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   887             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   888             
       
   889             /* Get the value from a foo(<param_value>) style call */
       
   890             if (IN_param_value == NULL)
       
   891               IN_param_value = function_call_param_iterator.next();
       
   892             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   893             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   894             
       
   895             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
   896             {
       
   897         
       
   898                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
   899                 s4o.print("(");
       
   900                 return_type_symbol->accept(*this);
       
   901                 s4o.print(")");
       
   902                 IN_param_value->accept(*this);
       
   903                 return NULL;
       
   904                 
       
   905             }
       
   906             
       
   907             ERROR;
       
   908         }
       
   909         
       
   910     }/*function_lreal_to_usint*/
       
   911     break;
       
   912 
       
   913 /****
       
   914  *LREAL_TO_UINT
       
   915  */
       
   916     case function_lreal_to_uint :
       
   917     {
       
   918         symbol_c *last_type_symbol = NULL;
       
   919 
       
   920         {
       
   921             identifier_c param_name("IN");
       
   922             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   923             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   924             
       
   925             /* Get the value from a foo(<param_value>) style call */
       
   926             if (IN_param_value == NULL)
       
   927               IN_param_value = function_call_param_iterator.next();
       
   928             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   929             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   930             
       
   931             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
   932             {
       
   933         
       
   934                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
   935                 s4o.print("(");
       
   936                 return_type_symbol->accept(*this);
       
   937                 s4o.print(")");
       
   938                 IN_param_value->accept(*this);
       
   939                 return NULL;
       
   940                 
       
   941             }
       
   942             
       
   943             ERROR;
       
   944         }
       
   945         
       
   946     }/*function_lreal_to_uint*/
       
   947     break;
       
   948 
       
   949 /****
       
   950  *LREAL_TO_UDINT
       
   951  */
       
   952     case function_lreal_to_udint :
       
   953     {
       
   954         symbol_c *last_type_symbol = NULL;
       
   955 
       
   956         {
       
   957             identifier_c param_name("IN");
       
   958             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   959             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   960             
       
   961             /* Get the value from a foo(<param_value>) style call */
       
   962             if (IN_param_value == NULL)
       
   963               IN_param_value = function_call_param_iterator.next();
       
   964             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
   965             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
   966             
       
   967             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
   968             {
       
   969         
       
   970                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
   971                 s4o.print("(");
       
   972                 return_type_symbol->accept(*this);
       
   973                 s4o.print(")");
       
   974                 IN_param_value->accept(*this);
       
   975                 return NULL;
       
   976                 
       
   977             }
       
   978             
       
   979             ERROR;
       
   980         }
       
   981         
       
   982     }/*function_lreal_to_udint*/
       
   983     break;
       
   984 
       
   985 /****
       
   986  *LREAL_TO_ULINT
       
   987  */
       
   988     case function_lreal_to_ulint :
       
   989     {
       
   990         symbol_c *last_type_symbol = NULL;
       
   991 
       
   992         {
       
   993             identifier_c param_name("IN");
       
   994             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
   995             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
   996             
       
   997             /* Get the value from a foo(<param_value>) style call */
       
   998             if (IN_param_value == NULL)
       
   999               IN_param_value = function_call_param_iterator.next();
       
  1000             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1001             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1002             
       
  1003             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
  1004             {
       
  1005         
       
  1006                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  1007                 s4o.print("(");
       
  1008                 return_type_symbol->accept(*this);
       
  1009                 s4o.print(")");
       
  1010                 IN_param_value->accept(*this);
       
  1011                 return NULL;
       
  1012                 
       
  1013             }
       
  1014             
       
  1015             ERROR;
       
  1016         }
       
  1017         
       
  1018     }/*function_lreal_to_ulint*/
       
  1019     break;
       
  1020 
       
  1021 /****
       
  1022  *LREAL_TO_TIME
       
  1023  */
       
  1024     case function_lreal_to_time :
       
  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 (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
  1040             {
       
  1041         
       
  1042                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  1043                 s4o.print("(");
       
  1044                 return_type_symbol->accept(*this);
       
  1045                 s4o.print(")__real_to_time(");
       
  1046                 IN_param_value->accept(*this);
       
  1047                 s4o.print(")");
       
  1048                 return NULL;
       
  1049                 
       
  1050             }
       
  1051             
       
  1052             ERROR;
       
  1053         }
       
  1054         
       
  1055     }/*function_lreal_to_time*/
       
  1056     break;
       
  1057 
       
  1058 /****
       
  1059  *LREAL_TO_BOOL
       
  1060  */
       
  1061     case function_lreal_to_bool :
       
  1062     {
       
  1063         symbol_c *last_type_symbol = NULL;
       
  1064 
       
  1065         {
       
  1066             identifier_c param_name("IN");
       
  1067             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1068             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1069             
       
  1070             /* Get the value from a foo(<param_value>) style call */
       
  1071             if (IN_param_value == NULL)
       
  1072               IN_param_value = function_call_param_iterator.next();
       
  1073             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1074             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1075             
       
  1076             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
  1077             {
       
  1078         
       
  1079                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  1080                 s4o.print("(");
       
  1081                 return_type_symbol->accept(*this);
       
  1082                 s4o.print(")");
       
  1083                 IN_param_value->accept(*this);
       
  1084                 return NULL;
       
  1085                 
       
  1086             }
       
  1087             
       
  1088             ERROR;
       
  1089         }
       
  1090         
       
  1091     }/*function_lreal_to_bool*/
       
  1092     break;
       
  1093 
       
  1094 /****
       
  1095  *LREAL_TO_BYTE
       
  1096  */
       
  1097     case function_lreal_to_byte :
       
  1098     {
       
  1099         symbol_c *last_type_symbol = NULL;
       
  1100 
       
  1101         {
       
  1102             identifier_c param_name("IN");
       
  1103             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1104             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1105             
       
  1106             /* Get the value from a foo(<param_value>) style call */
       
  1107             if (IN_param_value == NULL)
       
  1108               IN_param_value = function_call_param_iterator.next();
       
  1109             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1110             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1111             
       
  1112             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
  1113             {
       
  1114         
       
  1115                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  1116                 s4o.print("(");
       
  1117                 return_type_symbol->accept(*this);
       
  1118                 s4o.print(")");
       
  1119                 IN_param_value->accept(*this);
       
  1120                 return NULL;
       
  1121                 
       
  1122             }
       
  1123             
       
  1124             ERROR;
       
  1125         }
       
  1126         
       
  1127     }/*function_lreal_to_byte*/
       
  1128     break;
       
  1129 
       
  1130 /****
       
  1131  *LREAL_TO_WORD
       
  1132  */
       
  1133     case function_lreal_to_word :
       
  1134     {
       
  1135         symbol_c *last_type_symbol = NULL;
       
  1136 
       
  1137         {
       
  1138             identifier_c param_name("IN");
       
  1139             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1140             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1141             
       
  1142             /* Get the value from a foo(<param_value>) style call */
       
  1143             if (IN_param_value == NULL)
       
  1144               IN_param_value = function_call_param_iterator.next();
       
  1145             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1146             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1147             
       
  1148             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
  1149             {
       
  1150         
       
  1151                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  1152                 s4o.print("(");
       
  1153                 return_type_symbol->accept(*this);
       
  1154                 s4o.print(")");
       
  1155                 IN_param_value->accept(*this);
       
  1156                 return NULL;
       
  1157                 
       
  1158             }
       
  1159             
       
  1160             ERROR;
       
  1161         }
       
  1162         
       
  1163     }/*function_lreal_to_word*/
       
  1164     break;
       
  1165 
       
  1166 /****
       
  1167  *LREAL_TO_DWORD
       
  1168  */
       
  1169     case function_lreal_to_dword :
       
  1170     {
       
  1171         symbol_c *last_type_symbol = NULL;
       
  1172 
       
  1173         {
       
  1174             identifier_c param_name("IN");
       
  1175             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1176             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1177             
       
  1178             /* Get the value from a foo(<param_value>) style call */
       
  1179             if (IN_param_value == NULL)
       
  1180               IN_param_value = function_call_param_iterator.next();
       
  1181             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1182             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1183             
       
  1184             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
  1185             {
       
  1186         
       
  1187                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  1188                 s4o.print("(");
       
  1189                 return_type_symbol->accept(*this);
       
  1190                 s4o.print(")");
       
  1191                 IN_param_value->accept(*this);
       
  1192                 return NULL;
       
  1193                 
       
  1194             }
       
  1195             
       
  1196             ERROR;
       
  1197         }
       
  1198         
       
  1199     }/*function_lreal_to_dword*/
       
  1200     break;
       
  1201 
       
  1202 /****
       
  1203  *LREAL_TO_LWORD
       
  1204  */
       
  1205     case function_lreal_to_lword :
       
  1206     {
       
  1207         symbol_c *last_type_symbol = NULL;
       
  1208 
       
  1209         {
       
  1210             identifier_c param_name("IN");
       
  1211             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1212             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1213             
       
  1214             /* Get the value from a foo(<param_value>) style call */
       
  1215             if (IN_param_value == NULL)
       
  1216               IN_param_value = function_call_param_iterator.next();
       
  1217             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1218             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1219             
       
  1220             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
  1221             {
       
  1222         
       
  1223                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  1224                 s4o.print("(");
       
  1225                 return_type_symbol->accept(*this);
       
  1226                 s4o.print(")");
       
  1227                 IN_param_value->accept(*this);
       
  1228                 return NULL;
       
  1229                 
       
  1230             }
       
  1231             
       
  1232             ERROR;
       
  1233         }
       
  1234         
       
  1235     }/*function_lreal_to_lword*/
       
  1236     break;
       
  1237 
       
  1238 /****
       
  1239  *LREAL_TO_STRING
       
  1240  */
       
  1241     case function_lreal_to_string :
       
  1242     {
       
  1243         symbol_c *last_type_symbol = NULL;
       
  1244 
       
  1245         {
       
  1246             identifier_c param_name("IN");
       
  1247             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1248             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1249             
       
  1250             /* Get the value from a foo(<param_value>) style call */
       
  1251             if (IN_param_value == NULL)
       
  1252               IN_param_value = function_call_param_iterator.next();
       
  1253             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1254             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1255             
       
  1256             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
  1257             {
       
  1258         
       
  1259                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  1260                 s4o.print("(");
       
  1261                 return_type_symbol->accept(*this);
       
  1262                 s4o.print(")__real_to_string(");
       
  1263                 IN_param_value->accept(*this);
       
  1264                 s4o.print(")");
       
  1265                 return NULL;
       
  1266                 
       
  1267             }
       
  1268             
       
  1269             ERROR;
       
  1270         }
       
  1271         
       
  1272     }/*function_lreal_to_string*/
       
  1273     break;
       
  1274 
       
  1275 /****
       
  1276  *LREAL_TO_DATE
       
  1277  */
       
  1278     case function_lreal_to_date :
       
  1279     {
       
  1280         symbol_c *last_type_symbol = NULL;
       
  1281 
       
  1282         {
       
  1283             identifier_c param_name("IN");
       
  1284             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1285             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1286             
       
  1287             /* Get the value from a foo(<param_value>) style call */
       
  1288             if (IN_param_value == NULL)
       
  1289               IN_param_value = function_call_param_iterator.next();
       
  1290             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1291             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1292             
       
  1293             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
  1294             {
       
  1295         
   644                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
  1296                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
   645                 s4o.print("(");
  1297                 s4o.print("(");
   646                 return_type_symbol->accept(*this);
  1298                 return_type_symbol->accept(*this);
   647                 s4o.print(")real_to_time(");
  1299                 s4o.print(")__real_to_time(");
   648                 IN_param_value->accept(*this);
  1300                 IN_param_value->accept(*this);
   649                 s4o.print(")");
  1301                 s4o.print(")");
   650                 return NULL;
  1302                 return NULL;
   651                 
  1303                 
   652             }
  1304             }
   653             
  1305             
   654             ERROR;
  1306             ERROR;
   655         }
  1307         }
   656         
  1308         
   657     }/*function_real_to_date*/
  1309     }/*function_lreal_to_date*/
   658     break;
  1310     break;
   659 
  1311 
   660 /****
  1312 /****
   661  *REAL_TO_TOD
  1313  *LREAL_TO_TOD
   662  */
  1314  */
   663     case function_real_to_tod :
  1315     case function_lreal_to_tod :
   664     {
  1316     {
   665         symbol_c *last_type_symbol = NULL;
  1317         symbol_c *last_type_symbol = NULL;
   666 
  1318 
   667         {
  1319         {
   668             identifier_c param_name("IN");
  1320             identifier_c param_name("IN");
   669             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1321             /* Get the value from a foo(<param_name> = <param_value>) style call */
   670             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1322             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   671             
  1323             
   672             /* Get the value from a foo(<param_value>) style call */
  1324             /* Get the value from a foo(<param_value>) style call */
   673             if (IN_param_value == NULL)
  1325             if (IN_param_value == NULL)
   674               IN_param_value = function_call_param_iterator.next();
  1326               IN_param_value = function_call_param_iterator.next();
   675             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1327             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   676             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1328             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   677             
  1329             
   678             if (typeid(*last_type_symbol) == typeid(real_type_name_c))
  1330             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
   679             {
  1331             {
   680         
  1332         
   681                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
  1333                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
   682                 s4o.print("(");
  1334                 s4o.print("(");
   683                 return_type_symbol->accept(*this);
  1335                 return_type_symbol->accept(*this);
   684                 s4o.print(")real_to_time(");
  1336                 s4o.print(")__real_to_time(");
   685                 IN_param_value->accept(*this);
  1337                 IN_param_value->accept(*this);
   686                 s4o.print(")");
  1338                 s4o.print(")");
   687                 return NULL;
  1339                 return NULL;
   688                 
  1340                 
   689             }
  1341             }
   690             
  1342             
   691             ERROR;
  1343             ERROR;
   692         }
  1344         }
   693         
  1345         
   694     }/*function_real_to_tod*/
  1346     }/*function_lreal_to_tod*/
   695     break;
  1347     break;
   696 
  1348 
   697 /****
  1349 /****
   698  *REAL_TO_DT
  1350  *LREAL_TO_DT
   699  */
  1351  */
   700     case function_real_to_dt :
  1352     case function_lreal_to_dt :
   701     {
  1353     {
   702         symbol_c *last_type_symbol = NULL;
  1354         symbol_c *last_type_symbol = NULL;
   703 
  1355 
   704         {
  1356         {
   705             identifier_c param_name("IN");
  1357             identifier_c param_name("IN");
   706             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1358             /* Get the value from a foo(<param_name> = <param_value>) style call */
   707             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1359             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   708             
  1360             
   709             /* Get the value from a foo(<param_value>) style call */
  1361             /* Get the value from a foo(<param_value>) style call */
   710             if (IN_param_value == NULL)
  1362             if (IN_param_value == NULL)
   711               IN_param_value = function_call_param_iterator.next();
  1363               IN_param_value = function_call_param_iterator.next();
   712             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1364             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   713             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1365             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   714             
  1366             
   715             if (typeid(*last_type_symbol) == typeid(real_type_name_c))
  1367             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
   716             {
  1368             {
   717         
  1369         
   718                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
  1370                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
   719                 s4o.print("(");
  1371                 s4o.print("(");
   720                 return_type_symbol->accept(*this);
  1372                 return_type_symbol->accept(*this);
   721                 s4o.print(")real_to_time(");
  1373                 s4o.print(")__real_to_time(");
   722                 IN_param_value->accept(*this);
  1374                 IN_param_value->accept(*this);
   723                 s4o.print(")");
  1375                 s4o.print(")");
   724                 return NULL;
  1376                 return NULL;
   725                 
  1377                 
   726             }
  1378             }
   727             
  1379             
   728             ERROR;
  1380             ERROR;
   729         }
  1381         }
   730         
  1382         
   731     }/*function_real_to_dt*/
  1383     }/*function_lreal_to_dt*/
   732     break;
  1384     break;
   733 
  1385 
   734 /****
  1386 /****
   735  *LREAL_TO_REAL
  1387  *SINT_TO_REAL
   736  */
  1388  */
   737     case function_lreal_to_real :
  1389     case function_sint_to_real :
   738     {
  1390     {
   739         symbol_c *last_type_symbol = NULL;
  1391         symbol_c *last_type_symbol = NULL;
   740 
  1392 
   741         {
  1393         {
   742             identifier_c param_name("IN");
  1394             identifier_c param_name("IN");
   743             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1395             /* Get the value from a foo(<param_name> = <param_value>) style call */
   744             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1396             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   745             
  1397             
   746             /* Get the value from a foo(<param_value>) style call */
  1398             /* Get the value from a foo(<param_value>) style call */
   747             if (IN_param_value == NULL)
  1399             if (IN_param_value == NULL)
   748               IN_param_value = function_call_param_iterator.next();
  1400               IN_param_value = function_call_param_iterator.next();
   749             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1401             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   750             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1402             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   751             
  1403             
   752             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
  1404             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
   753             {
  1405             {
   754         
  1406         
   755                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
  1407                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
   756                 s4o.print("(");
  1408                 s4o.print("(");
   757                 return_type_symbol->accept(*this);
  1409                 return_type_symbol->accept(*this);
   762             }
  1414             }
   763             
  1415             
   764             ERROR;
  1416             ERROR;
   765         }
  1417         }
   766         
  1418         
   767     }/*function_lreal_to_real*/
  1419     }/*function_sint_to_real*/
   768     break;
  1420     break;
   769 
  1421 
   770 /****
  1422 /****
   771  *LREAL_TO_SINT
  1423  *SINT_TO_LREAL
   772  */
  1424  */
   773     case function_lreal_to_sint :
  1425     case function_sint_to_lreal :
   774     {
  1426     {
   775         symbol_c *last_type_symbol = NULL;
  1427         symbol_c *last_type_symbol = NULL;
   776 
  1428 
   777         {
  1429         {
   778             identifier_c param_name("IN");
  1430             identifier_c param_name("IN");
   779             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1431             /* Get the value from a foo(<param_name> = <param_value>) style call */
   780             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1432             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   781             
  1433             
   782             /* Get the value from a foo(<param_value>) style call */
  1434             /* Get the value from a foo(<param_value>) style call */
   783             if (IN_param_value == NULL)
  1435             if (IN_param_value == NULL)
   784               IN_param_value = function_call_param_iterator.next();
  1436               IN_param_value = function_call_param_iterator.next();
   785             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1437             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   786             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1438             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   787             
  1439             
   788             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
  1440             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1441             {
       
  1442         
       
  1443                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  1444                 s4o.print("(");
       
  1445                 return_type_symbol->accept(*this);
       
  1446                 s4o.print(")");
       
  1447                 IN_param_value->accept(*this);
       
  1448                 return NULL;
       
  1449                 
       
  1450             }
       
  1451             
       
  1452             ERROR;
       
  1453         }
       
  1454         
       
  1455     }/*function_sint_to_lreal*/
       
  1456     break;
       
  1457 
       
  1458 /****
       
  1459  *SINT_TO_INT
       
  1460  */
       
  1461     case function_sint_to_int :
       
  1462     {
       
  1463         symbol_c *last_type_symbol = NULL;
       
  1464 
       
  1465         {
       
  1466             identifier_c param_name("IN");
       
  1467             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1468             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1469             
       
  1470             /* Get the value from a foo(<param_value>) style call */
       
  1471             if (IN_param_value == NULL)
       
  1472               IN_param_value = function_call_param_iterator.next();
       
  1473             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1474             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1475             
       
  1476             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1477             {
       
  1478         
       
  1479                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  1480                 s4o.print("(");
       
  1481                 return_type_symbol->accept(*this);
       
  1482                 s4o.print(")");
       
  1483                 IN_param_value->accept(*this);
       
  1484                 return NULL;
       
  1485                 
       
  1486             }
       
  1487             
       
  1488             ERROR;
       
  1489         }
       
  1490         
       
  1491     }/*function_sint_to_int*/
       
  1492     break;
       
  1493 
       
  1494 /****
       
  1495  *SINT_TO_DINT
       
  1496  */
       
  1497     case function_sint_to_dint :
       
  1498     {
       
  1499         symbol_c *last_type_symbol = NULL;
       
  1500 
       
  1501         {
       
  1502             identifier_c param_name("IN");
       
  1503             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1504             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1505             
       
  1506             /* Get the value from a foo(<param_value>) style call */
       
  1507             if (IN_param_value == NULL)
       
  1508               IN_param_value = function_call_param_iterator.next();
       
  1509             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1510             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1511             
       
  1512             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1513             {
       
  1514         
       
  1515                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  1516                 s4o.print("(");
       
  1517                 return_type_symbol->accept(*this);
       
  1518                 s4o.print(")");
       
  1519                 IN_param_value->accept(*this);
       
  1520                 return NULL;
       
  1521                 
       
  1522             }
       
  1523             
       
  1524             ERROR;
       
  1525         }
       
  1526         
       
  1527     }/*function_sint_to_dint*/
       
  1528     break;
       
  1529 
       
  1530 /****
       
  1531  *SINT_TO_LINT
       
  1532  */
       
  1533     case function_sint_to_lint :
       
  1534     {
       
  1535         symbol_c *last_type_symbol = NULL;
       
  1536 
       
  1537         {
       
  1538             identifier_c param_name("IN");
       
  1539             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1540             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1541             
       
  1542             /* Get the value from a foo(<param_value>) style call */
       
  1543             if (IN_param_value == NULL)
       
  1544               IN_param_value = function_call_param_iterator.next();
       
  1545             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1546             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1547             
       
  1548             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1549             {
       
  1550         
       
  1551                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  1552                 s4o.print("(");
       
  1553                 return_type_symbol->accept(*this);
       
  1554                 s4o.print(")");
       
  1555                 IN_param_value->accept(*this);
       
  1556                 return NULL;
       
  1557                 
       
  1558             }
       
  1559             
       
  1560             ERROR;
       
  1561         }
       
  1562         
       
  1563     }/*function_sint_to_lint*/
       
  1564     break;
       
  1565 
       
  1566 /****
       
  1567  *SINT_TO_USINT
       
  1568  */
       
  1569     case function_sint_to_usint :
       
  1570     {
       
  1571         symbol_c *last_type_symbol = NULL;
       
  1572 
       
  1573         {
       
  1574             identifier_c param_name("IN");
       
  1575             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1576             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1577             
       
  1578             /* Get the value from a foo(<param_value>) style call */
       
  1579             if (IN_param_value == NULL)
       
  1580               IN_param_value = function_call_param_iterator.next();
       
  1581             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1582             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1583             
       
  1584             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1585             {
       
  1586         
       
  1587                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  1588                 s4o.print("(");
       
  1589                 return_type_symbol->accept(*this);
       
  1590                 s4o.print(")");
       
  1591                 IN_param_value->accept(*this);
       
  1592                 return NULL;
       
  1593                 
       
  1594             }
       
  1595             
       
  1596             ERROR;
       
  1597         }
       
  1598         
       
  1599     }/*function_sint_to_usint*/
       
  1600     break;
       
  1601 
       
  1602 /****
       
  1603  *SINT_TO_UINT
       
  1604  */
       
  1605     case function_sint_to_uint :
       
  1606     {
       
  1607         symbol_c *last_type_symbol = NULL;
       
  1608 
       
  1609         {
       
  1610             identifier_c param_name("IN");
       
  1611             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1612             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1613             
       
  1614             /* Get the value from a foo(<param_value>) style call */
       
  1615             if (IN_param_value == NULL)
       
  1616               IN_param_value = function_call_param_iterator.next();
       
  1617             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1618             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1619             
       
  1620             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1621             {
       
  1622         
       
  1623                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  1624                 s4o.print("(");
       
  1625                 return_type_symbol->accept(*this);
       
  1626                 s4o.print(")");
       
  1627                 IN_param_value->accept(*this);
       
  1628                 return NULL;
       
  1629                 
       
  1630             }
       
  1631             
       
  1632             ERROR;
       
  1633         }
       
  1634         
       
  1635     }/*function_sint_to_uint*/
       
  1636     break;
       
  1637 
       
  1638 /****
       
  1639  *SINT_TO_UDINT
       
  1640  */
       
  1641     case function_sint_to_udint :
       
  1642     {
       
  1643         symbol_c *last_type_symbol = NULL;
       
  1644 
       
  1645         {
       
  1646             identifier_c param_name("IN");
       
  1647             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1648             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1649             
       
  1650             /* Get the value from a foo(<param_value>) style call */
       
  1651             if (IN_param_value == NULL)
       
  1652               IN_param_value = function_call_param_iterator.next();
       
  1653             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1654             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1655             
       
  1656             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1657             {
       
  1658         
       
  1659                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  1660                 s4o.print("(");
       
  1661                 return_type_symbol->accept(*this);
       
  1662                 s4o.print(")");
       
  1663                 IN_param_value->accept(*this);
       
  1664                 return NULL;
       
  1665                 
       
  1666             }
       
  1667             
       
  1668             ERROR;
       
  1669         }
       
  1670         
       
  1671     }/*function_sint_to_udint*/
       
  1672     break;
       
  1673 
       
  1674 /****
       
  1675  *SINT_TO_ULINT
       
  1676  */
       
  1677     case function_sint_to_ulint :
       
  1678     {
       
  1679         symbol_c *last_type_symbol = NULL;
       
  1680 
       
  1681         {
       
  1682             identifier_c param_name("IN");
       
  1683             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1684             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1685             
       
  1686             /* Get the value from a foo(<param_value>) style call */
       
  1687             if (IN_param_value == NULL)
       
  1688               IN_param_value = function_call_param_iterator.next();
       
  1689             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1690             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1691             
       
  1692             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1693             {
       
  1694         
       
  1695                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  1696                 s4o.print("(");
       
  1697                 return_type_symbol->accept(*this);
       
  1698                 s4o.print(")");
       
  1699                 IN_param_value->accept(*this);
       
  1700                 return NULL;
       
  1701                 
       
  1702             }
       
  1703             
       
  1704             ERROR;
       
  1705         }
       
  1706         
       
  1707     }/*function_sint_to_ulint*/
       
  1708     break;
       
  1709 
       
  1710 /****
       
  1711  *SINT_TO_TIME
       
  1712  */
       
  1713     case function_sint_to_time :
       
  1714     {
       
  1715         symbol_c *last_type_symbol = NULL;
       
  1716 
       
  1717         {
       
  1718             identifier_c param_name("IN");
       
  1719             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1720             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1721             
       
  1722             /* Get the value from a foo(<param_value>) style call */
       
  1723             if (IN_param_value == NULL)
       
  1724               IN_param_value = function_call_param_iterator.next();
       
  1725             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1726             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1727             
       
  1728             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1729             {
       
  1730         
       
  1731                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  1732                 s4o.print("(");
       
  1733                 return_type_symbol->accept(*this);
       
  1734                 s4o.print(")__int_to_time(");
       
  1735                 IN_param_value->accept(*this);
       
  1736                 s4o.print(")");
       
  1737                 return NULL;
       
  1738                 
       
  1739             }
       
  1740             
       
  1741             ERROR;
       
  1742         }
       
  1743         
       
  1744     }/*function_sint_to_time*/
       
  1745     break;
       
  1746 
       
  1747 /****
       
  1748  *SINT_TO_BOOL
       
  1749  */
       
  1750     case function_sint_to_bool :
       
  1751     {
       
  1752         symbol_c *last_type_symbol = NULL;
       
  1753 
       
  1754         {
       
  1755             identifier_c param_name("IN");
       
  1756             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1757             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1758             
       
  1759             /* Get the value from a foo(<param_value>) style call */
       
  1760             if (IN_param_value == NULL)
       
  1761               IN_param_value = function_call_param_iterator.next();
       
  1762             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1763             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1764             
       
  1765             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1766             {
       
  1767         
       
  1768                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  1769                 s4o.print("(");
       
  1770                 return_type_symbol->accept(*this);
       
  1771                 s4o.print(")");
       
  1772                 IN_param_value->accept(*this);
       
  1773                 return NULL;
       
  1774                 
       
  1775             }
       
  1776             
       
  1777             ERROR;
       
  1778         }
       
  1779         
       
  1780     }/*function_sint_to_bool*/
       
  1781     break;
       
  1782 
       
  1783 /****
       
  1784  *SINT_TO_BYTE
       
  1785  */
       
  1786     case function_sint_to_byte :
       
  1787     {
       
  1788         symbol_c *last_type_symbol = NULL;
       
  1789 
       
  1790         {
       
  1791             identifier_c param_name("IN");
       
  1792             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1793             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1794             
       
  1795             /* Get the value from a foo(<param_value>) style call */
       
  1796             if (IN_param_value == NULL)
       
  1797               IN_param_value = function_call_param_iterator.next();
       
  1798             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1799             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1800             
       
  1801             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1802             {
       
  1803         
       
  1804                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  1805                 s4o.print("(");
       
  1806                 return_type_symbol->accept(*this);
       
  1807                 s4o.print(")");
       
  1808                 IN_param_value->accept(*this);
       
  1809                 return NULL;
       
  1810                 
       
  1811             }
       
  1812             
       
  1813             ERROR;
       
  1814         }
       
  1815         
       
  1816     }/*function_sint_to_byte*/
       
  1817     break;
       
  1818 
       
  1819 /****
       
  1820  *SINT_TO_WORD
       
  1821  */
       
  1822     case function_sint_to_word :
       
  1823     {
       
  1824         symbol_c *last_type_symbol = NULL;
       
  1825 
       
  1826         {
       
  1827             identifier_c param_name("IN");
       
  1828             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1829             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1830             
       
  1831             /* Get the value from a foo(<param_value>) style call */
       
  1832             if (IN_param_value == NULL)
       
  1833               IN_param_value = function_call_param_iterator.next();
       
  1834             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1835             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1836             
       
  1837             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1838             {
       
  1839         
       
  1840                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  1841                 s4o.print("(");
       
  1842                 return_type_symbol->accept(*this);
       
  1843                 s4o.print(")");
       
  1844                 IN_param_value->accept(*this);
       
  1845                 return NULL;
       
  1846                 
       
  1847             }
       
  1848             
       
  1849             ERROR;
       
  1850         }
       
  1851         
       
  1852     }/*function_sint_to_word*/
       
  1853     break;
       
  1854 
       
  1855 /****
       
  1856  *SINT_TO_DWORD
       
  1857  */
       
  1858     case function_sint_to_dword :
       
  1859     {
       
  1860         symbol_c *last_type_symbol = NULL;
       
  1861 
       
  1862         {
       
  1863             identifier_c param_name("IN");
       
  1864             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1865             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1866             
       
  1867             /* Get the value from a foo(<param_value>) style call */
       
  1868             if (IN_param_value == NULL)
       
  1869               IN_param_value = function_call_param_iterator.next();
       
  1870             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1871             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1872             
       
  1873             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1874             {
       
  1875         
       
  1876                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  1877                 s4o.print("(");
       
  1878                 return_type_symbol->accept(*this);
       
  1879                 s4o.print(")");
       
  1880                 IN_param_value->accept(*this);
       
  1881                 return NULL;
       
  1882                 
       
  1883             }
       
  1884             
       
  1885             ERROR;
       
  1886         }
       
  1887         
       
  1888     }/*function_sint_to_dword*/
       
  1889     break;
       
  1890 
       
  1891 /****
       
  1892  *SINT_TO_LWORD
       
  1893  */
       
  1894     case function_sint_to_lword :
       
  1895     {
       
  1896         symbol_c *last_type_symbol = NULL;
       
  1897 
       
  1898         {
       
  1899             identifier_c param_name("IN");
       
  1900             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1901             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1902             
       
  1903             /* Get the value from a foo(<param_value>) style call */
       
  1904             if (IN_param_value == NULL)
       
  1905               IN_param_value = function_call_param_iterator.next();
       
  1906             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1907             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1908             
       
  1909             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1910             {
       
  1911         
       
  1912                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  1913                 s4o.print("(");
       
  1914                 return_type_symbol->accept(*this);
       
  1915                 s4o.print(")");
       
  1916                 IN_param_value->accept(*this);
       
  1917                 return NULL;
       
  1918                 
       
  1919             }
       
  1920             
       
  1921             ERROR;
       
  1922         }
       
  1923         
       
  1924     }/*function_sint_to_lword*/
       
  1925     break;
       
  1926 
       
  1927 /****
       
  1928  *SINT_TO_STRING
       
  1929  */
       
  1930     case function_sint_to_string :
       
  1931     {
       
  1932         symbol_c *last_type_symbol = NULL;
       
  1933 
       
  1934         {
       
  1935             identifier_c param_name("IN");
       
  1936             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1937             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1938             
       
  1939             /* Get the value from a foo(<param_value>) style call */
       
  1940             if (IN_param_value == NULL)
       
  1941               IN_param_value = function_call_param_iterator.next();
       
  1942             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1943             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1944             
       
  1945             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1946             {
       
  1947         
       
  1948                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  1949                 s4o.print("(");
       
  1950                 return_type_symbol->accept(*this);
       
  1951                 s4o.print(")__sint_to_string(");
       
  1952                 IN_param_value->accept(*this);
       
  1953                 s4o.print(")");
       
  1954                 return NULL;
       
  1955                 
       
  1956             }
       
  1957             
       
  1958             ERROR;
       
  1959         }
       
  1960         
       
  1961     }/*function_sint_to_string*/
       
  1962     break;
       
  1963 
       
  1964 /****
       
  1965  *SINT_TO_DATE
       
  1966  */
       
  1967     case function_sint_to_date :
       
  1968     {
       
  1969         symbol_c *last_type_symbol = NULL;
       
  1970 
       
  1971         {
       
  1972             identifier_c param_name("IN");
       
  1973             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1974             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1975             
       
  1976             /* Get the value from a foo(<param_value>) style call */
       
  1977             if (IN_param_value == NULL)
       
  1978               IN_param_value = function_call_param_iterator.next();
       
  1979             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1980             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1981             
       
  1982             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1983             {
       
  1984         
       
  1985                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  1986                 s4o.print("(");
       
  1987                 return_type_symbol->accept(*this);
       
  1988                 s4o.print(")__int_to_time(");
       
  1989                 IN_param_value->accept(*this);
       
  1990                 s4o.print(")");
       
  1991                 return NULL;
       
  1992                 
       
  1993             }
       
  1994             
       
  1995             ERROR;
       
  1996         }
       
  1997         
       
  1998     }/*function_sint_to_date*/
       
  1999     break;
       
  2000 
       
  2001 /****
       
  2002  *SINT_TO_TOD
       
  2003  */
       
  2004     case function_sint_to_tod :
       
  2005     {
       
  2006         symbol_c *last_type_symbol = NULL;
       
  2007 
       
  2008         {
       
  2009             identifier_c param_name("IN");
       
  2010             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2011             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2012             
       
  2013             /* Get the value from a foo(<param_value>) style call */
       
  2014             if (IN_param_value == NULL)
       
  2015               IN_param_value = function_call_param_iterator.next();
       
  2016             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2017             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2018             
       
  2019             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  2020             {
       
  2021         
       
  2022                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  2023                 s4o.print("(");
       
  2024                 return_type_symbol->accept(*this);
       
  2025                 s4o.print(")__int_to_time(");
       
  2026                 IN_param_value->accept(*this);
       
  2027                 s4o.print(")");
       
  2028                 return NULL;
       
  2029                 
       
  2030             }
       
  2031             
       
  2032             ERROR;
       
  2033         }
       
  2034         
       
  2035     }/*function_sint_to_tod*/
       
  2036     break;
       
  2037 
       
  2038 /****
       
  2039  *SINT_TO_DT
       
  2040  */
       
  2041     case function_sint_to_dt :
       
  2042     {
       
  2043         symbol_c *last_type_symbol = NULL;
       
  2044 
       
  2045         {
       
  2046             identifier_c param_name("IN");
       
  2047             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2048             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2049             
       
  2050             /* Get the value from a foo(<param_value>) style call */
       
  2051             if (IN_param_value == NULL)
       
  2052               IN_param_value = function_call_param_iterator.next();
       
  2053             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2054             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2055             
       
  2056             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  2057             {
       
  2058         
       
  2059                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  2060                 s4o.print("(");
       
  2061                 return_type_symbol->accept(*this);
       
  2062                 s4o.print(")__int_to_time(");
       
  2063                 IN_param_value->accept(*this);
       
  2064                 s4o.print(")");
       
  2065                 return NULL;
       
  2066                 
       
  2067             }
       
  2068             
       
  2069             ERROR;
       
  2070         }
       
  2071         
       
  2072     }/*function_sint_to_dt*/
       
  2073     break;
       
  2074 
       
  2075 /****
       
  2076  *INT_TO_REAL
       
  2077  */
       
  2078     case function_int_to_real :
       
  2079     {
       
  2080         symbol_c *last_type_symbol = NULL;
       
  2081 
       
  2082         {
       
  2083             identifier_c param_name("IN");
       
  2084             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2085             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2086             
       
  2087             /* Get the value from a foo(<param_value>) style call */
       
  2088             if (IN_param_value == NULL)
       
  2089               IN_param_value = function_call_param_iterator.next();
       
  2090             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2091             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2092             
       
  2093             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2094             {
       
  2095         
       
  2096                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  2097                 s4o.print("(");
       
  2098                 return_type_symbol->accept(*this);
       
  2099                 s4o.print(")");
       
  2100                 IN_param_value->accept(*this);
       
  2101                 return NULL;
       
  2102                 
       
  2103             }
       
  2104             
       
  2105             ERROR;
       
  2106         }
       
  2107         
       
  2108     }/*function_int_to_real*/
       
  2109     break;
       
  2110 
       
  2111 /****
       
  2112  *INT_TO_LREAL
       
  2113  */
       
  2114     case function_int_to_lreal :
       
  2115     {
       
  2116         symbol_c *last_type_symbol = NULL;
       
  2117 
       
  2118         {
       
  2119             identifier_c param_name("IN");
       
  2120             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2121             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2122             
       
  2123             /* Get the value from a foo(<param_value>) style call */
       
  2124             if (IN_param_value == NULL)
       
  2125               IN_param_value = function_call_param_iterator.next();
       
  2126             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2127             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2128             
       
  2129             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2130             {
       
  2131         
       
  2132                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  2133                 s4o.print("(");
       
  2134                 return_type_symbol->accept(*this);
       
  2135                 s4o.print(")");
       
  2136                 IN_param_value->accept(*this);
       
  2137                 return NULL;
       
  2138                 
       
  2139             }
       
  2140             
       
  2141             ERROR;
       
  2142         }
       
  2143         
       
  2144     }/*function_int_to_lreal*/
       
  2145     break;
       
  2146 
       
  2147 /****
       
  2148  *INT_TO_SINT
       
  2149  */
       
  2150     case function_int_to_sint :
       
  2151     {
       
  2152         symbol_c *last_type_symbol = NULL;
       
  2153 
       
  2154         {
       
  2155             identifier_c param_name("IN");
       
  2156             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2157             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2158             
       
  2159             /* Get the value from a foo(<param_value>) style call */
       
  2160             if (IN_param_value == NULL)
       
  2161               IN_param_value = function_call_param_iterator.next();
       
  2162             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2163             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2164             
       
  2165             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
   789             {
  2166             {
   790         
  2167         
   791                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
  2168                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
   792                 s4o.print("(");
  2169                 s4o.print("(");
   793                 return_type_symbol->accept(*this);
  2170                 return_type_symbol->accept(*this);
   798             }
  2175             }
   799             
  2176             
   800             ERROR;
  2177             ERROR;
   801         }
  2178         }
   802         
  2179         
   803     }/*function_lreal_to_sint*/
  2180     }/*function_int_to_sint*/
   804     break;
  2181     break;
   805 
  2182 
   806 /****
  2183 /****
   807  *LREAL_TO_INT
  2184  *INT_TO_DINT
   808  */
  2185  */
   809     case function_lreal_to_int :
  2186     case function_int_to_dint :
   810     {
  2187     {
   811         symbol_c *last_type_symbol = NULL;
  2188         symbol_c *last_type_symbol = NULL;
   812 
  2189 
   813         {
  2190         {
   814             identifier_c param_name("IN");
  2191             identifier_c param_name("IN");
   815             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2192             /* Get the value from a foo(<param_name> = <param_value>) style call */
   816             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2193             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   817             
  2194             
   818             /* Get the value from a foo(<param_value>) style call */
  2195             /* Get the value from a foo(<param_value>) style call */
   819             if (IN_param_value == NULL)
  2196             if (IN_param_value == NULL)
   820               IN_param_value = function_call_param_iterator.next();
  2197               IN_param_value = function_call_param_iterator.next();
   821             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2198             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   822             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2199             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   823             
  2200             
   824             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
  2201             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2202             {
       
  2203         
       
  2204                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  2205                 s4o.print("(");
       
  2206                 return_type_symbol->accept(*this);
       
  2207                 s4o.print(")");
       
  2208                 IN_param_value->accept(*this);
       
  2209                 return NULL;
       
  2210                 
       
  2211             }
       
  2212             
       
  2213             ERROR;
       
  2214         }
       
  2215         
       
  2216     }/*function_int_to_dint*/
       
  2217     break;
       
  2218 
       
  2219 /****
       
  2220  *INT_TO_LINT
       
  2221  */
       
  2222     case function_int_to_lint :
       
  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 (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2238             {
       
  2239         
       
  2240                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  2241                 s4o.print("(");
       
  2242                 return_type_symbol->accept(*this);
       
  2243                 s4o.print(")");
       
  2244                 IN_param_value->accept(*this);
       
  2245                 return NULL;
       
  2246                 
       
  2247             }
       
  2248             
       
  2249             ERROR;
       
  2250         }
       
  2251         
       
  2252     }/*function_int_to_lint*/
       
  2253     break;
       
  2254 
       
  2255 /****
       
  2256  *INT_TO_USINT
       
  2257  */
       
  2258     case function_int_to_usint :
       
  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 (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2274             {
       
  2275         
       
  2276                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  2277                 s4o.print("(");
       
  2278                 return_type_symbol->accept(*this);
       
  2279                 s4o.print(")");
       
  2280                 IN_param_value->accept(*this);
       
  2281                 return NULL;
       
  2282                 
       
  2283             }
       
  2284             
       
  2285             ERROR;
       
  2286         }
       
  2287         
       
  2288     }/*function_int_to_usint*/
       
  2289     break;
       
  2290 
       
  2291 /****
       
  2292  *INT_TO_UINT
       
  2293  */
       
  2294     case function_int_to_uint :
       
  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 (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2310             {
       
  2311         
       
  2312                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  2313                 s4o.print("(");
       
  2314                 return_type_symbol->accept(*this);
       
  2315                 s4o.print(")");
       
  2316                 IN_param_value->accept(*this);
       
  2317                 return NULL;
       
  2318                 
       
  2319             }
       
  2320             
       
  2321             ERROR;
       
  2322         }
       
  2323         
       
  2324     }/*function_int_to_uint*/
       
  2325     break;
       
  2326 
       
  2327 /****
       
  2328  *INT_TO_UDINT
       
  2329  */
       
  2330     case function_int_to_udint :
       
  2331     {
       
  2332         symbol_c *last_type_symbol = NULL;
       
  2333 
       
  2334         {
       
  2335             identifier_c param_name("IN");
       
  2336             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2337             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2338             
       
  2339             /* Get the value from a foo(<param_value>) style call */
       
  2340             if (IN_param_value == NULL)
       
  2341               IN_param_value = function_call_param_iterator.next();
       
  2342             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2343             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2344             
       
  2345             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2346             {
       
  2347         
       
  2348                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  2349                 s4o.print("(");
       
  2350                 return_type_symbol->accept(*this);
       
  2351                 s4o.print(")");
       
  2352                 IN_param_value->accept(*this);
       
  2353                 return NULL;
       
  2354                 
       
  2355             }
       
  2356             
       
  2357             ERROR;
       
  2358         }
       
  2359         
       
  2360     }/*function_int_to_udint*/
       
  2361     break;
       
  2362 
       
  2363 /****
       
  2364  *INT_TO_ULINT
       
  2365  */
       
  2366     case function_int_to_ulint :
       
  2367     {
       
  2368         symbol_c *last_type_symbol = NULL;
       
  2369 
       
  2370         {
       
  2371             identifier_c param_name("IN");
       
  2372             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2373             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2374             
       
  2375             /* Get the value from a foo(<param_value>) style call */
       
  2376             if (IN_param_value == NULL)
       
  2377               IN_param_value = function_call_param_iterator.next();
       
  2378             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2379             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2380             
       
  2381             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2382             {
       
  2383         
       
  2384                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  2385                 s4o.print("(");
       
  2386                 return_type_symbol->accept(*this);
       
  2387                 s4o.print(")");
       
  2388                 IN_param_value->accept(*this);
       
  2389                 return NULL;
       
  2390                 
       
  2391             }
       
  2392             
       
  2393             ERROR;
       
  2394         }
       
  2395         
       
  2396     }/*function_int_to_ulint*/
       
  2397     break;
       
  2398 
       
  2399 /****
       
  2400  *INT_TO_TIME
       
  2401  */
       
  2402     case function_int_to_time :
       
  2403     {
       
  2404         symbol_c *last_type_symbol = NULL;
       
  2405 
       
  2406         {
       
  2407             identifier_c param_name("IN");
       
  2408             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2409             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2410             
       
  2411             /* Get the value from a foo(<param_value>) style call */
       
  2412             if (IN_param_value == NULL)
       
  2413               IN_param_value = function_call_param_iterator.next();
       
  2414             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2415             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2416             
       
  2417             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2418             {
       
  2419         
       
  2420                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  2421                 s4o.print("(");
       
  2422                 return_type_symbol->accept(*this);
       
  2423                 s4o.print(")__int_to_time(");
       
  2424                 IN_param_value->accept(*this);
       
  2425                 s4o.print(")");
       
  2426                 return NULL;
       
  2427                 
       
  2428             }
       
  2429             
       
  2430             ERROR;
       
  2431         }
       
  2432         
       
  2433     }/*function_int_to_time*/
       
  2434     break;
       
  2435 
       
  2436 /****
       
  2437  *INT_TO_BOOL
       
  2438  */
       
  2439     case function_int_to_bool :
       
  2440     {
       
  2441         symbol_c *last_type_symbol = NULL;
       
  2442 
       
  2443         {
       
  2444             identifier_c param_name("IN");
       
  2445             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2446             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2447             
       
  2448             /* Get the value from a foo(<param_value>) style call */
       
  2449             if (IN_param_value == NULL)
       
  2450               IN_param_value = function_call_param_iterator.next();
       
  2451             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2452             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2453             
       
  2454             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2455             {
       
  2456         
       
  2457                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  2458                 s4o.print("(");
       
  2459                 return_type_symbol->accept(*this);
       
  2460                 s4o.print(")");
       
  2461                 IN_param_value->accept(*this);
       
  2462                 return NULL;
       
  2463                 
       
  2464             }
       
  2465             
       
  2466             ERROR;
       
  2467         }
       
  2468         
       
  2469     }/*function_int_to_bool*/
       
  2470     break;
       
  2471 
       
  2472 /****
       
  2473  *INT_TO_BYTE
       
  2474  */
       
  2475     case function_int_to_byte :
       
  2476     {
       
  2477         symbol_c *last_type_symbol = NULL;
       
  2478 
       
  2479         {
       
  2480             identifier_c param_name("IN");
       
  2481             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2482             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2483             
       
  2484             /* Get the value from a foo(<param_value>) style call */
       
  2485             if (IN_param_value == NULL)
       
  2486               IN_param_value = function_call_param_iterator.next();
       
  2487             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2488             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2489             
       
  2490             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2491             {
       
  2492         
       
  2493                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  2494                 s4o.print("(");
       
  2495                 return_type_symbol->accept(*this);
       
  2496                 s4o.print(")");
       
  2497                 IN_param_value->accept(*this);
       
  2498                 return NULL;
       
  2499                 
       
  2500             }
       
  2501             
       
  2502             ERROR;
       
  2503         }
       
  2504         
       
  2505     }/*function_int_to_byte*/
       
  2506     break;
       
  2507 
       
  2508 /****
       
  2509  *INT_TO_WORD
       
  2510  */
       
  2511     case function_int_to_word :
       
  2512     {
       
  2513         symbol_c *last_type_symbol = NULL;
       
  2514 
       
  2515         {
       
  2516             identifier_c param_name("IN");
       
  2517             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2518             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2519             
       
  2520             /* Get the value from a foo(<param_value>) style call */
       
  2521             if (IN_param_value == NULL)
       
  2522               IN_param_value = function_call_param_iterator.next();
       
  2523             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2524             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2525             
       
  2526             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2527             {
       
  2528         
       
  2529                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  2530                 s4o.print("(");
       
  2531                 return_type_symbol->accept(*this);
       
  2532                 s4o.print(")");
       
  2533                 IN_param_value->accept(*this);
       
  2534                 return NULL;
       
  2535                 
       
  2536             }
       
  2537             
       
  2538             ERROR;
       
  2539         }
       
  2540         
       
  2541     }/*function_int_to_word*/
       
  2542     break;
       
  2543 
       
  2544 /****
       
  2545  *INT_TO_DWORD
       
  2546  */
       
  2547     case function_int_to_dword :
       
  2548     {
       
  2549         symbol_c *last_type_symbol = NULL;
       
  2550 
       
  2551         {
       
  2552             identifier_c param_name("IN");
       
  2553             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2554             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2555             
       
  2556             /* Get the value from a foo(<param_value>) style call */
       
  2557             if (IN_param_value == NULL)
       
  2558               IN_param_value = function_call_param_iterator.next();
       
  2559             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2560             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2561             
       
  2562             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2563             {
       
  2564         
       
  2565                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  2566                 s4o.print("(");
       
  2567                 return_type_symbol->accept(*this);
       
  2568                 s4o.print(")");
       
  2569                 IN_param_value->accept(*this);
       
  2570                 return NULL;
       
  2571                 
       
  2572             }
       
  2573             
       
  2574             ERROR;
       
  2575         }
       
  2576         
       
  2577     }/*function_int_to_dword*/
       
  2578     break;
       
  2579 
       
  2580 /****
       
  2581  *INT_TO_LWORD
       
  2582  */
       
  2583     case function_int_to_lword :
       
  2584     {
       
  2585         symbol_c *last_type_symbol = NULL;
       
  2586 
       
  2587         {
       
  2588             identifier_c param_name("IN");
       
  2589             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2590             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2591             
       
  2592             /* Get the value from a foo(<param_value>) style call */
       
  2593             if (IN_param_value == NULL)
       
  2594               IN_param_value = function_call_param_iterator.next();
       
  2595             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2596             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2597             
       
  2598             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2599             {
       
  2600         
       
  2601                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  2602                 s4o.print("(");
       
  2603                 return_type_symbol->accept(*this);
       
  2604                 s4o.print(")");
       
  2605                 IN_param_value->accept(*this);
       
  2606                 return NULL;
       
  2607                 
       
  2608             }
       
  2609             
       
  2610             ERROR;
       
  2611         }
       
  2612         
       
  2613     }/*function_int_to_lword*/
       
  2614     break;
       
  2615 
       
  2616 /****
       
  2617  *INT_TO_STRING
       
  2618  */
       
  2619     case function_int_to_string :
       
  2620     {
       
  2621         symbol_c *last_type_symbol = NULL;
       
  2622 
       
  2623         {
       
  2624             identifier_c param_name("IN");
       
  2625             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2626             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2627             
       
  2628             /* Get the value from a foo(<param_value>) style call */
       
  2629             if (IN_param_value == NULL)
       
  2630               IN_param_value = function_call_param_iterator.next();
       
  2631             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2632             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2633             
       
  2634             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2635             {
       
  2636         
       
  2637                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  2638                 s4o.print("(");
       
  2639                 return_type_symbol->accept(*this);
       
  2640                 s4o.print(")__sint_to_string(");
       
  2641                 IN_param_value->accept(*this);
       
  2642                 s4o.print(")");
       
  2643                 return NULL;
       
  2644                 
       
  2645             }
       
  2646             
       
  2647             ERROR;
       
  2648         }
       
  2649         
       
  2650     }/*function_int_to_string*/
       
  2651     break;
       
  2652 
       
  2653 /****
       
  2654  *INT_TO_DATE
       
  2655  */
       
  2656     case function_int_to_date :
       
  2657     {
       
  2658         symbol_c *last_type_symbol = NULL;
       
  2659 
       
  2660         {
       
  2661             identifier_c param_name("IN");
       
  2662             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2663             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2664             
       
  2665             /* Get the value from a foo(<param_value>) style call */
       
  2666             if (IN_param_value == NULL)
       
  2667               IN_param_value = function_call_param_iterator.next();
       
  2668             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2669             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2670             
       
  2671             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2672             {
       
  2673         
       
  2674                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  2675                 s4o.print("(");
       
  2676                 return_type_symbol->accept(*this);
       
  2677                 s4o.print(")__int_to_time(");
       
  2678                 IN_param_value->accept(*this);
       
  2679                 s4o.print(")");
       
  2680                 return NULL;
       
  2681                 
       
  2682             }
       
  2683             
       
  2684             ERROR;
       
  2685         }
       
  2686         
       
  2687     }/*function_int_to_date*/
       
  2688     break;
       
  2689 
       
  2690 /****
       
  2691  *INT_TO_TOD
       
  2692  */
       
  2693     case function_int_to_tod :
       
  2694     {
       
  2695         symbol_c *last_type_symbol = NULL;
       
  2696 
       
  2697         {
       
  2698             identifier_c param_name("IN");
       
  2699             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2700             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2701             
       
  2702             /* Get the value from a foo(<param_value>) style call */
       
  2703             if (IN_param_value == NULL)
       
  2704               IN_param_value = function_call_param_iterator.next();
       
  2705             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2706             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2707             
       
  2708             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2709             {
       
  2710         
       
  2711                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  2712                 s4o.print("(");
       
  2713                 return_type_symbol->accept(*this);
       
  2714                 s4o.print(")__int_to_time(");
       
  2715                 IN_param_value->accept(*this);
       
  2716                 s4o.print(")");
       
  2717                 return NULL;
       
  2718                 
       
  2719             }
       
  2720             
       
  2721             ERROR;
       
  2722         }
       
  2723         
       
  2724     }/*function_int_to_tod*/
       
  2725     break;
       
  2726 
       
  2727 /****
       
  2728  *INT_TO_DT
       
  2729  */
       
  2730     case function_int_to_dt :
       
  2731     {
       
  2732         symbol_c *last_type_symbol = NULL;
       
  2733 
       
  2734         {
       
  2735             identifier_c param_name("IN");
       
  2736             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2737             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2738             
       
  2739             /* Get the value from a foo(<param_value>) style call */
       
  2740             if (IN_param_value == NULL)
       
  2741               IN_param_value = function_call_param_iterator.next();
       
  2742             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2743             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2744             
       
  2745             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2746             {
       
  2747         
       
  2748                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  2749                 s4o.print("(");
       
  2750                 return_type_symbol->accept(*this);
       
  2751                 s4o.print(")__int_to_time(");
       
  2752                 IN_param_value->accept(*this);
       
  2753                 s4o.print(")");
       
  2754                 return NULL;
       
  2755                 
       
  2756             }
       
  2757             
       
  2758             ERROR;
       
  2759         }
       
  2760         
       
  2761     }/*function_int_to_dt*/
       
  2762     break;
       
  2763 
       
  2764 /****
       
  2765  *DINT_TO_REAL
       
  2766  */
       
  2767     case function_dint_to_real :
       
  2768     {
       
  2769         symbol_c *last_type_symbol = NULL;
       
  2770 
       
  2771         {
       
  2772             identifier_c param_name("IN");
       
  2773             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2774             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2775             
       
  2776             /* Get the value from a foo(<param_value>) style call */
       
  2777             if (IN_param_value == NULL)
       
  2778               IN_param_value = function_call_param_iterator.next();
       
  2779             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2780             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2781             
       
  2782             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  2783             {
       
  2784         
       
  2785                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  2786                 s4o.print("(");
       
  2787                 return_type_symbol->accept(*this);
       
  2788                 s4o.print(")");
       
  2789                 IN_param_value->accept(*this);
       
  2790                 return NULL;
       
  2791                 
       
  2792             }
       
  2793             
       
  2794             ERROR;
       
  2795         }
       
  2796         
       
  2797     }/*function_dint_to_real*/
       
  2798     break;
       
  2799 
       
  2800 /****
       
  2801  *DINT_TO_LREAL
       
  2802  */
       
  2803     case function_dint_to_lreal :
       
  2804     {
       
  2805         symbol_c *last_type_symbol = NULL;
       
  2806 
       
  2807         {
       
  2808             identifier_c param_name("IN");
       
  2809             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2810             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2811             
       
  2812             /* Get the value from a foo(<param_value>) style call */
       
  2813             if (IN_param_value == NULL)
       
  2814               IN_param_value = function_call_param_iterator.next();
       
  2815             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2816             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2817             
       
  2818             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  2819             {
       
  2820         
       
  2821                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  2822                 s4o.print("(");
       
  2823                 return_type_symbol->accept(*this);
       
  2824                 s4o.print(")");
       
  2825                 IN_param_value->accept(*this);
       
  2826                 return NULL;
       
  2827                 
       
  2828             }
       
  2829             
       
  2830             ERROR;
       
  2831         }
       
  2832         
       
  2833     }/*function_dint_to_lreal*/
       
  2834     break;
       
  2835 
       
  2836 /****
       
  2837  *DINT_TO_SINT
       
  2838  */
       
  2839     case function_dint_to_sint :
       
  2840     {
       
  2841         symbol_c *last_type_symbol = NULL;
       
  2842 
       
  2843         {
       
  2844             identifier_c param_name("IN");
       
  2845             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2846             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2847             
       
  2848             /* Get the value from a foo(<param_value>) style call */
       
  2849             if (IN_param_value == NULL)
       
  2850               IN_param_value = function_call_param_iterator.next();
       
  2851             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2852             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2853             
       
  2854             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  2855             {
       
  2856         
       
  2857                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  2858                 s4o.print("(");
       
  2859                 return_type_symbol->accept(*this);
       
  2860                 s4o.print(")");
       
  2861                 IN_param_value->accept(*this);
       
  2862                 return NULL;
       
  2863                 
       
  2864             }
       
  2865             
       
  2866             ERROR;
       
  2867         }
       
  2868         
       
  2869     }/*function_dint_to_sint*/
       
  2870     break;
       
  2871 
       
  2872 /****
       
  2873  *DINT_TO_INT
       
  2874  */
       
  2875     case function_dint_to_int :
       
  2876     {
       
  2877         symbol_c *last_type_symbol = NULL;
       
  2878 
       
  2879         {
       
  2880             identifier_c param_name("IN");
       
  2881             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2882             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2883             
       
  2884             /* Get the value from a foo(<param_value>) style call */
       
  2885             if (IN_param_value == NULL)
       
  2886               IN_param_value = function_call_param_iterator.next();
       
  2887             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2888             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2889             
       
  2890             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
   825             {
  2891             {
   826         
  2892         
   827                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
  2893                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
   828                 s4o.print("(");
  2894                 s4o.print("(");
   829                 return_type_symbol->accept(*this);
  2895                 return_type_symbol->accept(*this);
   834             }
  2900             }
   835             
  2901             
   836             ERROR;
  2902             ERROR;
   837         }
  2903         }
   838         
  2904         
   839     }/*function_lreal_to_int*/
  2905     }/*function_dint_to_int*/
   840     break;
  2906     break;
   841 
  2907 
   842 /****
  2908 /****
   843  *LREAL_TO_DINT
  2909  *DINT_TO_LINT
   844  */
  2910  */
   845     case function_lreal_to_dint :
  2911     case function_dint_to_lint :
   846     {
  2912     {
   847         symbol_c *last_type_symbol = NULL;
  2913         symbol_c *last_type_symbol = NULL;
   848 
  2914 
   849         {
  2915         {
   850             identifier_c param_name("IN");
  2916             identifier_c param_name("IN");
   851             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2917             /* Get the value from a foo(<param_name> = <param_value>) style call */
   852             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2918             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   853             
  2919             
   854             /* Get the value from a foo(<param_value>) style call */
  2920             /* Get the value from a foo(<param_value>) style call */
   855             if (IN_param_value == NULL)
  2921             if (IN_param_value == NULL)
   856               IN_param_value = function_call_param_iterator.next();
  2922               IN_param_value = function_call_param_iterator.next();
   857             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2923             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   858             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2924             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   859             
  2925             
   860             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
  2926             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  2927             {
       
  2928         
       
  2929                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  2930                 s4o.print("(");
       
  2931                 return_type_symbol->accept(*this);
       
  2932                 s4o.print(")");
       
  2933                 IN_param_value->accept(*this);
       
  2934                 return NULL;
       
  2935                 
       
  2936             }
       
  2937             
       
  2938             ERROR;
       
  2939         }
       
  2940         
       
  2941     }/*function_dint_to_lint*/
       
  2942     break;
       
  2943 
       
  2944 /****
       
  2945  *DINT_TO_USINT
       
  2946  */
       
  2947     case function_dint_to_usint :
       
  2948     {
       
  2949         symbol_c *last_type_symbol = NULL;
       
  2950 
       
  2951         {
       
  2952             identifier_c param_name("IN");
       
  2953             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2954             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2955             
       
  2956             /* Get the value from a foo(<param_value>) style call */
       
  2957             if (IN_param_value == NULL)
       
  2958               IN_param_value = function_call_param_iterator.next();
       
  2959             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2960             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2961             
       
  2962             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  2963             {
       
  2964         
       
  2965                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  2966                 s4o.print("(");
       
  2967                 return_type_symbol->accept(*this);
       
  2968                 s4o.print(")");
       
  2969                 IN_param_value->accept(*this);
       
  2970                 return NULL;
       
  2971                 
       
  2972             }
       
  2973             
       
  2974             ERROR;
       
  2975         }
       
  2976         
       
  2977     }/*function_dint_to_usint*/
       
  2978     break;
       
  2979 
       
  2980 /****
       
  2981  *DINT_TO_UINT
       
  2982  */
       
  2983     case function_dint_to_uint :
       
  2984     {
       
  2985         symbol_c *last_type_symbol = NULL;
       
  2986 
       
  2987         {
       
  2988             identifier_c param_name("IN");
       
  2989             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2990             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2991             
       
  2992             /* Get the value from a foo(<param_value>) style call */
       
  2993             if (IN_param_value == NULL)
       
  2994               IN_param_value = function_call_param_iterator.next();
       
  2995             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2996             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2997             
       
  2998             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  2999             {
       
  3000         
       
  3001                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  3002                 s4o.print("(");
       
  3003                 return_type_symbol->accept(*this);
       
  3004                 s4o.print(")");
       
  3005                 IN_param_value->accept(*this);
       
  3006                 return NULL;
       
  3007                 
       
  3008             }
       
  3009             
       
  3010             ERROR;
       
  3011         }
       
  3012         
       
  3013     }/*function_dint_to_uint*/
       
  3014     break;
       
  3015 
       
  3016 /****
       
  3017  *DINT_TO_UDINT
       
  3018  */
       
  3019     case function_dint_to_udint :
       
  3020     {
       
  3021         symbol_c *last_type_symbol = NULL;
       
  3022 
       
  3023         {
       
  3024             identifier_c param_name("IN");
       
  3025             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3026             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3027             
       
  3028             /* Get the value from a foo(<param_value>) style call */
       
  3029             if (IN_param_value == NULL)
       
  3030               IN_param_value = function_call_param_iterator.next();
       
  3031             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3032             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3033             
       
  3034             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3035             {
       
  3036         
       
  3037                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  3038                 s4o.print("(");
       
  3039                 return_type_symbol->accept(*this);
       
  3040                 s4o.print(")");
       
  3041                 IN_param_value->accept(*this);
       
  3042                 return NULL;
       
  3043                 
       
  3044             }
       
  3045             
       
  3046             ERROR;
       
  3047         }
       
  3048         
       
  3049     }/*function_dint_to_udint*/
       
  3050     break;
       
  3051 
       
  3052 /****
       
  3053  *DINT_TO_ULINT
       
  3054  */
       
  3055     case function_dint_to_ulint :
       
  3056     {
       
  3057         symbol_c *last_type_symbol = NULL;
       
  3058 
       
  3059         {
       
  3060             identifier_c param_name("IN");
       
  3061             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3062             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3063             
       
  3064             /* Get the value from a foo(<param_value>) style call */
       
  3065             if (IN_param_value == NULL)
       
  3066               IN_param_value = function_call_param_iterator.next();
       
  3067             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3068             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3069             
       
  3070             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3071             {
       
  3072         
       
  3073                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  3074                 s4o.print("(");
       
  3075                 return_type_symbol->accept(*this);
       
  3076                 s4o.print(")");
       
  3077                 IN_param_value->accept(*this);
       
  3078                 return NULL;
       
  3079                 
       
  3080             }
       
  3081             
       
  3082             ERROR;
       
  3083         }
       
  3084         
       
  3085     }/*function_dint_to_ulint*/
       
  3086     break;
       
  3087 
       
  3088 /****
       
  3089  *DINT_TO_TIME
       
  3090  */
       
  3091     case function_dint_to_time :
       
  3092     {
       
  3093         symbol_c *last_type_symbol = NULL;
       
  3094 
       
  3095         {
       
  3096             identifier_c param_name("IN");
       
  3097             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3098             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3099             
       
  3100             /* Get the value from a foo(<param_value>) style call */
       
  3101             if (IN_param_value == NULL)
       
  3102               IN_param_value = function_call_param_iterator.next();
       
  3103             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3104             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3105             
       
  3106             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3107             {
       
  3108         
       
  3109                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  3110                 s4o.print("(");
       
  3111                 return_type_symbol->accept(*this);
       
  3112                 s4o.print(")__int_to_time(");
       
  3113                 IN_param_value->accept(*this);
       
  3114                 s4o.print(")");
       
  3115                 return NULL;
       
  3116                 
       
  3117             }
       
  3118             
       
  3119             ERROR;
       
  3120         }
       
  3121         
       
  3122     }/*function_dint_to_time*/
       
  3123     break;
       
  3124 
       
  3125 /****
       
  3126  *DINT_TO_BOOL
       
  3127  */
       
  3128     case function_dint_to_bool :
       
  3129     {
       
  3130         symbol_c *last_type_symbol = NULL;
       
  3131 
       
  3132         {
       
  3133             identifier_c param_name("IN");
       
  3134             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3135             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3136             
       
  3137             /* Get the value from a foo(<param_value>) style call */
       
  3138             if (IN_param_value == NULL)
       
  3139               IN_param_value = function_call_param_iterator.next();
       
  3140             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3141             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3142             
       
  3143             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3144             {
       
  3145         
       
  3146                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  3147                 s4o.print("(");
       
  3148                 return_type_symbol->accept(*this);
       
  3149                 s4o.print(")");
       
  3150                 IN_param_value->accept(*this);
       
  3151                 return NULL;
       
  3152                 
       
  3153             }
       
  3154             
       
  3155             ERROR;
       
  3156         }
       
  3157         
       
  3158     }/*function_dint_to_bool*/
       
  3159     break;
       
  3160 
       
  3161 /****
       
  3162  *DINT_TO_BYTE
       
  3163  */
       
  3164     case function_dint_to_byte :
       
  3165     {
       
  3166         symbol_c *last_type_symbol = NULL;
       
  3167 
       
  3168         {
       
  3169             identifier_c param_name("IN");
       
  3170             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3171             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3172             
       
  3173             /* Get the value from a foo(<param_value>) style call */
       
  3174             if (IN_param_value == NULL)
       
  3175               IN_param_value = function_call_param_iterator.next();
       
  3176             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3177             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3178             
       
  3179             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3180             {
       
  3181         
       
  3182                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  3183                 s4o.print("(");
       
  3184                 return_type_symbol->accept(*this);
       
  3185                 s4o.print(")");
       
  3186                 IN_param_value->accept(*this);
       
  3187                 return NULL;
       
  3188                 
       
  3189             }
       
  3190             
       
  3191             ERROR;
       
  3192         }
       
  3193         
       
  3194     }/*function_dint_to_byte*/
       
  3195     break;
       
  3196 
       
  3197 /****
       
  3198  *DINT_TO_WORD
       
  3199  */
       
  3200     case function_dint_to_word :
       
  3201     {
       
  3202         symbol_c *last_type_symbol = NULL;
       
  3203 
       
  3204         {
       
  3205             identifier_c param_name("IN");
       
  3206             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3207             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3208             
       
  3209             /* Get the value from a foo(<param_value>) style call */
       
  3210             if (IN_param_value == NULL)
       
  3211               IN_param_value = function_call_param_iterator.next();
       
  3212             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3213             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3214             
       
  3215             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3216             {
       
  3217         
       
  3218                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  3219                 s4o.print("(");
       
  3220                 return_type_symbol->accept(*this);
       
  3221                 s4o.print(")");
       
  3222                 IN_param_value->accept(*this);
       
  3223                 return NULL;
       
  3224                 
       
  3225             }
       
  3226             
       
  3227             ERROR;
       
  3228         }
       
  3229         
       
  3230     }/*function_dint_to_word*/
       
  3231     break;
       
  3232 
       
  3233 /****
       
  3234  *DINT_TO_DWORD
       
  3235  */
       
  3236     case function_dint_to_dword :
       
  3237     {
       
  3238         symbol_c *last_type_symbol = NULL;
       
  3239 
       
  3240         {
       
  3241             identifier_c param_name("IN");
       
  3242             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3243             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3244             
       
  3245             /* Get the value from a foo(<param_value>) style call */
       
  3246             if (IN_param_value == NULL)
       
  3247               IN_param_value = function_call_param_iterator.next();
       
  3248             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3249             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3250             
       
  3251             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3252             {
       
  3253         
       
  3254                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  3255                 s4o.print("(");
       
  3256                 return_type_symbol->accept(*this);
       
  3257                 s4o.print(")");
       
  3258                 IN_param_value->accept(*this);
       
  3259                 return NULL;
       
  3260                 
       
  3261             }
       
  3262             
       
  3263             ERROR;
       
  3264         }
       
  3265         
       
  3266     }/*function_dint_to_dword*/
       
  3267     break;
       
  3268 
       
  3269 /****
       
  3270  *DINT_TO_LWORD
       
  3271  */
       
  3272     case function_dint_to_lword :
       
  3273     {
       
  3274         symbol_c *last_type_symbol = NULL;
       
  3275 
       
  3276         {
       
  3277             identifier_c param_name("IN");
       
  3278             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3279             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3280             
       
  3281             /* Get the value from a foo(<param_value>) style call */
       
  3282             if (IN_param_value == NULL)
       
  3283               IN_param_value = function_call_param_iterator.next();
       
  3284             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3285             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3286             
       
  3287             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3288             {
       
  3289         
       
  3290                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  3291                 s4o.print("(");
       
  3292                 return_type_symbol->accept(*this);
       
  3293                 s4o.print(")");
       
  3294                 IN_param_value->accept(*this);
       
  3295                 return NULL;
       
  3296                 
       
  3297             }
       
  3298             
       
  3299             ERROR;
       
  3300         }
       
  3301         
       
  3302     }/*function_dint_to_lword*/
       
  3303     break;
       
  3304 
       
  3305 /****
       
  3306  *DINT_TO_STRING
       
  3307  */
       
  3308     case function_dint_to_string :
       
  3309     {
       
  3310         symbol_c *last_type_symbol = NULL;
       
  3311 
       
  3312         {
       
  3313             identifier_c param_name("IN");
       
  3314             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3315             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3316             
       
  3317             /* Get the value from a foo(<param_value>) style call */
       
  3318             if (IN_param_value == NULL)
       
  3319               IN_param_value = function_call_param_iterator.next();
       
  3320             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3321             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3322             
       
  3323             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3324             {
       
  3325         
       
  3326                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  3327                 s4o.print("(");
       
  3328                 return_type_symbol->accept(*this);
       
  3329                 s4o.print(")__sint_to_string(");
       
  3330                 IN_param_value->accept(*this);
       
  3331                 s4o.print(")");
       
  3332                 return NULL;
       
  3333                 
       
  3334             }
       
  3335             
       
  3336             ERROR;
       
  3337         }
       
  3338         
       
  3339     }/*function_dint_to_string*/
       
  3340     break;
       
  3341 
       
  3342 /****
       
  3343  *DINT_TO_DATE
       
  3344  */
       
  3345     case function_dint_to_date :
       
  3346     {
       
  3347         symbol_c *last_type_symbol = NULL;
       
  3348 
       
  3349         {
       
  3350             identifier_c param_name("IN");
       
  3351             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3352             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3353             
       
  3354             /* Get the value from a foo(<param_value>) style call */
       
  3355             if (IN_param_value == NULL)
       
  3356               IN_param_value = function_call_param_iterator.next();
       
  3357             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3358             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3359             
       
  3360             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3361             {
       
  3362         
       
  3363                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  3364                 s4o.print("(");
       
  3365                 return_type_symbol->accept(*this);
       
  3366                 s4o.print(")__int_to_time(");
       
  3367                 IN_param_value->accept(*this);
       
  3368                 s4o.print(")");
       
  3369                 return NULL;
       
  3370                 
       
  3371             }
       
  3372             
       
  3373             ERROR;
       
  3374         }
       
  3375         
       
  3376     }/*function_dint_to_date*/
       
  3377     break;
       
  3378 
       
  3379 /****
       
  3380  *DINT_TO_TOD
       
  3381  */
       
  3382     case function_dint_to_tod :
       
  3383     {
       
  3384         symbol_c *last_type_symbol = NULL;
       
  3385 
       
  3386         {
       
  3387             identifier_c param_name("IN");
       
  3388             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3389             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3390             
       
  3391             /* Get the value from a foo(<param_value>) style call */
       
  3392             if (IN_param_value == NULL)
       
  3393               IN_param_value = function_call_param_iterator.next();
       
  3394             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3395             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3396             
       
  3397             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3398             {
       
  3399         
       
  3400                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  3401                 s4o.print("(");
       
  3402                 return_type_symbol->accept(*this);
       
  3403                 s4o.print(")__int_to_time(");
       
  3404                 IN_param_value->accept(*this);
       
  3405                 s4o.print(")");
       
  3406                 return NULL;
       
  3407                 
       
  3408             }
       
  3409             
       
  3410             ERROR;
       
  3411         }
       
  3412         
       
  3413     }/*function_dint_to_tod*/
       
  3414     break;
       
  3415 
       
  3416 /****
       
  3417  *DINT_TO_DT
       
  3418  */
       
  3419     case function_dint_to_dt :
       
  3420     {
       
  3421         symbol_c *last_type_symbol = NULL;
       
  3422 
       
  3423         {
       
  3424             identifier_c param_name("IN");
       
  3425             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3426             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3427             
       
  3428             /* Get the value from a foo(<param_value>) style call */
       
  3429             if (IN_param_value == NULL)
       
  3430               IN_param_value = function_call_param_iterator.next();
       
  3431             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3432             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3433             
       
  3434             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3435             {
       
  3436         
       
  3437                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  3438                 s4o.print("(");
       
  3439                 return_type_symbol->accept(*this);
       
  3440                 s4o.print(")__int_to_time(");
       
  3441                 IN_param_value->accept(*this);
       
  3442                 s4o.print(")");
       
  3443                 return NULL;
       
  3444                 
       
  3445             }
       
  3446             
       
  3447             ERROR;
       
  3448         }
       
  3449         
       
  3450     }/*function_dint_to_dt*/
       
  3451     break;
       
  3452 
       
  3453 /****
       
  3454  *LINT_TO_REAL
       
  3455  */
       
  3456     case function_lint_to_real :
       
  3457     {
       
  3458         symbol_c *last_type_symbol = NULL;
       
  3459 
       
  3460         {
       
  3461             identifier_c param_name("IN");
       
  3462             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3463             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3464             
       
  3465             /* Get the value from a foo(<param_value>) style call */
       
  3466             if (IN_param_value == NULL)
       
  3467               IN_param_value = function_call_param_iterator.next();
       
  3468             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3469             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3470             
       
  3471             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3472             {
       
  3473         
       
  3474                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  3475                 s4o.print("(");
       
  3476                 return_type_symbol->accept(*this);
       
  3477                 s4o.print(")");
       
  3478                 IN_param_value->accept(*this);
       
  3479                 return NULL;
       
  3480                 
       
  3481             }
       
  3482             
       
  3483             ERROR;
       
  3484         }
       
  3485         
       
  3486     }/*function_lint_to_real*/
       
  3487     break;
       
  3488 
       
  3489 /****
       
  3490  *LINT_TO_LREAL
       
  3491  */
       
  3492     case function_lint_to_lreal :
       
  3493     {
       
  3494         symbol_c *last_type_symbol = NULL;
       
  3495 
       
  3496         {
       
  3497             identifier_c param_name("IN");
       
  3498             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3499             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3500             
       
  3501             /* Get the value from a foo(<param_value>) style call */
       
  3502             if (IN_param_value == NULL)
       
  3503               IN_param_value = function_call_param_iterator.next();
       
  3504             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3505             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3506             
       
  3507             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3508             {
       
  3509         
       
  3510                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  3511                 s4o.print("(");
       
  3512                 return_type_symbol->accept(*this);
       
  3513                 s4o.print(")");
       
  3514                 IN_param_value->accept(*this);
       
  3515                 return NULL;
       
  3516                 
       
  3517             }
       
  3518             
       
  3519             ERROR;
       
  3520         }
       
  3521         
       
  3522     }/*function_lint_to_lreal*/
       
  3523     break;
       
  3524 
       
  3525 /****
       
  3526  *LINT_TO_SINT
       
  3527  */
       
  3528     case function_lint_to_sint :
       
  3529     {
       
  3530         symbol_c *last_type_symbol = NULL;
       
  3531 
       
  3532         {
       
  3533             identifier_c param_name("IN");
       
  3534             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3535             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3536             
       
  3537             /* Get the value from a foo(<param_value>) style call */
       
  3538             if (IN_param_value == NULL)
       
  3539               IN_param_value = function_call_param_iterator.next();
       
  3540             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3541             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3542             
       
  3543             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3544             {
       
  3545         
       
  3546                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  3547                 s4o.print("(");
       
  3548                 return_type_symbol->accept(*this);
       
  3549                 s4o.print(")");
       
  3550                 IN_param_value->accept(*this);
       
  3551                 return NULL;
       
  3552                 
       
  3553             }
       
  3554             
       
  3555             ERROR;
       
  3556         }
       
  3557         
       
  3558     }/*function_lint_to_sint*/
       
  3559     break;
       
  3560 
       
  3561 /****
       
  3562  *LINT_TO_INT
       
  3563  */
       
  3564     case function_lint_to_int :
       
  3565     {
       
  3566         symbol_c *last_type_symbol = NULL;
       
  3567 
       
  3568         {
       
  3569             identifier_c param_name("IN");
       
  3570             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3571             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3572             
       
  3573             /* Get the value from a foo(<param_value>) style call */
       
  3574             if (IN_param_value == NULL)
       
  3575               IN_param_value = function_call_param_iterator.next();
       
  3576             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3577             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3578             
       
  3579             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3580             {
       
  3581         
       
  3582                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  3583                 s4o.print("(");
       
  3584                 return_type_symbol->accept(*this);
       
  3585                 s4o.print(")");
       
  3586                 IN_param_value->accept(*this);
       
  3587                 return NULL;
       
  3588                 
       
  3589             }
       
  3590             
       
  3591             ERROR;
       
  3592         }
       
  3593         
       
  3594     }/*function_lint_to_int*/
       
  3595     break;
       
  3596 
       
  3597 /****
       
  3598  *LINT_TO_DINT
       
  3599  */
       
  3600     case function_lint_to_dint :
       
  3601     {
       
  3602         symbol_c *last_type_symbol = NULL;
       
  3603 
       
  3604         {
       
  3605             identifier_c param_name("IN");
       
  3606             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3607             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3608             
       
  3609             /* Get the value from a foo(<param_value>) style call */
       
  3610             if (IN_param_value == NULL)
       
  3611               IN_param_value = function_call_param_iterator.next();
       
  3612             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3613             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3614             
       
  3615             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
   861             {
  3616             {
   862         
  3617         
   863                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
  3618                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
   864                 s4o.print("(");
  3619                 s4o.print("(");
   865                 return_type_symbol->accept(*this);
  3620                 return_type_symbol->accept(*this);
   870             }
  3625             }
   871             
  3626             
   872             ERROR;
  3627             ERROR;
   873         }
  3628         }
   874         
  3629         
   875     }/*function_lreal_to_dint*/
  3630     }/*function_lint_to_dint*/
   876     break;
  3631     break;
   877 
  3632 
   878 /****
  3633 /****
   879  *LREAL_TO_LINT
  3634  *LINT_TO_USINT
   880  */
  3635  */
   881     case function_lreal_to_lint :
  3636     case function_lint_to_usint :
   882     {
  3637     {
   883         symbol_c *last_type_symbol = NULL;
  3638         symbol_c *last_type_symbol = NULL;
   884 
  3639 
   885         {
  3640         {
   886             identifier_c param_name("IN");
  3641             identifier_c param_name("IN");
   887             /* Get the value from a foo(<param_name> = <param_value>) style call */
  3642             /* Get the value from a foo(<param_name> = <param_value>) style call */
   888             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  3643             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   889             
  3644             
   890             /* Get the value from a foo(<param_value>) style call */
  3645             /* Get the value from a foo(<param_value>) style call */
   891             if (IN_param_value == NULL)
  3646             if (IN_param_value == NULL)
   892               IN_param_value = function_call_param_iterator.next();
  3647               IN_param_value = function_call_param_iterator.next();
   893             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  3648             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   894             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  3649             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   895             
  3650             
   896             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
  3651             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3652             {
       
  3653         
       
  3654                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  3655                 s4o.print("(");
       
  3656                 return_type_symbol->accept(*this);
       
  3657                 s4o.print(")");
       
  3658                 IN_param_value->accept(*this);
       
  3659                 return NULL;
       
  3660                 
       
  3661             }
       
  3662             
       
  3663             ERROR;
       
  3664         }
       
  3665         
       
  3666     }/*function_lint_to_usint*/
       
  3667     break;
       
  3668 
       
  3669 /****
       
  3670  *LINT_TO_UINT
       
  3671  */
       
  3672     case function_lint_to_uint :
       
  3673     {
       
  3674         symbol_c *last_type_symbol = NULL;
       
  3675 
       
  3676         {
       
  3677             identifier_c param_name("IN");
       
  3678             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3679             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3680             
       
  3681             /* Get the value from a foo(<param_value>) style call */
       
  3682             if (IN_param_value == NULL)
       
  3683               IN_param_value = function_call_param_iterator.next();
       
  3684             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3685             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3686             
       
  3687             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3688             {
       
  3689         
       
  3690                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  3691                 s4o.print("(");
       
  3692                 return_type_symbol->accept(*this);
       
  3693                 s4o.print(")");
       
  3694                 IN_param_value->accept(*this);
       
  3695                 return NULL;
       
  3696                 
       
  3697             }
       
  3698             
       
  3699             ERROR;
       
  3700         }
       
  3701         
       
  3702     }/*function_lint_to_uint*/
       
  3703     break;
       
  3704 
       
  3705 /****
       
  3706  *LINT_TO_UDINT
       
  3707  */
       
  3708     case function_lint_to_udint :
       
  3709     {
       
  3710         symbol_c *last_type_symbol = NULL;
       
  3711 
       
  3712         {
       
  3713             identifier_c param_name("IN");
       
  3714             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3715             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3716             
       
  3717             /* Get the value from a foo(<param_value>) style call */
       
  3718             if (IN_param_value == NULL)
       
  3719               IN_param_value = function_call_param_iterator.next();
       
  3720             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3721             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3722             
       
  3723             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3724             {
       
  3725         
       
  3726                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  3727                 s4o.print("(");
       
  3728                 return_type_symbol->accept(*this);
       
  3729                 s4o.print(")");
       
  3730                 IN_param_value->accept(*this);
       
  3731                 return NULL;
       
  3732                 
       
  3733             }
       
  3734             
       
  3735             ERROR;
       
  3736         }
       
  3737         
       
  3738     }/*function_lint_to_udint*/
       
  3739     break;
       
  3740 
       
  3741 /****
       
  3742  *LINT_TO_ULINT
       
  3743  */
       
  3744     case function_lint_to_ulint :
       
  3745     {
       
  3746         symbol_c *last_type_symbol = NULL;
       
  3747 
       
  3748         {
       
  3749             identifier_c param_name("IN");
       
  3750             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3751             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3752             
       
  3753             /* Get the value from a foo(<param_value>) style call */
       
  3754             if (IN_param_value == NULL)
       
  3755               IN_param_value = function_call_param_iterator.next();
       
  3756             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3757             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3758             
       
  3759             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3760             {
       
  3761         
       
  3762                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  3763                 s4o.print("(");
       
  3764                 return_type_symbol->accept(*this);
       
  3765                 s4o.print(")");
       
  3766                 IN_param_value->accept(*this);
       
  3767                 return NULL;
       
  3768                 
       
  3769             }
       
  3770             
       
  3771             ERROR;
       
  3772         }
       
  3773         
       
  3774     }/*function_lint_to_ulint*/
       
  3775     break;
       
  3776 
       
  3777 /****
       
  3778  *LINT_TO_TIME
       
  3779  */
       
  3780     case function_lint_to_time :
       
  3781     {
       
  3782         symbol_c *last_type_symbol = NULL;
       
  3783 
       
  3784         {
       
  3785             identifier_c param_name("IN");
       
  3786             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3787             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3788             
       
  3789             /* Get the value from a foo(<param_value>) style call */
       
  3790             if (IN_param_value == NULL)
       
  3791               IN_param_value = function_call_param_iterator.next();
       
  3792             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3793             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3794             
       
  3795             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3796             {
       
  3797         
       
  3798                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  3799                 s4o.print("(");
       
  3800                 return_type_symbol->accept(*this);
       
  3801                 s4o.print(")__int_to_time(");
       
  3802                 IN_param_value->accept(*this);
       
  3803                 s4o.print(")");
       
  3804                 return NULL;
       
  3805                 
       
  3806             }
       
  3807             
       
  3808             ERROR;
       
  3809         }
       
  3810         
       
  3811     }/*function_lint_to_time*/
       
  3812     break;
       
  3813 
       
  3814 /****
       
  3815  *LINT_TO_BOOL
       
  3816  */
       
  3817     case function_lint_to_bool :
       
  3818     {
       
  3819         symbol_c *last_type_symbol = NULL;
       
  3820 
       
  3821         {
       
  3822             identifier_c param_name("IN");
       
  3823             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3824             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3825             
       
  3826             /* Get the value from a foo(<param_value>) style call */
       
  3827             if (IN_param_value == NULL)
       
  3828               IN_param_value = function_call_param_iterator.next();
       
  3829             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3830             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3831             
       
  3832             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3833             {
       
  3834         
       
  3835                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  3836                 s4o.print("(");
       
  3837                 return_type_symbol->accept(*this);
       
  3838                 s4o.print(")");
       
  3839                 IN_param_value->accept(*this);
       
  3840                 return NULL;
       
  3841                 
       
  3842             }
       
  3843             
       
  3844             ERROR;
       
  3845         }
       
  3846         
       
  3847     }/*function_lint_to_bool*/
       
  3848     break;
       
  3849 
       
  3850 /****
       
  3851  *LINT_TO_BYTE
       
  3852  */
       
  3853     case function_lint_to_byte :
       
  3854     {
       
  3855         symbol_c *last_type_symbol = NULL;
       
  3856 
       
  3857         {
       
  3858             identifier_c param_name("IN");
       
  3859             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3860             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3861             
       
  3862             /* Get the value from a foo(<param_value>) style call */
       
  3863             if (IN_param_value == NULL)
       
  3864               IN_param_value = function_call_param_iterator.next();
       
  3865             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3866             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3867             
       
  3868             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3869             {
       
  3870         
       
  3871                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  3872                 s4o.print("(");
       
  3873                 return_type_symbol->accept(*this);
       
  3874                 s4o.print(")");
       
  3875                 IN_param_value->accept(*this);
       
  3876                 return NULL;
       
  3877                 
       
  3878             }
       
  3879             
       
  3880             ERROR;
       
  3881         }
       
  3882         
       
  3883     }/*function_lint_to_byte*/
       
  3884     break;
       
  3885 
       
  3886 /****
       
  3887  *LINT_TO_WORD
       
  3888  */
       
  3889     case function_lint_to_word :
       
  3890     {
       
  3891         symbol_c *last_type_symbol = NULL;
       
  3892 
       
  3893         {
       
  3894             identifier_c param_name("IN");
       
  3895             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3896             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3897             
       
  3898             /* Get the value from a foo(<param_value>) style call */
       
  3899             if (IN_param_value == NULL)
       
  3900               IN_param_value = function_call_param_iterator.next();
       
  3901             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3902             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3903             
       
  3904             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3905             {
       
  3906         
       
  3907                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  3908                 s4o.print("(");
       
  3909                 return_type_symbol->accept(*this);
       
  3910                 s4o.print(")");
       
  3911                 IN_param_value->accept(*this);
       
  3912                 return NULL;
       
  3913                 
       
  3914             }
       
  3915             
       
  3916             ERROR;
       
  3917         }
       
  3918         
       
  3919     }/*function_lint_to_word*/
       
  3920     break;
       
  3921 
       
  3922 /****
       
  3923  *LINT_TO_DWORD
       
  3924  */
       
  3925     case function_lint_to_dword :
       
  3926     {
       
  3927         symbol_c *last_type_symbol = NULL;
       
  3928 
       
  3929         {
       
  3930             identifier_c param_name("IN");
       
  3931             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3932             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3933             
       
  3934             /* Get the value from a foo(<param_value>) style call */
       
  3935             if (IN_param_value == NULL)
       
  3936               IN_param_value = function_call_param_iterator.next();
       
  3937             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3938             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3939             
       
  3940             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3941             {
       
  3942         
       
  3943                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  3944                 s4o.print("(");
       
  3945                 return_type_symbol->accept(*this);
       
  3946                 s4o.print(")");
       
  3947                 IN_param_value->accept(*this);
       
  3948                 return NULL;
       
  3949                 
       
  3950             }
       
  3951             
       
  3952             ERROR;
       
  3953         }
       
  3954         
       
  3955     }/*function_lint_to_dword*/
       
  3956     break;
       
  3957 
       
  3958 /****
       
  3959  *LINT_TO_LWORD
       
  3960  */
       
  3961     case function_lint_to_lword :
       
  3962     {
       
  3963         symbol_c *last_type_symbol = NULL;
       
  3964 
       
  3965         {
       
  3966             identifier_c param_name("IN");
       
  3967             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3968             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3969             
       
  3970             /* Get the value from a foo(<param_value>) style call */
       
  3971             if (IN_param_value == NULL)
       
  3972               IN_param_value = function_call_param_iterator.next();
       
  3973             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3974             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3975             
       
  3976             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3977             {
       
  3978         
       
  3979                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  3980                 s4o.print("(");
       
  3981                 return_type_symbol->accept(*this);
       
  3982                 s4o.print(")");
       
  3983                 IN_param_value->accept(*this);
       
  3984                 return NULL;
       
  3985                 
       
  3986             }
       
  3987             
       
  3988             ERROR;
       
  3989         }
       
  3990         
       
  3991     }/*function_lint_to_lword*/
       
  3992     break;
       
  3993 
       
  3994 /****
       
  3995  *LINT_TO_STRING
       
  3996  */
       
  3997     case function_lint_to_string :
       
  3998     {
       
  3999         symbol_c *last_type_symbol = NULL;
       
  4000 
       
  4001         {
       
  4002             identifier_c param_name("IN");
       
  4003             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4004             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4005             
       
  4006             /* Get the value from a foo(<param_value>) style call */
       
  4007             if (IN_param_value == NULL)
       
  4008               IN_param_value = function_call_param_iterator.next();
       
  4009             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4010             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4011             
       
  4012             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  4013             {
       
  4014         
       
  4015                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  4016                 s4o.print("(");
       
  4017                 return_type_symbol->accept(*this);
       
  4018                 s4o.print(")__sint_to_string(");
       
  4019                 IN_param_value->accept(*this);
       
  4020                 s4o.print(")");
       
  4021                 return NULL;
       
  4022                 
       
  4023             }
       
  4024             
       
  4025             ERROR;
       
  4026         }
       
  4027         
       
  4028     }/*function_lint_to_string*/
       
  4029     break;
       
  4030 
       
  4031 /****
       
  4032  *LINT_TO_DATE
       
  4033  */
       
  4034     case function_lint_to_date :
       
  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 (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  4050             {
       
  4051         
       
  4052                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  4053                 s4o.print("(");
       
  4054                 return_type_symbol->accept(*this);
       
  4055                 s4o.print(")__int_to_time(");
       
  4056                 IN_param_value->accept(*this);
       
  4057                 s4o.print(")");
       
  4058                 return NULL;
       
  4059                 
       
  4060             }
       
  4061             
       
  4062             ERROR;
       
  4063         }
       
  4064         
       
  4065     }/*function_lint_to_date*/
       
  4066     break;
       
  4067 
       
  4068 /****
       
  4069  *LINT_TO_TOD
       
  4070  */
       
  4071     case function_lint_to_tod :
       
  4072     {
       
  4073         symbol_c *last_type_symbol = NULL;
       
  4074 
       
  4075         {
       
  4076             identifier_c param_name("IN");
       
  4077             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4078             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4079             
       
  4080             /* Get the value from a foo(<param_value>) style call */
       
  4081             if (IN_param_value == NULL)
       
  4082               IN_param_value = function_call_param_iterator.next();
       
  4083             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4084             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4085             
       
  4086             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  4087             {
       
  4088         
       
  4089                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  4090                 s4o.print("(");
       
  4091                 return_type_symbol->accept(*this);
       
  4092                 s4o.print(")__int_to_time(");
       
  4093                 IN_param_value->accept(*this);
       
  4094                 s4o.print(")");
       
  4095                 return NULL;
       
  4096                 
       
  4097             }
       
  4098             
       
  4099             ERROR;
       
  4100         }
       
  4101         
       
  4102     }/*function_lint_to_tod*/
       
  4103     break;
       
  4104 
       
  4105 /****
       
  4106  *LINT_TO_DT
       
  4107  */
       
  4108     case function_lint_to_dt :
       
  4109     {
       
  4110         symbol_c *last_type_symbol = NULL;
       
  4111 
       
  4112         {
       
  4113             identifier_c param_name("IN");
       
  4114             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4115             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4116             
       
  4117             /* Get the value from a foo(<param_value>) style call */
       
  4118             if (IN_param_value == NULL)
       
  4119               IN_param_value = function_call_param_iterator.next();
       
  4120             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4121             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4122             
       
  4123             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  4124             {
       
  4125         
       
  4126                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  4127                 s4o.print("(");
       
  4128                 return_type_symbol->accept(*this);
       
  4129                 s4o.print(")__int_to_time(");
       
  4130                 IN_param_value->accept(*this);
       
  4131                 s4o.print(")");
       
  4132                 return NULL;
       
  4133                 
       
  4134             }
       
  4135             
       
  4136             ERROR;
       
  4137         }
       
  4138         
       
  4139     }/*function_lint_to_dt*/
       
  4140     break;
       
  4141 
       
  4142 /****
       
  4143  *USINT_TO_REAL
       
  4144  */
       
  4145     case function_usint_to_real :
       
  4146     {
       
  4147         symbol_c *last_type_symbol = NULL;
       
  4148 
       
  4149         {
       
  4150             identifier_c param_name("IN");
       
  4151             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4152             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4153             
       
  4154             /* Get the value from a foo(<param_value>) style call */
       
  4155             if (IN_param_value == NULL)
       
  4156               IN_param_value = function_call_param_iterator.next();
       
  4157             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4158             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4159             
       
  4160             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4161             {
       
  4162         
       
  4163                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  4164                 s4o.print("(");
       
  4165                 return_type_symbol->accept(*this);
       
  4166                 s4o.print(")");
       
  4167                 IN_param_value->accept(*this);
       
  4168                 return NULL;
       
  4169                 
       
  4170             }
       
  4171             
       
  4172             ERROR;
       
  4173         }
       
  4174         
       
  4175     }/*function_usint_to_real*/
       
  4176     break;
       
  4177 
       
  4178 /****
       
  4179  *USINT_TO_LREAL
       
  4180  */
       
  4181     case function_usint_to_lreal :
       
  4182     {
       
  4183         symbol_c *last_type_symbol = NULL;
       
  4184 
       
  4185         {
       
  4186             identifier_c param_name("IN");
       
  4187             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4188             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4189             
       
  4190             /* Get the value from a foo(<param_value>) style call */
       
  4191             if (IN_param_value == NULL)
       
  4192               IN_param_value = function_call_param_iterator.next();
       
  4193             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4194             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4195             
       
  4196             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4197             {
       
  4198         
       
  4199                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  4200                 s4o.print("(");
       
  4201                 return_type_symbol->accept(*this);
       
  4202                 s4o.print(")");
       
  4203                 IN_param_value->accept(*this);
       
  4204                 return NULL;
       
  4205                 
       
  4206             }
       
  4207             
       
  4208             ERROR;
       
  4209         }
       
  4210         
       
  4211     }/*function_usint_to_lreal*/
       
  4212     break;
       
  4213 
       
  4214 /****
       
  4215  *USINT_TO_SINT
       
  4216  */
       
  4217     case function_usint_to_sint :
       
  4218     {
       
  4219         symbol_c *last_type_symbol = NULL;
       
  4220 
       
  4221         {
       
  4222             identifier_c param_name("IN");
       
  4223             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4224             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4225             
       
  4226             /* Get the value from a foo(<param_value>) style call */
       
  4227             if (IN_param_value == NULL)
       
  4228               IN_param_value = function_call_param_iterator.next();
       
  4229             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4230             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4231             
       
  4232             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4233             {
       
  4234         
       
  4235                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  4236                 s4o.print("(");
       
  4237                 return_type_symbol->accept(*this);
       
  4238                 s4o.print(")");
       
  4239                 IN_param_value->accept(*this);
       
  4240                 return NULL;
       
  4241                 
       
  4242             }
       
  4243             
       
  4244             ERROR;
       
  4245         }
       
  4246         
       
  4247     }/*function_usint_to_sint*/
       
  4248     break;
       
  4249 
       
  4250 /****
       
  4251  *USINT_TO_INT
       
  4252  */
       
  4253     case function_usint_to_int :
       
  4254     {
       
  4255         symbol_c *last_type_symbol = NULL;
       
  4256 
       
  4257         {
       
  4258             identifier_c param_name("IN");
       
  4259             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4260             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4261             
       
  4262             /* Get the value from a foo(<param_value>) style call */
       
  4263             if (IN_param_value == NULL)
       
  4264               IN_param_value = function_call_param_iterator.next();
       
  4265             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4266             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4267             
       
  4268             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4269             {
       
  4270         
       
  4271                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  4272                 s4o.print("(");
       
  4273                 return_type_symbol->accept(*this);
       
  4274                 s4o.print(")");
       
  4275                 IN_param_value->accept(*this);
       
  4276                 return NULL;
       
  4277                 
       
  4278             }
       
  4279             
       
  4280             ERROR;
       
  4281         }
       
  4282         
       
  4283     }/*function_usint_to_int*/
       
  4284     break;
       
  4285 
       
  4286 /****
       
  4287  *USINT_TO_DINT
       
  4288  */
       
  4289     case function_usint_to_dint :
       
  4290     {
       
  4291         symbol_c *last_type_symbol = NULL;
       
  4292 
       
  4293         {
       
  4294             identifier_c param_name("IN");
       
  4295             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4296             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4297             
       
  4298             /* Get the value from a foo(<param_value>) style call */
       
  4299             if (IN_param_value == NULL)
       
  4300               IN_param_value = function_call_param_iterator.next();
       
  4301             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4302             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4303             
       
  4304             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4305             {
       
  4306         
       
  4307                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  4308                 s4o.print("(");
       
  4309                 return_type_symbol->accept(*this);
       
  4310                 s4o.print(")");
       
  4311                 IN_param_value->accept(*this);
       
  4312                 return NULL;
       
  4313                 
       
  4314             }
       
  4315             
       
  4316             ERROR;
       
  4317         }
       
  4318         
       
  4319     }/*function_usint_to_dint*/
       
  4320     break;
       
  4321 
       
  4322 /****
       
  4323  *USINT_TO_LINT
       
  4324  */
       
  4325     case function_usint_to_lint :
       
  4326     {
       
  4327         symbol_c *last_type_symbol = NULL;
       
  4328 
       
  4329         {
       
  4330             identifier_c param_name("IN");
       
  4331             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4332             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4333             
       
  4334             /* Get the value from a foo(<param_value>) style call */
       
  4335             if (IN_param_value == NULL)
       
  4336               IN_param_value = function_call_param_iterator.next();
       
  4337             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4338             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4339             
       
  4340             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
   897             {
  4341             {
   898         
  4342         
   899                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
  4343                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
   900                 s4o.print("(");
  4344                 s4o.print("(");
   901                 return_type_symbol->accept(*this);
  4345                 return_type_symbol->accept(*this);
   906             }
  4350             }
   907             
  4351             
   908             ERROR;
  4352             ERROR;
   909         }
  4353         }
   910         
  4354         
   911     }/*function_lreal_to_lint*/
  4355     }/*function_usint_to_lint*/
   912     break;
  4356     break;
   913 
  4357 
   914 /****
  4358 /****
   915  *LREAL_TO_USINT
  4359  *USINT_TO_UINT
   916  */
  4360  */
   917     case function_lreal_to_usint :
  4361     case function_usint_to_uint :
   918     {
  4362     {
   919         symbol_c *last_type_symbol = NULL;
  4363         symbol_c *last_type_symbol = NULL;
   920 
  4364 
   921         {
  4365         {
   922             identifier_c param_name("IN");
  4366             identifier_c param_name("IN");
   923             /* Get the value from a foo(<param_name> = <param_value>) style call */
  4367             /* Get the value from a foo(<param_name> = <param_value>) style call */
   924             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  4368             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   925             
  4369             
   926             /* Get the value from a foo(<param_value>) style call */
  4370             /* Get the value from a foo(<param_value>) style call */
   927             if (IN_param_value == NULL)
  4371             if (IN_param_value == NULL)
   928               IN_param_value = function_call_param_iterator.next();
  4372               IN_param_value = function_call_param_iterator.next();
   929             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  4373             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   930             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  4374             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   931             
  4375             
   932             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
  4376             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4377             {
       
  4378         
       
  4379                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  4380                 s4o.print("(");
       
  4381                 return_type_symbol->accept(*this);
       
  4382                 s4o.print(")");
       
  4383                 IN_param_value->accept(*this);
       
  4384                 return NULL;
       
  4385                 
       
  4386             }
       
  4387             
       
  4388             ERROR;
       
  4389         }
       
  4390         
       
  4391     }/*function_usint_to_uint*/
       
  4392     break;
       
  4393 
       
  4394 /****
       
  4395  *USINT_TO_UDINT
       
  4396  */
       
  4397     case function_usint_to_udint :
       
  4398     {
       
  4399         symbol_c *last_type_symbol = NULL;
       
  4400 
       
  4401         {
       
  4402             identifier_c param_name("IN");
       
  4403             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4404             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4405             
       
  4406             /* Get the value from a foo(<param_value>) style call */
       
  4407             if (IN_param_value == NULL)
       
  4408               IN_param_value = function_call_param_iterator.next();
       
  4409             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4410             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4411             
       
  4412             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4413             {
       
  4414         
       
  4415                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  4416                 s4o.print("(");
       
  4417                 return_type_symbol->accept(*this);
       
  4418                 s4o.print(")");
       
  4419                 IN_param_value->accept(*this);
       
  4420                 return NULL;
       
  4421                 
       
  4422             }
       
  4423             
       
  4424             ERROR;
       
  4425         }
       
  4426         
       
  4427     }/*function_usint_to_udint*/
       
  4428     break;
       
  4429 
       
  4430 /****
       
  4431  *USINT_TO_ULINT
       
  4432  */
       
  4433     case function_usint_to_ulint :
       
  4434     {
       
  4435         symbol_c *last_type_symbol = NULL;
       
  4436 
       
  4437         {
       
  4438             identifier_c param_name("IN");
       
  4439             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4440             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4441             
       
  4442             /* Get the value from a foo(<param_value>) style call */
       
  4443             if (IN_param_value == NULL)
       
  4444               IN_param_value = function_call_param_iterator.next();
       
  4445             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4446             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4447             
       
  4448             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4449             {
       
  4450         
       
  4451                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  4452                 s4o.print("(");
       
  4453                 return_type_symbol->accept(*this);
       
  4454                 s4o.print(")");
       
  4455                 IN_param_value->accept(*this);
       
  4456                 return NULL;
       
  4457                 
       
  4458             }
       
  4459             
       
  4460             ERROR;
       
  4461         }
       
  4462         
       
  4463     }/*function_usint_to_ulint*/
       
  4464     break;
       
  4465 
       
  4466 /****
       
  4467  *USINT_TO_TIME
       
  4468  */
       
  4469     case function_usint_to_time :
       
  4470     {
       
  4471         symbol_c *last_type_symbol = NULL;
       
  4472 
       
  4473         {
       
  4474             identifier_c param_name("IN");
       
  4475             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4476             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4477             
       
  4478             /* Get the value from a foo(<param_value>) style call */
       
  4479             if (IN_param_value == NULL)
       
  4480               IN_param_value = function_call_param_iterator.next();
       
  4481             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4482             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4483             
       
  4484             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4485             {
       
  4486         
       
  4487                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  4488                 s4o.print("(");
       
  4489                 return_type_symbol->accept(*this);
       
  4490                 s4o.print(")__int_to_time(");
       
  4491                 IN_param_value->accept(*this);
       
  4492                 s4o.print(")");
       
  4493                 return NULL;
       
  4494                 
       
  4495             }
       
  4496             
       
  4497             ERROR;
       
  4498         }
       
  4499         
       
  4500     }/*function_usint_to_time*/
       
  4501     break;
       
  4502 
       
  4503 /****
       
  4504  *USINT_TO_BOOL
       
  4505  */
       
  4506     case function_usint_to_bool :
       
  4507     {
       
  4508         symbol_c *last_type_symbol = NULL;
       
  4509 
       
  4510         {
       
  4511             identifier_c param_name("IN");
       
  4512             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4513             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4514             
       
  4515             /* Get the value from a foo(<param_value>) style call */
       
  4516             if (IN_param_value == NULL)
       
  4517               IN_param_value = function_call_param_iterator.next();
       
  4518             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4519             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4520             
       
  4521             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4522             {
       
  4523         
       
  4524                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  4525                 s4o.print("(");
       
  4526                 return_type_symbol->accept(*this);
       
  4527                 s4o.print(")");
       
  4528                 IN_param_value->accept(*this);
       
  4529                 return NULL;
       
  4530                 
       
  4531             }
       
  4532             
       
  4533             ERROR;
       
  4534         }
       
  4535         
       
  4536     }/*function_usint_to_bool*/
       
  4537     break;
       
  4538 
       
  4539 /****
       
  4540  *USINT_TO_BYTE
       
  4541  */
       
  4542     case function_usint_to_byte :
       
  4543     {
       
  4544         symbol_c *last_type_symbol = NULL;
       
  4545 
       
  4546         {
       
  4547             identifier_c param_name("IN");
       
  4548             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4549             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4550             
       
  4551             /* Get the value from a foo(<param_value>) style call */
       
  4552             if (IN_param_value == NULL)
       
  4553               IN_param_value = function_call_param_iterator.next();
       
  4554             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4555             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4556             
       
  4557             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4558             {
       
  4559         
       
  4560                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  4561                 s4o.print("(");
       
  4562                 return_type_symbol->accept(*this);
       
  4563                 s4o.print(")");
       
  4564                 IN_param_value->accept(*this);
       
  4565                 return NULL;
       
  4566                 
       
  4567             }
       
  4568             
       
  4569             ERROR;
       
  4570         }
       
  4571         
       
  4572     }/*function_usint_to_byte*/
       
  4573     break;
       
  4574 
       
  4575 /****
       
  4576  *USINT_TO_WORD
       
  4577  */
       
  4578     case function_usint_to_word :
       
  4579     {
       
  4580         symbol_c *last_type_symbol = NULL;
       
  4581 
       
  4582         {
       
  4583             identifier_c param_name("IN");
       
  4584             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4585             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4586             
       
  4587             /* Get the value from a foo(<param_value>) style call */
       
  4588             if (IN_param_value == NULL)
       
  4589               IN_param_value = function_call_param_iterator.next();
       
  4590             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4591             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4592             
       
  4593             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4594             {
       
  4595         
       
  4596                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  4597                 s4o.print("(");
       
  4598                 return_type_symbol->accept(*this);
       
  4599                 s4o.print(")");
       
  4600                 IN_param_value->accept(*this);
       
  4601                 return NULL;
       
  4602                 
       
  4603             }
       
  4604             
       
  4605             ERROR;
       
  4606         }
       
  4607         
       
  4608     }/*function_usint_to_word*/
       
  4609     break;
       
  4610 
       
  4611 /****
       
  4612  *USINT_TO_DWORD
       
  4613  */
       
  4614     case function_usint_to_dword :
       
  4615     {
       
  4616         symbol_c *last_type_symbol = NULL;
       
  4617 
       
  4618         {
       
  4619             identifier_c param_name("IN");
       
  4620             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4621             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4622             
       
  4623             /* Get the value from a foo(<param_value>) style call */
       
  4624             if (IN_param_value == NULL)
       
  4625               IN_param_value = function_call_param_iterator.next();
       
  4626             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4627             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4628             
       
  4629             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4630             {
       
  4631         
       
  4632                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  4633                 s4o.print("(");
       
  4634                 return_type_symbol->accept(*this);
       
  4635                 s4o.print(")");
       
  4636                 IN_param_value->accept(*this);
       
  4637                 return NULL;
       
  4638                 
       
  4639             }
       
  4640             
       
  4641             ERROR;
       
  4642         }
       
  4643         
       
  4644     }/*function_usint_to_dword*/
       
  4645     break;
       
  4646 
       
  4647 /****
       
  4648  *USINT_TO_LWORD
       
  4649  */
       
  4650     case function_usint_to_lword :
       
  4651     {
       
  4652         symbol_c *last_type_symbol = NULL;
       
  4653 
       
  4654         {
       
  4655             identifier_c param_name("IN");
       
  4656             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4657             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4658             
       
  4659             /* Get the value from a foo(<param_value>) style call */
       
  4660             if (IN_param_value == NULL)
       
  4661               IN_param_value = function_call_param_iterator.next();
       
  4662             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4663             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4664             
       
  4665             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4666             {
       
  4667         
       
  4668                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  4669                 s4o.print("(");
       
  4670                 return_type_symbol->accept(*this);
       
  4671                 s4o.print(")");
       
  4672                 IN_param_value->accept(*this);
       
  4673                 return NULL;
       
  4674                 
       
  4675             }
       
  4676             
       
  4677             ERROR;
       
  4678         }
       
  4679         
       
  4680     }/*function_usint_to_lword*/
       
  4681     break;
       
  4682 
       
  4683 /****
       
  4684  *USINT_TO_STRING
       
  4685  */
       
  4686     case function_usint_to_string :
       
  4687     {
       
  4688         symbol_c *last_type_symbol = NULL;
       
  4689 
       
  4690         {
       
  4691             identifier_c param_name("IN");
       
  4692             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4693             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4694             
       
  4695             /* Get the value from a foo(<param_value>) style call */
       
  4696             if (IN_param_value == NULL)
       
  4697               IN_param_value = function_call_param_iterator.next();
       
  4698             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4699             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4700             
       
  4701             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4702             {
       
  4703         
       
  4704                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  4705                 s4o.print("(");
       
  4706                 return_type_symbol->accept(*this);
       
  4707                 s4o.print(")__uint_to_string(");
       
  4708                 IN_param_value->accept(*this);
       
  4709                 s4o.print(")");
       
  4710                 return NULL;
       
  4711                 
       
  4712             }
       
  4713             
       
  4714             ERROR;
       
  4715         }
       
  4716         
       
  4717     }/*function_usint_to_string*/
       
  4718     break;
       
  4719 
       
  4720 /****
       
  4721  *USINT_TO_DATE
       
  4722  */
       
  4723     case function_usint_to_date :
       
  4724     {
       
  4725         symbol_c *last_type_symbol = NULL;
       
  4726 
       
  4727         {
       
  4728             identifier_c param_name("IN");
       
  4729             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4730             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4731             
       
  4732             /* Get the value from a foo(<param_value>) style call */
       
  4733             if (IN_param_value == NULL)
       
  4734               IN_param_value = function_call_param_iterator.next();
       
  4735             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4736             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4737             
       
  4738             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4739             {
       
  4740         
       
  4741                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  4742                 s4o.print("(");
       
  4743                 return_type_symbol->accept(*this);
       
  4744                 s4o.print(")__int_to_time(");
       
  4745                 IN_param_value->accept(*this);
       
  4746                 s4o.print(")");
       
  4747                 return NULL;
       
  4748                 
       
  4749             }
       
  4750             
       
  4751             ERROR;
       
  4752         }
       
  4753         
       
  4754     }/*function_usint_to_date*/
       
  4755     break;
       
  4756 
       
  4757 /****
       
  4758  *USINT_TO_TOD
       
  4759  */
       
  4760     case function_usint_to_tod :
       
  4761     {
       
  4762         symbol_c *last_type_symbol = NULL;
       
  4763 
       
  4764         {
       
  4765             identifier_c param_name("IN");
       
  4766             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4767             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4768             
       
  4769             /* Get the value from a foo(<param_value>) style call */
       
  4770             if (IN_param_value == NULL)
       
  4771               IN_param_value = function_call_param_iterator.next();
       
  4772             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4773             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4774             
       
  4775             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4776             {
       
  4777         
       
  4778                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  4779                 s4o.print("(");
       
  4780                 return_type_symbol->accept(*this);
       
  4781                 s4o.print(")__int_to_time(");
       
  4782                 IN_param_value->accept(*this);
       
  4783                 s4o.print(")");
       
  4784                 return NULL;
       
  4785                 
       
  4786             }
       
  4787             
       
  4788             ERROR;
       
  4789         }
       
  4790         
       
  4791     }/*function_usint_to_tod*/
       
  4792     break;
       
  4793 
       
  4794 /****
       
  4795  *USINT_TO_DT
       
  4796  */
       
  4797     case function_usint_to_dt :
       
  4798     {
       
  4799         symbol_c *last_type_symbol = NULL;
       
  4800 
       
  4801         {
       
  4802             identifier_c param_name("IN");
       
  4803             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4804             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4805             
       
  4806             /* Get the value from a foo(<param_value>) style call */
       
  4807             if (IN_param_value == NULL)
       
  4808               IN_param_value = function_call_param_iterator.next();
       
  4809             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4810             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4811             
       
  4812             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4813             {
       
  4814         
       
  4815                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  4816                 s4o.print("(");
       
  4817                 return_type_symbol->accept(*this);
       
  4818                 s4o.print(")__int_to_time(");
       
  4819                 IN_param_value->accept(*this);
       
  4820                 s4o.print(")");
       
  4821                 return NULL;
       
  4822                 
       
  4823             }
       
  4824             
       
  4825             ERROR;
       
  4826         }
       
  4827         
       
  4828     }/*function_usint_to_dt*/
       
  4829     break;
       
  4830 
       
  4831 /****
       
  4832  *UINT_TO_REAL
       
  4833  */
       
  4834     case function_uint_to_real :
       
  4835     {
       
  4836         symbol_c *last_type_symbol = NULL;
       
  4837 
       
  4838         {
       
  4839             identifier_c param_name("IN");
       
  4840             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4841             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4842             
       
  4843             /* Get the value from a foo(<param_value>) style call */
       
  4844             if (IN_param_value == NULL)
       
  4845               IN_param_value = function_call_param_iterator.next();
       
  4846             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4847             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4848             
       
  4849             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  4850             {
       
  4851         
       
  4852                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  4853                 s4o.print("(");
       
  4854                 return_type_symbol->accept(*this);
       
  4855                 s4o.print(")");
       
  4856                 IN_param_value->accept(*this);
       
  4857                 return NULL;
       
  4858                 
       
  4859             }
       
  4860             
       
  4861             ERROR;
       
  4862         }
       
  4863         
       
  4864     }/*function_uint_to_real*/
       
  4865     break;
       
  4866 
       
  4867 /****
       
  4868  *UINT_TO_LREAL
       
  4869  */
       
  4870     case function_uint_to_lreal :
       
  4871     {
       
  4872         symbol_c *last_type_symbol = NULL;
       
  4873 
       
  4874         {
       
  4875             identifier_c param_name("IN");
       
  4876             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4877             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4878             
       
  4879             /* Get the value from a foo(<param_value>) style call */
       
  4880             if (IN_param_value == NULL)
       
  4881               IN_param_value = function_call_param_iterator.next();
       
  4882             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4883             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4884             
       
  4885             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  4886             {
       
  4887         
       
  4888                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  4889                 s4o.print("(");
       
  4890                 return_type_symbol->accept(*this);
       
  4891                 s4o.print(")");
       
  4892                 IN_param_value->accept(*this);
       
  4893                 return NULL;
       
  4894                 
       
  4895             }
       
  4896             
       
  4897             ERROR;
       
  4898         }
       
  4899         
       
  4900     }/*function_uint_to_lreal*/
       
  4901     break;
       
  4902 
       
  4903 /****
       
  4904  *UINT_TO_SINT
       
  4905  */
       
  4906     case function_uint_to_sint :
       
  4907     {
       
  4908         symbol_c *last_type_symbol = NULL;
       
  4909 
       
  4910         {
       
  4911             identifier_c param_name("IN");
       
  4912             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4913             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4914             
       
  4915             /* Get the value from a foo(<param_value>) style call */
       
  4916             if (IN_param_value == NULL)
       
  4917               IN_param_value = function_call_param_iterator.next();
       
  4918             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4919             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4920             
       
  4921             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  4922             {
       
  4923         
       
  4924                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  4925                 s4o.print("(");
       
  4926                 return_type_symbol->accept(*this);
       
  4927                 s4o.print(")");
       
  4928                 IN_param_value->accept(*this);
       
  4929                 return NULL;
       
  4930                 
       
  4931             }
       
  4932             
       
  4933             ERROR;
       
  4934         }
       
  4935         
       
  4936     }/*function_uint_to_sint*/
       
  4937     break;
       
  4938 
       
  4939 /****
       
  4940  *UINT_TO_INT
       
  4941  */
       
  4942     case function_uint_to_int :
       
  4943     {
       
  4944         symbol_c *last_type_symbol = NULL;
       
  4945 
       
  4946         {
       
  4947             identifier_c param_name("IN");
       
  4948             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4949             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4950             
       
  4951             /* Get the value from a foo(<param_value>) style call */
       
  4952             if (IN_param_value == NULL)
       
  4953               IN_param_value = function_call_param_iterator.next();
       
  4954             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4955             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4956             
       
  4957             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  4958             {
       
  4959         
       
  4960                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  4961                 s4o.print("(");
       
  4962                 return_type_symbol->accept(*this);
       
  4963                 s4o.print(")");
       
  4964                 IN_param_value->accept(*this);
       
  4965                 return NULL;
       
  4966                 
       
  4967             }
       
  4968             
       
  4969             ERROR;
       
  4970         }
       
  4971         
       
  4972     }/*function_uint_to_int*/
       
  4973     break;
       
  4974 
       
  4975 /****
       
  4976  *UINT_TO_DINT
       
  4977  */
       
  4978     case function_uint_to_dint :
       
  4979     {
       
  4980         symbol_c *last_type_symbol = NULL;
       
  4981 
       
  4982         {
       
  4983             identifier_c param_name("IN");
       
  4984             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4985             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4986             
       
  4987             /* Get the value from a foo(<param_value>) style call */
       
  4988             if (IN_param_value == NULL)
       
  4989               IN_param_value = function_call_param_iterator.next();
       
  4990             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4991             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4992             
       
  4993             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  4994             {
       
  4995         
       
  4996                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  4997                 s4o.print("(");
       
  4998                 return_type_symbol->accept(*this);
       
  4999                 s4o.print(")");
       
  5000                 IN_param_value->accept(*this);
       
  5001                 return NULL;
       
  5002                 
       
  5003             }
       
  5004             
       
  5005             ERROR;
       
  5006         }
       
  5007         
       
  5008     }/*function_uint_to_dint*/
       
  5009     break;
       
  5010 
       
  5011 /****
       
  5012  *UINT_TO_LINT
       
  5013  */
       
  5014     case function_uint_to_lint :
       
  5015     {
       
  5016         symbol_c *last_type_symbol = NULL;
       
  5017 
       
  5018         {
       
  5019             identifier_c param_name("IN");
       
  5020             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5021             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5022             
       
  5023             /* Get the value from a foo(<param_value>) style call */
       
  5024             if (IN_param_value == NULL)
       
  5025               IN_param_value = function_call_param_iterator.next();
       
  5026             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5027             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5028             
       
  5029             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5030             {
       
  5031         
       
  5032                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  5033                 s4o.print("(");
       
  5034                 return_type_symbol->accept(*this);
       
  5035                 s4o.print(")");
       
  5036                 IN_param_value->accept(*this);
       
  5037                 return NULL;
       
  5038                 
       
  5039             }
       
  5040             
       
  5041             ERROR;
       
  5042         }
       
  5043         
       
  5044     }/*function_uint_to_lint*/
       
  5045     break;
       
  5046 
       
  5047 /****
       
  5048  *UINT_TO_USINT
       
  5049  */
       
  5050     case function_uint_to_usint :
       
  5051     {
       
  5052         symbol_c *last_type_symbol = NULL;
       
  5053 
       
  5054         {
       
  5055             identifier_c param_name("IN");
       
  5056             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5057             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5058             
       
  5059             /* Get the value from a foo(<param_value>) style call */
       
  5060             if (IN_param_value == NULL)
       
  5061               IN_param_value = function_call_param_iterator.next();
       
  5062             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5063             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5064             
       
  5065             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
   933             {
  5066             {
   934         
  5067         
   935                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
  5068                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
   936                 s4o.print("(");
  5069                 s4o.print("(");
   937                 return_type_symbol->accept(*this);
  5070                 return_type_symbol->accept(*this);
   942             }
  5075             }
   943             
  5076             
   944             ERROR;
  5077             ERROR;
   945         }
  5078         }
   946         
  5079         
   947     }/*function_lreal_to_usint*/
  5080     }/*function_uint_to_usint*/
   948     break;
  5081     break;
   949 
  5082 
   950 /****
  5083 /****
   951  *LREAL_TO_UINT
  5084  *UINT_TO_UDINT
   952  */
  5085  */
   953     case function_lreal_to_uint :
  5086     case function_uint_to_udint :
   954     {
  5087     {
   955         symbol_c *last_type_symbol = NULL;
  5088         symbol_c *last_type_symbol = NULL;
   956 
  5089 
   957         {
  5090         {
   958             identifier_c param_name("IN");
  5091             identifier_c param_name("IN");
   959             /* Get the value from a foo(<param_name> = <param_value>) style call */
  5092             /* Get the value from a foo(<param_name> = <param_value>) style call */
   960             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  5093             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   961             
  5094             
   962             /* Get the value from a foo(<param_value>) style call */
  5095             /* Get the value from a foo(<param_value>) style call */
   963             if (IN_param_value == NULL)
  5096             if (IN_param_value == NULL)
   964               IN_param_value = function_call_param_iterator.next();
  5097               IN_param_value = function_call_param_iterator.next();
   965             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  5098             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
   966             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  5099             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
   967             
  5100             
   968             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
  5101             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5102             {
       
  5103         
       
  5104                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  5105                 s4o.print("(");
       
  5106                 return_type_symbol->accept(*this);
       
  5107                 s4o.print(")");
       
  5108                 IN_param_value->accept(*this);
       
  5109                 return NULL;
       
  5110                 
       
  5111             }
       
  5112             
       
  5113             ERROR;
       
  5114         }
       
  5115         
       
  5116     }/*function_uint_to_udint*/
       
  5117     break;
       
  5118 
       
  5119 /****
       
  5120  *UINT_TO_ULINT
       
  5121  */
       
  5122     case function_uint_to_ulint :
       
  5123     {
       
  5124         symbol_c *last_type_symbol = NULL;
       
  5125 
       
  5126         {
       
  5127             identifier_c param_name("IN");
       
  5128             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5129             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5130             
       
  5131             /* Get the value from a foo(<param_value>) style call */
       
  5132             if (IN_param_value == NULL)
       
  5133               IN_param_value = function_call_param_iterator.next();
       
  5134             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5135             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5136             
       
  5137             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5138             {
       
  5139         
       
  5140                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  5141                 s4o.print("(");
       
  5142                 return_type_symbol->accept(*this);
       
  5143                 s4o.print(")");
       
  5144                 IN_param_value->accept(*this);
       
  5145                 return NULL;
       
  5146                 
       
  5147             }
       
  5148             
       
  5149             ERROR;
       
  5150         }
       
  5151         
       
  5152     }/*function_uint_to_ulint*/
       
  5153     break;
       
  5154 
       
  5155 /****
       
  5156  *UINT_TO_TIME
       
  5157  */
       
  5158     case function_uint_to_time :
       
  5159     {
       
  5160         symbol_c *last_type_symbol = NULL;
       
  5161 
       
  5162         {
       
  5163             identifier_c param_name("IN");
       
  5164             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5165             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5166             
       
  5167             /* Get the value from a foo(<param_value>) style call */
       
  5168             if (IN_param_value == NULL)
       
  5169               IN_param_value = function_call_param_iterator.next();
       
  5170             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5171             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5172             
       
  5173             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5174             {
       
  5175         
       
  5176                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  5177                 s4o.print("(");
       
  5178                 return_type_symbol->accept(*this);
       
  5179                 s4o.print(")__int_to_time(");
       
  5180                 IN_param_value->accept(*this);
       
  5181                 s4o.print(")");
       
  5182                 return NULL;
       
  5183                 
       
  5184             }
       
  5185             
       
  5186             ERROR;
       
  5187         }
       
  5188         
       
  5189     }/*function_uint_to_time*/
       
  5190     break;
       
  5191 
       
  5192 /****
       
  5193  *UINT_TO_BOOL
       
  5194  */
       
  5195     case function_uint_to_bool :
       
  5196     {
       
  5197         symbol_c *last_type_symbol = NULL;
       
  5198 
       
  5199         {
       
  5200             identifier_c param_name("IN");
       
  5201             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5202             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5203             
       
  5204             /* Get the value from a foo(<param_value>) style call */
       
  5205             if (IN_param_value == NULL)
       
  5206               IN_param_value = function_call_param_iterator.next();
       
  5207             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5208             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5209             
       
  5210             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5211             {
       
  5212         
       
  5213                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  5214                 s4o.print("(");
       
  5215                 return_type_symbol->accept(*this);
       
  5216                 s4o.print(")");
       
  5217                 IN_param_value->accept(*this);
       
  5218                 return NULL;
       
  5219                 
       
  5220             }
       
  5221             
       
  5222             ERROR;
       
  5223         }
       
  5224         
       
  5225     }/*function_uint_to_bool*/
       
  5226     break;
       
  5227 
       
  5228 /****
       
  5229  *UINT_TO_BYTE
       
  5230  */
       
  5231     case function_uint_to_byte :
       
  5232     {
       
  5233         symbol_c *last_type_symbol = NULL;
       
  5234 
       
  5235         {
       
  5236             identifier_c param_name("IN");
       
  5237             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5238             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5239             
       
  5240             /* Get the value from a foo(<param_value>) style call */
       
  5241             if (IN_param_value == NULL)
       
  5242               IN_param_value = function_call_param_iterator.next();
       
  5243             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5244             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5245             
       
  5246             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5247             {
       
  5248         
       
  5249                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  5250                 s4o.print("(");
       
  5251                 return_type_symbol->accept(*this);
       
  5252                 s4o.print(")");
       
  5253                 IN_param_value->accept(*this);
       
  5254                 return NULL;
       
  5255                 
       
  5256             }
       
  5257             
       
  5258             ERROR;
       
  5259         }
       
  5260         
       
  5261     }/*function_uint_to_byte*/
       
  5262     break;
       
  5263 
       
  5264 /****
       
  5265  *UINT_TO_WORD
       
  5266  */
       
  5267     case function_uint_to_word :
       
  5268     {
       
  5269         symbol_c *last_type_symbol = NULL;
       
  5270 
       
  5271         {
       
  5272             identifier_c param_name("IN");
       
  5273             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5274             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5275             
       
  5276             /* Get the value from a foo(<param_value>) style call */
       
  5277             if (IN_param_value == NULL)
       
  5278               IN_param_value = function_call_param_iterator.next();
       
  5279             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5280             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5281             
       
  5282             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5283             {
       
  5284         
       
  5285                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  5286                 s4o.print("(");
       
  5287                 return_type_symbol->accept(*this);
       
  5288                 s4o.print(")");
       
  5289                 IN_param_value->accept(*this);
       
  5290                 return NULL;
       
  5291                 
       
  5292             }
       
  5293             
       
  5294             ERROR;
       
  5295         }
       
  5296         
       
  5297     }/*function_uint_to_word*/
       
  5298     break;
       
  5299 
       
  5300 /****
       
  5301  *UINT_TO_DWORD
       
  5302  */
       
  5303     case function_uint_to_dword :
       
  5304     {
       
  5305         symbol_c *last_type_symbol = NULL;
       
  5306 
       
  5307         {
       
  5308             identifier_c param_name("IN");
       
  5309             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5310             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5311             
       
  5312             /* Get the value from a foo(<param_value>) style call */
       
  5313             if (IN_param_value == NULL)
       
  5314               IN_param_value = function_call_param_iterator.next();
       
  5315             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5316             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5317             
       
  5318             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5319             {
       
  5320         
       
  5321                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  5322                 s4o.print("(");
       
  5323                 return_type_symbol->accept(*this);
       
  5324                 s4o.print(")");
       
  5325                 IN_param_value->accept(*this);
       
  5326                 return NULL;
       
  5327                 
       
  5328             }
       
  5329             
       
  5330             ERROR;
       
  5331         }
       
  5332         
       
  5333     }/*function_uint_to_dword*/
       
  5334     break;
       
  5335 
       
  5336 /****
       
  5337  *UINT_TO_LWORD
       
  5338  */
       
  5339     case function_uint_to_lword :
       
  5340     {
       
  5341         symbol_c *last_type_symbol = NULL;
       
  5342 
       
  5343         {
       
  5344             identifier_c param_name("IN");
       
  5345             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5346             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5347             
       
  5348             /* Get the value from a foo(<param_value>) style call */
       
  5349             if (IN_param_value == NULL)
       
  5350               IN_param_value = function_call_param_iterator.next();
       
  5351             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5352             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5353             
       
  5354             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5355             {
       
  5356         
       
  5357                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  5358                 s4o.print("(");
       
  5359                 return_type_symbol->accept(*this);
       
  5360                 s4o.print(")");
       
  5361                 IN_param_value->accept(*this);
       
  5362                 return NULL;
       
  5363                 
       
  5364             }
       
  5365             
       
  5366             ERROR;
       
  5367         }
       
  5368         
       
  5369     }/*function_uint_to_lword*/
       
  5370     break;
       
  5371 
       
  5372 /****
       
  5373  *UINT_TO_STRING
       
  5374  */
       
  5375     case function_uint_to_string :
       
  5376     {
       
  5377         symbol_c *last_type_symbol = NULL;
       
  5378 
       
  5379         {
       
  5380             identifier_c param_name("IN");
       
  5381             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5382             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5383             
       
  5384             /* Get the value from a foo(<param_value>) style call */
       
  5385             if (IN_param_value == NULL)
       
  5386               IN_param_value = function_call_param_iterator.next();
       
  5387             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5388             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5389             
       
  5390             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5391             {
       
  5392         
       
  5393                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  5394                 s4o.print("(");
       
  5395                 return_type_symbol->accept(*this);
       
  5396                 s4o.print(")__uint_to_string(");
       
  5397                 IN_param_value->accept(*this);
       
  5398                 s4o.print(")");
       
  5399                 return NULL;
       
  5400                 
       
  5401             }
       
  5402             
       
  5403             ERROR;
       
  5404         }
       
  5405         
       
  5406     }/*function_uint_to_string*/
       
  5407     break;
       
  5408 
       
  5409 /****
       
  5410  *UINT_TO_DATE
       
  5411  */
       
  5412     case function_uint_to_date :
       
  5413     {
       
  5414         symbol_c *last_type_symbol = NULL;
       
  5415 
       
  5416         {
       
  5417             identifier_c param_name("IN");
       
  5418             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5419             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5420             
       
  5421             /* Get the value from a foo(<param_value>) style call */
       
  5422             if (IN_param_value == NULL)
       
  5423               IN_param_value = function_call_param_iterator.next();
       
  5424             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5425             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5426             
       
  5427             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5428             {
       
  5429         
       
  5430                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  5431                 s4o.print("(");
       
  5432                 return_type_symbol->accept(*this);
       
  5433                 s4o.print(")__int_to_time(");
       
  5434                 IN_param_value->accept(*this);
       
  5435                 s4o.print(")");
       
  5436                 return NULL;
       
  5437                 
       
  5438             }
       
  5439             
       
  5440             ERROR;
       
  5441         }
       
  5442         
       
  5443     }/*function_uint_to_date*/
       
  5444     break;
       
  5445 
       
  5446 /****
       
  5447  *UINT_TO_TOD
       
  5448  */
       
  5449     case function_uint_to_tod :
       
  5450     {
       
  5451         symbol_c *last_type_symbol = NULL;
       
  5452 
       
  5453         {
       
  5454             identifier_c param_name("IN");
       
  5455             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5456             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5457             
       
  5458             /* Get the value from a foo(<param_value>) style call */
       
  5459             if (IN_param_value == NULL)
       
  5460               IN_param_value = function_call_param_iterator.next();
       
  5461             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5462             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5463             
       
  5464             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5465             {
       
  5466         
       
  5467                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  5468                 s4o.print("(");
       
  5469                 return_type_symbol->accept(*this);
       
  5470                 s4o.print(")__int_to_time(");
       
  5471                 IN_param_value->accept(*this);
       
  5472                 s4o.print(")");
       
  5473                 return NULL;
       
  5474                 
       
  5475             }
       
  5476             
       
  5477             ERROR;
       
  5478         }
       
  5479         
       
  5480     }/*function_uint_to_tod*/
       
  5481     break;
       
  5482 
       
  5483 /****
       
  5484  *UINT_TO_DT
       
  5485  */
       
  5486     case function_uint_to_dt :
       
  5487     {
       
  5488         symbol_c *last_type_symbol = NULL;
       
  5489 
       
  5490         {
       
  5491             identifier_c param_name("IN");
       
  5492             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5493             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5494             
       
  5495             /* Get the value from a foo(<param_value>) style call */
       
  5496             if (IN_param_value == NULL)
       
  5497               IN_param_value = function_call_param_iterator.next();
       
  5498             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5499             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5500             
       
  5501             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5502             {
       
  5503         
       
  5504                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  5505                 s4o.print("(");
       
  5506                 return_type_symbol->accept(*this);
       
  5507                 s4o.print(")__int_to_time(");
       
  5508                 IN_param_value->accept(*this);
       
  5509                 s4o.print(")");
       
  5510                 return NULL;
       
  5511                 
       
  5512             }
       
  5513             
       
  5514             ERROR;
       
  5515         }
       
  5516         
       
  5517     }/*function_uint_to_dt*/
       
  5518     break;
       
  5519 
       
  5520 /****
       
  5521  *UDINT_TO_REAL
       
  5522  */
       
  5523     case function_udint_to_real :
       
  5524     {
       
  5525         symbol_c *last_type_symbol = NULL;
       
  5526 
       
  5527         {
       
  5528             identifier_c param_name("IN");
       
  5529             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5530             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5531             
       
  5532             /* Get the value from a foo(<param_value>) style call */
       
  5533             if (IN_param_value == NULL)
       
  5534               IN_param_value = function_call_param_iterator.next();
       
  5535             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5536             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5537             
       
  5538             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5539             {
       
  5540         
       
  5541                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  5542                 s4o.print("(");
       
  5543                 return_type_symbol->accept(*this);
       
  5544                 s4o.print(")");
       
  5545                 IN_param_value->accept(*this);
       
  5546                 return NULL;
       
  5547                 
       
  5548             }
       
  5549             
       
  5550             ERROR;
       
  5551         }
       
  5552         
       
  5553     }/*function_udint_to_real*/
       
  5554     break;
       
  5555 
       
  5556 /****
       
  5557  *UDINT_TO_LREAL
       
  5558  */
       
  5559     case function_udint_to_lreal :
       
  5560     {
       
  5561         symbol_c *last_type_symbol = NULL;
       
  5562 
       
  5563         {
       
  5564             identifier_c param_name("IN");
       
  5565             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5566             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5567             
       
  5568             /* Get the value from a foo(<param_value>) style call */
       
  5569             if (IN_param_value == NULL)
       
  5570               IN_param_value = function_call_param_iterator.next();
       
  5571             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5572             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5573             
       
  5574             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5575             {
       
  5576         
       
  5577                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  5578                 s4o.print("(");
       
  5579                 return_type_symbol->accept(*this);
       
  5580                 s4o.print(")");
       
  5581                 IN_param_value->accept(*this);
       
  5582                 return NULL;
       
  5583                 
       
  5584             }
       
  5585             
       
  5586             ERROR;
       
  5587         }
       
  5588         
       
  5589     }/*function_udint_to_lreal*/
       
  5590     break;
       
  5591 
       
  5592 /****
       
  5593  *UDINT_TO_SINT
       
  5594  */
       
  5595     case function_udint_to_sint :
       
  5596     {
       
  5597         symbol_c *last_type_symbol = NULL;
       
  5598 
       
  5599         {
       
  5600             identifier_c param_name("IN");
       
  5601             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5602             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5603             
       
  5604             /* Get the value from a foo(<param_value>) style call */
       
  5605             if (IN_param_value == NULL)
       
  5606               IN_param_value = function_call_param_iterator.next();
       
  5607             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5608             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5609             
       
  5610             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5611             {
       
  5612         
       
  5613                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  5614                 s4o.print("(");
       
  5615                 return_type_symbol->accept(*this);
       
  5616                 s4o.print(")");
       
  5617                 IN_param_value->accept(*this);
       
  5618                 return NULL;
       
  5619                 
       
  5620             }
       
  5621             
       
  5622             ERROR;
       
  5623         }
       
  5624         
       
  5625     }/*function_udint_to_sint*/
       
  5626     break;
       
  5627 
       
  5628 /****
       
  5629  *UDINT_TO_INT
       
  5630  */
       
  5631     case function_udint_to_int :
       
  5632     {
       
  5633         symbol_c *last_type_symbol = NULL;
       
  5634 
       
  5635         {
       
  5636             identifier_c param_name("IN");
       
  5637             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5638             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5639             
       
  5640             /* Get the value from a foo(<param_value>) style call */
       
  5641             if (IN_param_value == NULL)
       
  5642               IN_param_value = function_call_param_iterator.next();
       
  5643             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5644             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5645             
       
  5646             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5647             {
       
  5648         
       
  5649                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  5650                 s4o.print("(");
       
  5651                 return_type_symbol->accept(*this);
       
  5652                 s4o.print(")");
       
  5653                 IN_param_value->accept(*this);
       
  5654                 return NULL;
       
  5655                 
       
  5656             }
       
  5657             
       
  5658             ERROR;
       
  5659         }
       
  5660         
       
  5661     }/*function_udint_to_int*/
       
  5662     break;
       
  5663 
       
  5664 /****
       
  5665  *UDINT_TO_DINT
       
  5666  */
       
  5667     case function_udint_to_dint :
       
  5668     {
       
  5669         symbol_c *last_type_symbol = NULL;
       
  5670 
       
  5671         {
       
  5672             identifier_c param_name("IN");
       
  5673             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5674             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5675             
       
  5676             /* Get the value from a foo(<param_value>) style call */
       
  5677             if (IN_param_value == NULL)
       
  5678               IN_param_value = function_call_param_iterator.next();
       
  5679             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5680             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5681             
       
  5682             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5683             {
       
  5684         
       
  5685                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  5686                 s4o.print("(");
       
  5687                 return_type_symbol->accept(*this);
       
  5688                 s4o.print(")");
       
  5689                 IN_param_value->accept(*this);
       
  5690                 return NULL;
       
  5691                 
       
  5692             }
       
  5693             
       
  5694             ERROR;
       
  5695         }
       
  5696         
       
  5697     }/*function_udint_to_dint*/
       
  5698     break;
       
  5699 
       
  5700 /****
       
  5701  *UDINT_TO_LINT
       
  5702  */
       
  5703     case function_udint_to_lint :
       
  5704     {
       
  5705         symbol_c *last_type_symbol = NULL;
       
  5706 
       
  5707         {
       
  5708             identifier_c param_name("IN");
       
  5709             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5710             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5711             
       
  5712             /* Get the value from a foo(<param_value>) style call */
       
  5713             if (IN_param_value == NULL)
       
  5714               IN_param_value = function_call_param_iterator.next();
       
  5715             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5716             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5717             
       
  5718             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5719             {
       
  5720         
       
  5721                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  5722                 s4o.print("(");
       
  5723                 return_type_symbol->accept(*this);
       
  5724                 s4o.print(")");
       
  5725                 IN_param_value->accept(*this);
       
  5726                 return NULL;
       
  5727                 
       
  5728             }
       
  5729             
       
  5730             ERROR;
       
  5731         }
       
  5732         
       
  5733     }/*function_udint_to_lint*/
       
  5734     break;
       
  5735 
       
  5736 /****
       
  5737  *UDINT_TO_USINT
       
  5738  */
       
  5739     case function_udint_to_usint :
       
  5740     {
       
  5741         symbol_c *last_type_symbol = NULL;
       
  5742 
       
  5743         {
       
  5744             identifier_c param_name("IN");
       
  5745             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5746             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5747             
       
  5748             /* Get the value from a foo(<param_value>) style call */
       
  5749             if (IN_param_value == NULL)
       
  5750               IN_param_value = function_call_param_iterator.next();
       
  5751             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5752             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5753             
       
  5754             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5755             {
       
  5756         
       
  5757                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  5758                 s4o.print("(");
       
  5759                 return_type_symbol->accept(*this);
       
  5760                 s4o.print(")");
       
  5761                 IN_param_value->accept(*this);
       
  5762                 return NULL;
       
  5763                 
       
  5764             }
       
  5765             
       
  5766             ERROR;
       
  5767         }
       
  5768         
       
  5769     }/*function_udint_to_usint*/
       
  5770     break;
       
  5771 
       
  5772 /****
       
  5773  *UDINT_TO_UINT
       
  5774  */
       
  5775     case function_udint_to_uint :
       
  5776     {
       
  5777         symbol_c *last_type_symbol = NULL;
       
  5778 
       
  5779         {
       
  5780             identifier_c param_name("IN");
       
  5781             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5782             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5783             
       
  5784             /* Get the value from a foo(<param_value>) style call */
       
  5785             if (IN_param_value == NULL)
       
  5786               IN_param_value = function_call_param_iterator.next();
       
  5787             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5788             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5789             
       
  5790             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
   969             {
  5791             {
   970         
  5792         
   971                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
  5793                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
   972                 s4o.print("(");
  5794                 s4o.print("(");
   973                 return_type_symbol->accept(*this);
  5795                 return_type_symbol->accept(*this);
   978             }
  5800             }
   979             
  5801             
   980             ERROR;
  5802             ERROR;
   981         }
  5803         }
   982         
  5804         
   983     }/*function_lreal_to_uint*/
  5805     }/*function_udint_to_uint*/
   984     break;
  5806     break;
   985 
  5807 
   986 /****
  5808 /****
   987  *LREAL_TO_UDINT
  5809  *UDINT_TO_ULINT
   988  */
  5810  */
   989     case function_lreal_to_udint :
  5811     case function_udint_to_ulint :
   990     {
  5812     {
   991         symbol_c *last_type_symbol = NULL;
  5813         symbol_c *last_type_symbol = NULL;
   992 
  5814 
   993         {
  5815         {
   994             identifier_c param_name("IN");
  5816             identifier_c param_name("IN");
   995             /* Get the value from a foo(<param_name> = <param_value>) style call */
  5817             /* 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);
  5818             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
   997             
  5819             
   998             /* Get the value from a foo(<param_value>) style call */
  5820             /* Get the value from a foo(<param_value>) style call */
   999             if (IN_param_value == NULL)
  5821             if (IN_param_value == NULL)
  1000               IN_param_value = function_call_param_iterator.next();
  5822               IN_param_value = function_call_param_iterator.next();
  1001             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  5823             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 ;
  5824             last_type_symbol = last_type_symbol && search_expression_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             
  5825             
  1004             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
  5826             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5827             {
       
  5828         
       
  5829                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  5830                 s4o.print("(");
       
  5831                 return_type_symbol->accept(*this);
       
  5832                 s4o.print(")");
       
  5833                 IN_param_value->accept(*this);
       
  5834                 return NULL;
       
  5835                 
       
  5836             }
       
  5837             
       
  5838             ERROR;
       
  5839         }
       
  5840         
       
  5841     }/*function_udint_to_ulint*/
       
  5842     break;
       
  5843 
       
  5844 /****
       
  5845  *UDINT_TO_TIME
       
  5846  */
       
  5847     case function_udint_to_time :
       
  5848     {
       
  5849         symbol_c *last_type_symbol = NULL;
       
  5850 
       
  5851         {
       
  5852             identifier_c param_name("IN");
       
  5853             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5854             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5855             
       
  5856             /* Get the value from a foo(<param_value>) style call */
       
  5857             if (IN_param_value == NULL)
       
  5858               IN_param_value = function_call_param_iterator.next();
       
  5859             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5860             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5861             
       
  5862             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5863             {
       
  5864         
       
  5865                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  5866                 s4o.print("(");
       
  5867                 return_type_symbol->accept(*this);
       
  5868                 s4o.print(")__int_to_time(");
       
  5869                 IN_param_value->accept(*this);
       
  5870                 s4o.print(")");
       
  5871                 return NULL;
       
  5872                 
       
  5873             }
       
  5874             
       
  5875             ERROR;
       
  5876         }
       
  5877         
       
  5878     }/*function_udint_to_time*/
       
  5879     break;
       
  5880 
       
  5881 /****
       
  5882  *UDINT_TO_BOOL
       
  5883  */
       
  5884     case function_udint_to_bool :
       
  5885     {
       
  5886         symbol_c *last_type_symbol = NULL;
       
  5887 
       
  5888         {
       
  5889             identifier_c param_name("IN");
       
  5890             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5891             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5892             
       
  5893             /* Get the value from a foo(<param_value>) style call */
       
  5894             if (IN_param_value == NULL)
       
  5895               IN_param_value = function_call_param_iterator.next();
       
  5896             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5897             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5898             
       
  5899             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5900             {
       
  5901         
       
  5902                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  5903                 s4o.print("(");
       
  5904                 return_type_symbol->accept(*this);
       
  5905                 s4o.print(")");
       
  5906                 IN_param_value->accept(*this);
       
  5907                 return NULL;
       
  5908                 
       
  5909             }
       
  5910             
       
  5911             ERROR;
       
  5912         }
       
  5913         
       
  5914     }/*function_udint_to_bool*/
       
  5915     break;
       
  5916 
       
  5917 /****
       
  5918  *UDINT_TO_BYTE
       
  5919  */
       
  5920     case function_udint_to_byte :
       
  5921     {
       
  5922         symbol_c *last_type_symbol = NULL;
       
  5923 
       
  5924         {
       
  5925             identifier_c param_name("IN");
       
  5926             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5927             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5928             
       
  5929             /* Get the value from a foo(<param_value>) style call */
       
  5930             if (IN_param_value == NULL)
       
  5931               IN_param_value = function_call_param_iterator.next();
       
  5932             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5933             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5934             
       
  5935             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5936             {
       
  5937         
       
  5938                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  5939                 s4o.print("(");
       
  5940                 return_type_symbol->accept(*this);
       
  5941                 s4o.print(")");
       
  5942                 IN_param_value->accept(*this);
       
  5943                 return NULL;
       
  5944                 
       
  5945             }
       
  5946             
       
  5947             ERROR;
       
  5948         }
       
  5949         
       
  5950     }/*function_udint_to_byte*/
       
  5951     break;
       
  5952 
       
  5953 /****
       
  5954  *UDINT_TO_WORD
       
  5955  */
       
  5956     case function_udint_to_word :
       
  5957     {
       
  5958         symbol_c *last_type_symbol = NULL;
       
  5959 
       
  5960         {
       
  5961             identifier_c param_name("IN");
       
  5962             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5963             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5964             
       
  5965             /* Get the value from a foo(<param_value>) style call */
       
  5966             if (IN_param_value == NULL)
       
  5967               IN_param_value = function_call_param_iterator.next();
       
  5968             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5969             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5970             
       
  5971             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5972             {
       
  5973         
       
  5974                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  5975                 s4o.print("(");
       
  5976                 return_type_symbol->accept(*this);
       
  5977                 s4o.print(")");
       
  5978                 IN_param_value->accept(*this);
       
  5979                 return NULL;
       
  5980                 
       
  5981             }
       
  5982             
       
  5983             ERROR;
       
  5984         }
       
  5985         
       
  5986     }/*function_udint_to_word*/
       
  5987     break;
       
  5988 
       
  5989 /****
       
  5990  *UDINT_TO_DWORD
       
  5991  */
       
  5992     case function_udint_to_dword :
       
  5993     {
       
  5994         symbol_c *last_type_symbol = NULL;
       
  5995 
       
  5996         {
       
  5997             identifier_c param_name("IN");
       
  5998             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5999             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6000             
       
  6001             /* Get the value from a foo(<param_value>) style call */
       
  6002             if (IN_param_value == NULL)
       
  6003               IN_param_value = function_call_param_iterator.next();
       
  6004             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6005             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6006             
       
  6007             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6008             {
       
  6009         
       
  6010                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  6011                 s4o.print("(");
       
  6012                 return_type_symbol->accept(*this);
       
  6013                 s4o.print(")");
       
  6014                 IN_param_value->accept(*this);
       
  6015                 return NULL;
       
  6016                 
       
  6017             }
       
  6018             
       
  6019             ERROR;
       
  6020         }
       
  6021         
       
  6022     }/*function_udint_to_dword*/
       
  6023     break;
       
  6024 
       
  6025 /****
       
  6026  *UDINT_TO_LWORD
       
  6027  */
       
  6028     case function_udint_to_lword :
       
  6029     {
       
  6030         symbol_c *last_type_symbol = NULL;
       
  6031 
       
  6032         {
       
  6033             identifier_c param_name("IN");
       
  6034             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6035             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6036             
       
  6037             /* Get the value from a foo(<param_value>) style call */
       
  6038             if (IN_param_value == NULL)
       
  6039               IN_param_value = function_call_param_iterator.next();
       
  6040             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6041             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6042             
       
  6043             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6044             {
       
  6045         
       
  6046                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  6047                 s4o.print("(");
       
  6048                 return_type_symbol->accept(*this);
       
  6049                 s4o.print(")");
       
  6050                 IN_param_value->accept(*this);
       
  6051                 return NULL;
       
  6052                 
       
  6053             }
       
  6054             
       
  6055             ERROR;
       
  6056         }
       
  6057         
       
  6058     }/*function_udint_to_lword*/
       
  6059     break;
       
  6060 
       
  6061 /****
       
  6062  *UDINT_TO_STRING
       
  6063  */
       
  6064     case function_udint_to_string :
       
  6065     {
       
  6066         symbol_c *last_type_symbol = NULL;
       
  6067 
       
  6068         {
       
  6069             identifier_c param_name("IN");
       
  6070             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6071             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6072             
       
  6073             /* Get the value from a foo(<param_value>) style call */
       
  6074             if (IN_param_value == NULL)
       
  6075               IN_param_value = function_call_param_iterator.next();
       
  6076             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6077             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6078             
       
  6079             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6080             {
       
  6081         
       
  6082                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  6083                 s4o.print("(");
       
  6084                 return_type_symbol->accept(*this);
       
  6085                 s4o.print(")__uint_to_string(");
       
  6086                 IN_param_value->accept(*this);
       
  6087                 s4o.print(")");
       
  6088                 return NULL;
       
  6089                 
       
  6090             }
       
  6091             
       
  6092             ERROR;
       
  6093         }
       
  6094         
       
  6095     }/*function_udint_to_string*/
       
  6096     break;
       
  6097 
       
  6098 /****
       
  6099  *UDINT_TO_DATE
       
  6100  */
       
  6101     case function_udint_to_date :
       
  6102     {
       
  6103         symbol_c *last_type_symbol = NULL;
       
  6104 
       
  6105         {
       
  6106             identifier_c param_name("IN");
       
  6107             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6108             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6109             
       
  6110             /* Get the value from a foo(<param_value>) style call */
       
  6111             if (IN_param_value == NULL)
       
  6112               IN_param_value = function_call_param_iterator.next();
       
  6113             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6114             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6115             
       
  6116             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6117             {
       
  6118         
       
  6119                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  6120                 s4o.print("(");
       
  6121                 return_type_symbol->accept(*this);
       
  6122                 s4o.print(")__int_to_time(");
       
  6123                 IN_param_value->accept(*this);
       
  6124                 s4o.print(")");
       
  6125                 return NULL;
       
  6126                 
       
  6127             }
       
  6128             
       
  6129             ERROR;
       
  6130         }
       
  6131         
       
  6132     }/*function_udint_to_date*/
       
  6133     break;
       
  6134 
       
  6135 /****
       
  6136  *UDINT_TO_TOD
       
  6137  */
       
  6138     case function_udint_to_tod :
       
  6139     {
       
  6140         symbol_c *last_type_symbol = NULL;
       
  6141 
       
  6142         {
       
  6143             identifier_c param_name("IN");
       
  6144             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6145             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6146             
       
  6147             /* Get the value from a foo(<param_value>) style call */
       
  6148             if (IN_param_value == NULL)
       
  6149               IN_param_value = function_call_param_iterator.next();
       
  6150             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6151             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6152             
       
  6153             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6154             {
       
  6155         
       
  6156                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  6157                 s4o.print("(");
       
  6158                 return_type_symbol->accept(*this);
       
  6159                 s4o.print(")__int_to_time(");
       
  6160                 IN_param_value->accept(*this);
       
  6161                 s4o.print(")");
       
  6162                 return NULL;
       
  6163                 
       
  6164             }
       
  6165             
       
  6166             ERROR;
       
  6167         }
       
  6168         
       
  6169     }/*function_udint_to_tod*/
       
  6170     break;
       
  6171 
       
  6172 /****
       
  6173  *UDINT_TO_DT
       
  6174  */
       
  6175     case function_udint_to_dt :
       
  6176     {
       
  6177         symbol_c *last_type_symbol = NULL;
       
  6178 
       
  6179         {
       
  6180             identifier_c param_name("IN");
       
  6181             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6182             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6183             
       
  6184             /* Get the value from a foo(<param_value>) style call */
       
  6185             if (IN_param_value == NULL)
       
  6186               IN_param_value = function_call_param_iterator.next();
       
  6187             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6188             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6189             
       
  6190             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6191             {
       
  6192         
       
  6193                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  6194                 s4o.print("(");
       
  6195                 return_type_symbol->accept(*this);
       
  6196                 s4o.print(")__int_to_time(");
       
  6197                 IN_param_value->accept(*this);
       
  6198                 s4o.print(")");
       
  6199                 return NULL;
       
  6200                 
       
  6201             }
       
  6202             
       
  6203             ERROR;
       
  6204         }
       
  6205         
       
  6206     }/*function_udint_to_dt*/
       
  6207     break;
       
  6208 
       
  6209 /****
       
  6210  *ULINT_TO_REAL
       
  6211  */
       
  6212     case function_ulint_to_real :
       
  6213     {
       
  6214         symbol_c *last_type_symbol = NULL;
       
  6215 
       
  6216         {
       
  6217             identifier_c param_name("IN");
       
  6218             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6219             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6220             
       
  6221             /* Get the value from a foo(<param_value>) style call */
       
  6222             if (IN_param_value == NULL)
       
  6223               IN_param_value = function_call_param_iterator.next();
       
  6224             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6225             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6226             
       
  6227             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6228             {
       
  6229         
       
  6230                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  6231                 s4o.print("(");
       
  6232                 return_type_symbol->accept(*this);
       
  6233                 s4o.print(")");
       
  6234                 IN_param_value->accept(*this);
       
  6235                 return NULL;
       
  6236                 
       
  6237             }
       
  6238             
       
  6239             ERROR;
       
  6240         }
       
  6241         
       
  6242     }/*function_ulint_to_real*/
       
  6243     break;
       
  6244 
       
  6245 /****
       
  6246  *ULINT_TO_LREAL
       
  6247  */
       
  6248     case function_ulint_to_lreal :
       
  6249     {
       
  6250         symbol_c *last_type_symbol = NULL;
       
  6251 
       
  6252         {
       
  6253             identifier_c param_name("IN");
       
  6254             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6255             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6256             
       
  6257             /* Get the value from a foo(<param_value>) style call */
       
  6258             if (IN_param_value == NULL)
       
  6259               IN_param_value = function_call_param_iterator.next();
       
  6260             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6261             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6262             
       
  6263             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6264             {
       
  6265         
       
  6266                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  6267                 s4o.print("(");
       
  6268                 return_type_symbol->accept(*this);
       
  6269                 s4o.print(")");
       
  6270                 IN_param_value->accept(*this);
       
  6271                 return NULL;
       
  6272                 
       
  6273             }
       
  6274             
       
  6275             ERROR;
       
  6276         }
       
  6277         
       
  6278     }/*function_ulint_to_lreal*/
       
  6279     break;
       
  6280 
       
  6281 /****
       
  6282  *ULINT_TO_SINT
       
  6283  */
       
  6284     case function_ulint_to_sint :
       
  6285     {
       
  6286         symbol_c *last_type_symbol = NULL;
       
  6287 
       
  6288         {
       
  6289             identifier_c param_name("IN");
       
  6290             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6291             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6292             
       
  6293             /* Get the value from a foo(<param_value>) style call */
       
  6294             if (IN_param_value == NULL)
       
  6295               IN_param_value = function_call_param_iterator.next();
       
  6296             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6297             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6298             
       
  6299             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6300             {
       
  6301         
       
  6302                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  6303                 s4o.print("(");
       
  6304                 return_type_symbol->accept(*this);
       
  6305                 s4o.print(")");
       
  6306                 IN_param_value->accept(*this);
       
  6307                 return NULL;
       
  6308                 
       
  6309             }
       
  6310             
       
  6311             ERROR;
       
  6312         }
       
  6313         
       
  6314     }/*function_ulint_to_sint*/
       
  6315     break;
       
  6316 
       
  6317 /****
       
  6318  *ULINT_TO_INT
       
  6319  */
       
  6320     case function_ulint_to_int :
       
  6321     {
       
  6322         symbol_c *last_type_symbol = NULL;
       
  6323 
       
  6324         {
       
  6325             identifier_c param_name("IN");
       
  6326             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6327             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6328             
       
  6329             /* Get the value from a foo(<param_value>) style call */
       
  6330             if (IN_param_value == NULL)
       
  6331               IN_param_value = function_call_param_iterator.next();
       
  6332             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6333             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6334             
       
  6335             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6336             {
       
  6337         
       
  6338                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  6339                 s4o.print("(");
       
  6340                 return_type_symbol->accept(*this);
       
  6341                 s4o.print(")");
       
  6342                 IN_param_value->accept(*this);
       
  6343                 return NULL;
       
  6344                 
       
  6345             }
       
  6346             
       
  6347             ERROR;
       
  6348         }
       
  6349         
       
  6350     }/*function_ulint_to_int*/
       
  6351     break;
       
  6352 
       
  6353 /****
       
  6354  *ULINT_TO_DINT
       
  6355  */
       
  6356     case function_ulint_to_dint :
       
  6357     {
       
  6358         symbol_c *last_type_symbol = NULL;
       
  6359 
       
  6360         {
       
  6361             identifier_c param_name("IN");
       
  6362             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6363             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6364             
       
  6365             /* Get the value from a foo(<param_value>) style call */
       
  6366             if (IN_param_value == NULL)
       
  6367               IN_param_value = function_call_param_iterator.next();
       
  6368             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6369             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6370             
       
  6371             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6372             {
       
  6373         
       
  6374                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  6375                 s4o.print("(");
       
  6376                 return_type_symbol->accept(*this);
       
  6377                 s4o.print(")");
       
  6378                 IN_param_value->accept(*this);
       
  6379                 return NULL;
       
  6380                 
       
  6381             }
       
  6382             
       
  6383             ERROR;
       
  6384         }
       
  6385         
       
  6386     }/*function_ulint_to_dint*/
       
  6387     break;
       
  6388 
       
  6389 /****
       
  6390  *ULINT_TO_LINT
       
  6391  */
       
  6392     case function_ulint_to_lint :
       
  6393     {
       
  6394         symbol_c *last_type_symbol = NULL;
       
  6395 
       
  6396         {
       
  6397             identifier_c param_name("IN");
       
  6398             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6399             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6400             
       
  6401             /* Get the value from a foo(<param_value>) style call */
       
  6402             if (IN_param_value == NULL)
       
  6403               IN_param_value = function_call_param_iterator.next();
       
  6404             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6405             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6406             
       
  6407             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6408             {
       
  6409         
       
  6410                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  6411                 s4o.print("(");
       
  6412                 return_type_symbol->accept(*this);
       
  6413                 s4o.print(")");
       
  6414                 IN_param_value->accept(*this);
       
  6415                 return NULL;
       
  6416                 
       
  6417             }
       
  6418             
       
  6419             ERROR;
       
  6420         }
       
  6421         
       
  6422     }/*function_ulint_to_lint*/
       
  6423     break;
       
  6424 
       
  6425 /****
       
  6426  *ULINT_TO_USINT
       
  6427  */
       
  6428     case function_ulint_to_usint :
       
  6429     {
       
  6430         symbol_c *last_type_symbol = NULL;
       
  6431 
       
  6432         {
       
  6433             identifier_c param_name("IN");
       
  6434             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6435             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6436             
       
  6437             /* Get the value from a foo(<param_value>) style call */
       
  6438             if (IN_param_value == NULL)
       
  6439               IN_param_value = function_call_param_iterator.next();
       
  6440             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6441             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6442             
       
  6443             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6444             {
       
  6445         
       
  6446                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  6447                 s4o.print("(");
       
  6448                 return_type_symbol->accept(*this);
       
  6449                 s4o.print(")");
       
  6450                 IN_param_value->accept(*this);
       
  6451                 return NULL;
       
  6452                 
       
  6453             }
       
  6454             
       
  6455             ERROR;
       
  6456         }
       
  6457         
       
  6458     }/*function_ulint_to_usint*/
       
  6459     break;
       
  6460 
       
  6461 /****
       
  6462  *ULINT_TO_UINT
       
  6463  */
       
  6464     case function_ulint_to_uint :
       
  6465     {
       
  6466         symbol_c *last_type_symbol = NULL;
       
  6467 
       
  6468         {
       
  6469             identifier_c param_name("IN");
       
  6470             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6471             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6472             
       
  6473             /* Get the value from a foo(<param_value>) style call */
       
  6474             if (IN_param_value == NULL)
       
  6475               IN_param_value = function_call_param_iterator.next();
       
  6476             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6477             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6478             
       
  6479             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6480             {
       
  6481         
       
  6482                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  6483                 s4o.print("(");
       
  6484                 return_type_symbol->accept(*this);
       
  6485                 s4o.print(")");
       
  6486                 IN_param_value->accept(*this);
       
  6487                 return NULL;
       
  6488                 
       
  6489             }
       
  6490             
       
  6491             ERROR;
       
  6492         }
       
  6493         
       
  6494     }/*function_ulint_to_uint*/
       
  6495     break;
       
  6496 
       
  6497 /****
       
  6498  *ULINT_TO_UDINT
       
  6499  */
       
  6500     case function_ulint_to_udint :
       
  6501     {
       
  6502         symbol_c *last_type_symbol = NULL;
       
  6503 
       
  6504         {
       
  6505             identifier_c param_name("IN");
       
  6506             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6507             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6508             
       
  6509             /* Get the value from a foo(<param_value>) style call */
       
  6510             if (IN_param_value == NULL)
       
  6511               IN_param_value = function_call_param_iterator.next();
       
  6512             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6513             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6514             
       
  6515             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
  1005             {
  6516             {
  1006         
  6517         
  1007                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
  6518                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
  1008                 s4o.print("(");
  6519                 s4o.print("(");
  1009                 return_type_symbol->accept(*this);
  6520                 return_type_symbol->accept(*this);
  1014             }
  6525             }
  1015             
  6526             
  1016             ERROR;
  6527             ERROR;
  1017         }
  6528         }
  1018         
  6529         
  1019     }/*function_lreal_to_udint*/
  6530     }/*function_ulint_to_udint*/
  1020     break;
  6531     break;
  1021 
  6532 
  1022 /****
  6533 /****
  1023  *LREAL_TO_ULINT
  6534  *ULINT_TO_TIME
  1024  */
  6535  */
  1025     case function_lreal_to_ulint :
  6536     case function_ulint_to_time :
  1026     {
  6537     {
  1027         symbol_c *last_type_symbol = NULL;
  6538         symbol_c *last_type_symbol = NULL;
  1028 
  6539 
  1029         {
  6540         {
  1030             identifier_c param_name("IN");
  6541             identifier_c param_name("IN");
  1031             /* Get the value from a foo(<param_name> = <param_value>) style call */
  6542             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1032             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  6543             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1033             
  6544             
  1034             /* Get the value from a foo(<param_value>) style call */
  6545             /* Get the value from a foo(<param_value>) style call */
  1035             if (IN_param_value == NULL)
  6546             if (IN_param_value == NULL)
  1036               IN_param_value = function_call_param_iterator.next();
  6547               IN_param_value = function_call_param_iterator.next();
  1037             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  6548             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1038             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  6549             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1039             
  6550             
  1040             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
  6551             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6552             {
       
  6553         
       
  6554                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  6555                 s4o.print("(");
       
  6556                 return_type_symbol->accept(*this);
       
  6557                 s4o.print(")__int_to_time(");
       
  6558                 IN_param_value->accept(*this);
       
  6559                 s4o.print(")");
       
  6560                 return NULL;
       
  6561                 
       
  6562             }
       
  6563             
       
  6564             ERROR;
       
  6565         }
       
  6566         
       
  6567     }/*function_ulint_to_time*/
       
  6568     break;
       
  6569 
       
  6570 /****
       
  6571  *ULINT_TO_BOOL
       
  6572  */
       
  6573     case function_ulint_to_bool :
       
  6574     {
       
  6575         symbol_c *last_type_symbol = NULL;
       
  6576 
       
  6577         {
       
  6578             identifier_c param_name("IN");
       
  6579             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6580             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6581             
       
  6582             /* Get the value from a foo(<param_value>) style call */
       
  6583             if (IN_param_value == NULL)
       
  6584               IN_param_value = function_call_param_iterator.next();
       
  6585             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6586             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6587             
       
  6588             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6589             {
       
  6590         
       
  6591                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  6592                 s4o.print("(");
       
  6593                 return_type_symbol->accept(*this);
       
  6594                 s4o.print(")");
       
  6595                 IN_param_value->accept(*this);
       
  6596                 return NULL;
       
  6597                 
       
  6598             }
       
  6599             
       
  6600             ERROR;
       
  6601         }
       
  6602         
       
  6603     }/*function_ulint_to_bool*/
       
  6604     break;
       
  6605 
       
  6606 /****
       
  6607  *ULINT_TO_BYTE
       
  6608  */
       
  6609     case function_ulint_to_byte :
       
  6610     {
       
  6611         symbol_c *last_type_symbol = NULL;
       
  6612 
       
  6613         {
       
  6614             identifier_c param_name("IN");
       
  6615             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6616             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6617             
       
  6618             /* Get the value from a foo(<param_value>) style call */
       
  6619             if (IN_param_value == NULL)
       
  6620               IN_param_value = function_call_param_iterator.next();
       
  6621             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6622             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6623             
       
  6624             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6625             {
       
  6626         
       
  6627                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  6628                 s4o.print("(");
       
  6629                 return_type_symbol->accept(*this);
       
  6630                 s4o.print(")");
       
  6631                 IN_param_value->accept(*this);
       
  6632                 return NULL;
       
  6633                 
       
  6634             }
       
  6635             
       
  6636             ERROR;
       
  6637         }
       
  6638         
       
  6639     }/*function_ulint_to_byte*/
       
  6640     break;
       
  6641 
       
  6642 /****
       
  6643  *ULINT_TO_WORD
       
  6644  */
       
  6645     case function_ulint_to_word :
       
  6646     {
       
  6647         symbol_c *last_type_symbol = NULL;
       
  6648 
       
  6649         {
       
  6650             identifier_c param_name("IN");
       
  6651             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6652             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6653             
       
  6654             /* Get the value from a foo(<param_value>) style call */
       
  6655             if (IN_param_value == NULL)
       
  6656               IN_param_value = function_call_param_iterator.next();
       
  6657             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6658             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6659             
       
  6660             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6661             {
       
  6662         
       
  6663                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  6664                 s4o.print("(");
       
  6665                 return_type_symbol->accept(*this);
       
  6666                 s4o.print(")");
       
  6667                 IN_param_value->accept(*this);
       
  6668                 return NULL;
       
  6669                 
       
  6670             }
       
  6671             
       
  6672             ERROR;
       
  6673         }
       
  6674         
       
  6675     }/*function_ulint_to_word*/
       
  6676     break;
       
  6677 
       
  6678 /****
       
  6679  *ULINT_TO_DWORD
       
  6680  */
       
  6681     case function_ulint_to_dword :
       
  6682     {
       
  6683         symbol_c *last_type_symbol = NULL;
       
  6684 
       
  6685         {
       
  6686             identifier_c param_name("IN");
       
  6687             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6688             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6689             
       
  6690             /* Get the value from a foo(<param_value>) style call */
       
  6691             if (IN_param_value == NULL)
       
  6692               IN_param_value = function_call_param_iterator.next();
       
  6693             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6694             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6695             
       
  6696             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6697             {
       
  6698         
       
  6699                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  6700                 s4o.print("(");
       
  6701                 return_type_symbol->accept(*this);
       
  6702                 s4o.print(")");
       
  6703                 IN_param_value->accept(*this);
       
  6704                 return NULL;
       
  6705                 
       
  6706             }
       
  6707             
       
  6708             ERROR;
       
  6709         }
       
  6710         
       
  6711     }/*function_ulint_to_dword*/
       
  6712     break;
       
  6713 
       
  6714 /****
       
  6715  *ULINT_TO_LWORD
       
  6716  */
       
  6717     case function_ulint_to_lword :
       
  6718     {
       
  6719         symbol_c *last_type_symbol = NULL;
       
  6720 
       
  6721         {
       
  6722             identifier_c param_name("IN");
       
  6723             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6724             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6725             
       
  6726             /* Get the value from a foo(<param_value>) style call */
       
  6727             if (IN_param_value == NULL)
       
  6728               IN_param_value = function_call_param_iterator.next();
       
  6729             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6730             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6731             
       
  6732             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6733             {
       
  6734         
       
  6735                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  6736                 s4o.print("(");
       
  6737                 return_type_symbol->accept(*this);
       
  6738                 s4o.print(")");
       
  6739                 IN_param_value->accept(*this);
       
  6740                 return NULL;
       
  6741                 
       
  6742             }
       
  6743             
       
  6744             ERROR;
       
  6745         }
       
  6746         
       
  6747     }/*function_ulint_to_lword*/
       
  6748     break;
       
  6749 
       
  6750 /****
       
  6751  *ULINT_TO_STRING
       
  6752  */
       
  6753     case function_ulint_to_string :
       
  6754     {
       
  6755         symbol_c *last_type_symbol = NULL;
       
  6756 
       
  6757         {
       
  6758             identifier_c param_name("IN");
       
  6759             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6760             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6761             
       
  6762             /* Get the value from a foo(<param_value>) style call */
       
  6763             if (IN_param_value == NULL)
       
  6764               IN_param_value = function_call_param_iterator.next();
       
  6765             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6766             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6767             
       
  6768             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6769             {
       
  6770         
       
  6771                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  6772                 s4o.print("(");
       
  6773                 return_type_symbol->accept(*this);
       
  6774                 s4o.print(")__uint_to_string(");
       
  6775                 IN_param_value->accept(*this);
       
  6776                 s4o.print(")");
       
  6777                 return NULL;
       
  6778                 
       
  6779             }
       
  6780             
       
  6781             ERROR;
       
  6782         }
       
  6783         
       
  6784     }/*function_ulint_to_string*/
       
  6785     break;
       
  6786 
       
  6787 /****
       
  6788  *ULINT_TO_DATE
       
  6789  */
       
  6790     case function_ulint_to_date :
       
  6791     {
       
  6792         symbol_c *last_type_symbol = NULL;
       
  6793 
       
  6794         {
       
  6795             identifier_c param_name("IN");
       
  6796             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6797             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6798             
       
  6799             /* Get the value from a foo(<param_value>) style call */
       
  6800             if (IN_param_value == NULL)
       
  6801               IN_param_value = function_call_param_iterator.next();
       
  6802             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6803             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6804             
       
  6805             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6806             {
       
  6807         
       
  6808                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  6809                 s4o.print("(");
       
  6810                 return_type_symbol->accept(*this);
       
  6811                 s4o.print(")__int_to_time(");
       
  6812                 IN_param_value->accept(*this);
       
  6813                 s4o.print(")");
       
  6814                 return NULL;
       
  6815                 
       
  6816             }
       
  6817             
       
  6818             ERROR;
       
  6819         }
       
  6820         
       
  6821     }/*function_ulint_to_date*/
       
  6822     break;
       
  6823 
       
  6824 /****
       
  6825  *ULINT_TO_TOD
       
  6826  */
       
  6827     case function_ulint_to_tod :
       
  6828     {
       
  6829         symbol_c *last_type_symbol = NULL;
       
  6830 
       
  6831         {
       
  6832             identifier_c param_name("IN");
       
  6833             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6834             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6835             
       
  6836             /* Get the value from a foo(<param_value>) style call */
       
  6837             if (IN_param_value == NULL)
       
  6838               IN_param_value = function_call_param_iterator.next();
       
  6839             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6840             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6841             
       
  6842             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6843             {
       
  6844         
       
  6845                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  6846                 s4o.print("(");
       
  6847                 return_type_symbol->accept(*this);
       
  6848                 s4o.print(")__int_to_time(");
       
  6849                 IN_param_value->accept(*this);
       
  6850                 s4o.print(")");
       
  6851                 return NULL;
       
  6852                 
       
  6853             }
       
  6854             
       
  6855             ERROR;
       
  6856         }
       
  6857         
       
  6858     }/*function_ulint_to_tod*/
       
  6859     break;
       
  6860 
       
  6861 /****
       
  6862  *ULINT_TO_DT
       
  6863  */
       
  6864     case function_ulint_to_dt :
       
  6865     {
       
  6866         symbol_c *last_type_symbol = NULL;
       
  6867 
       
  6868         {
       
  6869             identifier_c param_name("IN");
       
  6870             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6871             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6872             
       
  6873             /* Get the value from a foo(<param_value>) style call */
       
  6874             if (IN_param_value == NULL)
       
  6875               IN_param_value = function_call_param_iterator.next();
       
  6876             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6877             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6878             
       
  6879             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6880             {
       
  6881         
       
  6882                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  6883                 s4o.print("(");
       
  6884                 return_type_symbol->accept(*this);
       
  6885                 s4o.print(")__int_to_time(");
       
  6886                 IN_param_value->accept(*this);
       
  6887                 s4o.print(")");
       
  6888                 return NULL;
       
  6889                 
       
  6890             }
       
  6891             
       
  6892             ERROR;
       
  6893         }
       
  6894         
       
  6895     }/*function_ulint_to_dt*/
       
  6896     break;
       
  6897 
       
  6898 /****
       
  6899  *TIME_TO_REAL
       
  6900  */
       
  6901     case function_time_to_real :
       
  6902     {
       
  6903         symbol_c *last_type_symbol = NULL;
       
  6904 
       
  6905         {
       
  6906             identifier_c param_name("IN");
       
  6907             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6908             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6909             
       
  6910             /* Get the value from a foo(<param_value>) style call */
       
  6911             if (IN_param_value == NULL)
       
  6912               IN_param_value = function_call_param_iterator.next();
       
  6913             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6914             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6915             
       
  6916             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  6917             {
       
  6918         
       
  6919                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  6920                 s4o.print("(");
       
  6921                 return_type_symbol->accept(*this);
       
  6922                 s4o.print(")__time_to_real(");
       
  6923                 IN_param_value->accept(*this);
       
  6924                 s4o.print(")");
       
  6925                 return NULL;
       
  6926                 
       
  6927             }
       
  6928             
       
  6929             ERROR;
       
  6930         }
       
  6931         
       
  6932     }/*function_time_to_real*/
       
  6933     break;
       
  6934 
       
  6935 /****
       
  6936  *TIME_TO_LREAL
       
  6937  */
       
  6938     case function_time_to_lreal :
       
  6939     {
       
  6940         symbol_c *last_type_symbol = NULL;
       
  6941 
       
  6942         {
       
  6943             identifier_c param_name("IN");
       
  6944             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6945             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6946             
       
  6947             /* Get the value from a foo(<param_value>) style call */
       
  6948             if (IN_param_value == NULL)
       
  6949               IN_param_value = function_call_param_iterator.next();
       
  6950             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6951             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6952             
       
  6953             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  6954             {
       
  6955         
       
  6956                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  6957                 s4o.print("(");
       
  6958                 return_type_symbol->accept(*this);
       
  6959                 s4o.print(")__time_to_real(");
       
  6960                 IN_param_value->accept(*this);
       
  6961                 s4o.print(")");
       
  6962                 return NULL;
       
  6963                 
       
  6964             }
       
  6965             
       
  6966             ERROR;
       
  6967         }
       
  6968         
       
  6969     }/*function_time_to_lreal*/
       
  6970     break;
       
  6971 
       
  6972 /****
       
  6973  *TIME_TO_SINT
       
  6974  */
       
  6975     case function_time_to_sint :
       
  6976     {
       
  6977         symbol_c *last_type_symbol = NULL;
       
  6978 
       
  6979         {
       
  6980             identifier_c param_name("IN");
       
  6981             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6982             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6983             
       
  6984             /* Get the value from a foo(<param_value>) style call */
       
  6985             if (IN_param_value == NULL)
       
  6986               IN_param_value = function_call_param_iterator.next();
       
  6987             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6988             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6989             
       
  6990             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  6991             {
       
  6992         
       
  6993                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  6994                 s4o.print("(");
       
  6995                 return_type_symbol->accept(*this);
       
  6996                 s4o.print(")__time_to_int(");
       
  6997                 IN_param_value->accept(*this);
       
  6998                 s4o.print(")");
       
  6999                 return NULL;
       
  7000                 
       
  7001             }
       
  7002             
       
  7003             ERROR;
       
  7004         }
       
  7005         
       
  7006     }/*function_time_to_sint*/
       
  7007     break;
       
  7008 
       
  7009 /****
       
  7010  *TIME_TO_INT
       
  7011  */
       
  7012     case function_time_to_int :
       
  7013     {
       
  7014         symbol_c *last_type_symbol = NULL;
       
  7015 
       
  7016         {
       
  7017             identifier_c param_name("IN");
       
  7018             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7019             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7020             
       
  7021             /* Get the value from a foo(<param_value>) style call */
       
  7022             if (IN_param_value == NULL)
       
  7023               IN_param_value = function_call_param_iterator.next();
       
  7024             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7025             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7026             
       
  7027             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7028             {
       
  7029         
       
  7030                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  7031                 s4o.print("(");
       
  7032                 return_type_symbol->accept(*this);
       
  7033                 s4o.print(")__time_to_int(");
       
  7034                 IN_param_value->accept(*this);
       
  7035                 s4o.print(")");
       
  7036                 return NULL;
       
  7037                 
       
  7038             }
       
  7039             
       
  7040             ERROR;
       
  7041         }
       
  7042         
       
  7043     }/*function_time_to_int*/
       
  7044     break;
       
  7045 
       
  7046 /****
       
  7047  *TIME_TO_DINT
       
  7048  */
       
  7049     case function_time_to_dint :
       
  7050     {
       
  7051         symbol_c *last_type_symbol = NULL;
       
  7052 
       
  7053         {
       
  7054             identifier_c param_name("IN");
       
  7055             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7056             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7057             
       
  7058             /* Get the value from a foo(<param_value>) style call */
       
  7059             if (IN_param_value == NULL)
       
  7060               IN_param_value = function_call_param_iterator.next();
       
  7061             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7062             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7063             
       
  7064             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7065             {
       
  7066         
       
  7067                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  7068                 s4o.print("(");
       
  7069                 return_type_symbol->accept(*this);
       
  7070                 s4o.print(")__time_to_int(");
       
  7071                 IN_param_value->accept(*this);
       
  7072                 s4o.print(")");
       
  7073                 return NULL;
       
  7074                 
       
  7075             }
       
  7076             
       
  7077             ERROR;
       
  7078         }
       
  7079         
       
  7080     }/*function_time_to_dint*/
       
  7081     break;
       
  7082 
       
  7083 /****
       
  7084  *TIME_TO_LINT
       
  7085  */
       
  7086     case function_time_to_lint :
       
  7087     {
       
  7088         symbol_c *last_type_symbol = NULL;
       
  7089 
       
  7090         {
       
  7091             identifier_c param_name("IN");
       
  7092             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7093             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7094             
       
  7095             /* Get the value from a foo(<param_value>) style call */
       
  7096             if (IN_param_value == NULL)
       
  7097               IN_param_value = function_call_param_iterator.next();
       
  7098             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7099             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7100             
       
  7101             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7102             {
       
  7103         
       
  7104                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  7105                 s4o.print("(");
       
  7106                 return_type_symbol->accept(*this);
       
  7107                 s4o.print(")__time_to_int(");
       
  7108                 IN_param_value->accept(*this);
       
  7109                 s4o.print(")");
       
  7110                 return NULL;
       
  7111                 
       
  7112             }
       
  7113             
       
  7114             ERROR;
       
  7115         }
       
  7116         
       
  7117     }/*function_time_to_lint*/
       
  7118     break;
       
  7119 
       
  7120 /****
       
  7121  *TIME_TO_USINT
       
  7122  */
       
  7123     case function_time_to_usint :
       
  7124     {
       
  7125         symbol_c *last_type_symbol = NULL;
       
  7126 
       
  7127         {
       
  7128             identifier_c param_name("IN");
       
  7129             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7130             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7131             
       
  7132             /* Get the value from a foo(<param_value>) style call */
       
  7133             if (IN_param_value == NULL)
       
  7134               IN_param_value = function_call_param_iterator.next();
       
  7135             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7136             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7137             
       
  7138             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7139             {
       
  7140         
       
  7141                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  7142                 s4o.print("(");
       
  7143                 return_type_symbol->accept(*this);
       
  7144                 s4o.print(")__time_to_int(");
       
  7145                 IN_param_value->accept(*this);
       
  7146                 s4o.print(")");
       
  7147                 return NULL;
       
  7148                 
       
  7149             }
       
  7150             
       
  7151             ERROR;
       
  7152         }
       
  7153         
       
  7154     }/*function_time_to_usint*/
       
  7155     break;
       
  7156 
       
  7157 /****
       
  7158  *TIME_TO_UINT
       
  7159  */
       
  7160     case function_time_to_uint :
       
  7161     {
       
  7162         symbol_c *last_type_symbol = NULL;
       
  7163 
       
  7164         {
       
  7165             identifier_c param_name("IN");
       
  7166             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7167             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7168             
       
  7169             /* Get the value from a foo(<param_value>) style call */
       
  7170             if (IN_param_value == NULL)
       
  7171               IN_param_value = function_call_param_iterator.next();
       
  7172             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7173             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7174             
       
  7175             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7176             {
       
  7177         
       
  7178                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  7179                 s4o.print("(");
       
  7180                 return_type_symbol->accept(*this);
       
  7181                 s4o.print(")__time_to_int(");
       
  7182                 IN_param_value->accept(*this);
       
  7183                 s4o.print(")");
       
  7184                 return NULL;
       
  7185                 
       
  7186             }
       
  7187             
       
  7188             ERROR;
       
  7189         }
       
  7190         
       
  7191     }/*function_time_to_uint*/
       
  7192     break;
       
  7193 
       
  7194 /****
       
  7195  *TIME_TO_UDINT
       
  7196  */
       
  7197     case function_time_to_udint :
       
  7198     {
       
  7199         symbol_c *last_type_symbol = NULL;
       
  7200 
       
  7201         {
       
  7202             identifier_c param_name("IN");
       
  7203             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7204             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7205             
       
  7206             /* Get the value from a foo(<param_value>) style call */
       
  7207             if (IN_param_value == NULL)
       
  7208               IN_param_value = function_call_param_iterator.next();
       
  7209             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7210             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7211             
       
  7212             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7213             {
       
  7214         
       
  7215                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  7216                 s4o.print("(");
       
  7217                 return_type_symbol->accept(*this);
       
  7218                 s4o.print(")__time_to_int(");
       
  7219                 IN_param_value->accept(*this);
       
  7220                 s4o.print(")");
       
  7221                 return NULL;
       
  7222                 
       
  7223             }
       
  7224             
       
  7225             ERROR;
       
  7226         }
       
  7227         
       
  7228     }/*function_time_to_udint*/
       
  7229     break;
       
  7230 
       
  7231 /****
       
  7232  *TIME_TO_ULINT
       
  7233  */
       
  7234     case function_time_to_ulint :
       
  7235     {
       
  7236         symbol_c *last_type_symbol = NULL;
       
  7237 
       
  7238         {
       
  7239             identifier_c param_name("IN");
       
  7240             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7241             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7242             
       
  7243             /* Get the value from a foo(<param_value>) style call */
       
  7244             if (IN_param_value == NULL)
       
  7245               IN_param_value = function_call_param_iterator.next();
       
  7246             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7247             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7248             
       
  7249             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
  1041             {
  7250             {
  1042         
  7251         
  1043                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
  7252                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
  1044                 s4o.print("(");
  7253                 s4o.print("(");
  1045                 return_type_symbol->accept(*this);
  7254                 return_type_symbol->accept(*this);
  1046                 s4o.print(")");
  7255                 s4o.print(")__time_to_int(");
  1047                 IN_param_value->accept(*this);
  7256                 IN_param_value->accept(*this);
  1048                 return NULL;
  7257                 s4o.print(")");
  1049                 
  7258                 return NULL;
  1050             }
  7259                 
  1051             
  7260             }
  1052             ERROR;
  7261             
  1053         }
  7262             ERROR;
  1054         
  7263         }
  1055     }/*function_lreal_to_ulint*/
  7264         
  1056     break;
  7265     }/*function_time_to_ulint*/
  1057 
  7266     break;
  1058 /****
  7267 
  1059  *LREAL_TO_TIME
  7268 /****
  1060  */
  7269  *TIME_TO_BOOL
  1061     case function_lreal_to_time :
  7270  */
  1062     {
  7271     case function_time_to_bool :
  1063         symbol_c *last_type_symbol = NULL;
  7272     {
  1064 
  7273         symbol_c *last_type_symbol = NULL;
  1065         {
  7274 
  1066             identifier_c param_name("IN");
  7275         {
  1067             /* Get the value from a foo(<param_name> = <param_value>) style call */
  7276             identifier_c param_name("IN");
  1068             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  7277             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1069             
  7278             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1070             /* Get the value from a foo(<param_value>) style call */
  7279             
  1071             if (IN_param_value == NULL)
  7280             /* Get the value from a foo(<param_value>) style call */
  1072               IN_param_value = function_call_param_iterator.next();
  7281             if (IN_param_value == NULL)
  1073             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  7282               IN_param_value = function_call_param_iterator.next();
  1074             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  7283             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1075             
  7284             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1076             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
  7285             
       
  7286             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7287             {
       
  7288         
       
  7289                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  7290                 s4o.print("(");
       
  7291                 return_type_symbol->accept(*this);
       
  7292                 s4o.print(")__time_to_int(");
       
  7293                 IN_param_value->accept(*this);
       
  7294                 s4o.print(")");
       
  7295                 return NULL;
       
  7296                 
       
  7297             }
       
  7298             
       
  7299             ERROR;
       
  7300         }
       
  7301         
       
  7302     }/*function_time_to_bool*/
       
  7303     break;
       
  7304 
       
  7305 /****
       
  7306  *TIME_TO_BYTE
       
  7307  */
       
  7308     case function_time_to_byte :
       
  7309     {
       
  7310         symbol_c *last_type_symbol = NULL;
       
  7311 
       
  7312         {
       
  7313             identifier_c param_name("IN");
       
  7314             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7315             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7316             
       
  7317             /* Get the value from a foo(<param_value>) style call */
       
  7318             if (IN_param_value == NULL)
       
  7319               IN_param_value = function_call_param_iterator.next();
       
  7320             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7321             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7322             
       
  7323             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7324             {
       
  7325         
       
  7326                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  7327                 s4o.print("(");
       
  7328                 return_type_symbol->accept(*this);
       
  7329                 s4o.print(")__time_to_int(");
       
  7330                 IN_param_value->accept(*this);
       
  7331                 s4o.print(")");
       
  7332                 return NULL;
       
  7333                 
       
  7334             }
       
  7335             
       
  7336             ERROR;
       
  7337         }
       
  7338         
       
  7339     }/*function_time_to_byte*/
       
  7340     break;
       
  7341 
       
  7342 /****
       
  7343  *TIME_TO_WORD
       
  7344  */
       
  7345     case function_time_to_word :
       
  7346     {
       
  7347         symbol_c *last_type_symbol = NULL;
       
  7348 
       
  7349         {
       
  7350             identifier_c param_name("IN");
       
  7351             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7352             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7353             
       
  7354             /* Get the value from a foo(<param_value>) style call */
       
  7355             if (IN_param_value == NULL)
       
  7356               IN_param_value = function_call_param_iterator.next();
       
  7357             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7358             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7359             
       
  7360             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7361             {
       
  7362         
       
  7363                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  7364                 s4o.print("(");
       
  7365                 return_type_symbol->accept(*this);
       
  7366                 s4o.print(")__time_to_int(");
       
  7367                 IN_param_value->accept(*this);
       
  7368                 s4o.print(")");
       
  7369                 return NULL;
       
  7370                 
       
  7371             }
       
  7372             
       
  7373             ERROR;
       
  7374         }
       
  7375         
       
  7376     }/*function_time_to_word*/
       
  7377     break;
       
  7378 
       
  7379 /****
       
  7380  *TIME_TO_DWORD
       
  7381  */
       
  7382     case function_time_to_dword :
       
  7383     {
       
  7384         symbol_c *last_type_symbol = NULL;
       
  7385 
       
  7386         {
       
  7387             identifier_c param_name("IN");
       
  7388             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7389             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7390             
       
  7391             /* Get the value from a foo(<param_value>) style call */
       
  7392             if (IN_param_value == NULL)
       
  7393               IN_param_value = function_call_param_iterator.next();
       
  7394             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7395             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7396             
       
  7397             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7398             {
       
  7399         
       
  7400                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  7401                 s4o.print("(");
       
  7402                 return_type_symbol->accept(*this);
       
  7403                 s4o.print(")__time_to_int(");
       
  7404                 IN_param_value->accept(*this);
       
  7405                 s4o.print(")");
       
  7406                 return NULL;
       
  7407                 
       
  7408             }
       
  7409             
       
  7410             ERROR;
       
  7411         }
       
  7412         
       
  7413     }/*function_time_to_dword*/
       
  7414     break;
       
  7415 
       
  7416 /****
       
  7417  *TIME_TO_LWORD
       
  7418  */
       
  7419     case function_time_to_lword :
       
  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 (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7435             {
       
  7436         
       
  7437                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  7438                 s4o.print("(");
       
  7439                 return_type_symbol->accept(*this);
       
  7440                 s4o.print(")__time_to_int(");
       
  7441                 IN_param_value->accept(*this);
       
  7442                 s4o.print(")");
       
  7443                 return NULL;
       
  7444                 
       
  7445             }
       
  7446             
       
  7447             ERROR;
       
  7448         }
       
  7449         
       
  7450     }/*function_time_to_lword*/
       
  7451     break;
       
  7452 
       
  7453 /****
       
  7454  *TIME_TO_STRING
       
  7455  */
       
  7456     case function_time_to_string :
       
  7457     {
       
  7458         symbol_c *last_type_symbol = NULL;
       
  7459 
       
  7460         {
       
  7461             identifier_c param_name("IN");
       
  7462             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7463             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7464             
       
  7465             /* Get the value from a foo(<param_value>) style call */
       
  7466             if (IN_param_value == NULL)
       
  7467               IN_param_value = function_call_param_iterator.next();
       
  7468             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7469             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7470             
       
  7471             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7472             {
       
  7473         
       
  7474                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  7475                 s4o.print("(");
       
  7476                 return_type_symbol->accept(*this);
       
  7477                 s4o.print(")__time_to_string(");
       
  7478                 IN_param_value->accept(*this);
       
  7479                 s4o.print(")");
       
  7480                 return NULL;
       
  7481                 
       
  7482             }
       
  7483             
       
  7484             ERROR;
       
  7485         }
       
  7486         
       
  7487     }/*function_time_to_string*/
       
  7488     break;
       
  7489 
       
  7490 /****
       
  7491  *BOOL_TO_REAL
       
  7492  */
       
  7493     case function_bool_to_real :
       
  7494     {
       
  7495         symbol_c *last_type_symbol = NULL;
       
  7496 
       
  7497         {
       
  7498             identifier_c param_name("IN");
       
  7499             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7500             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7501             
       
  7502             /* Get the value from a foo(<param_value>) style call */
       
  7503             if (IN_param_value == NULL)
       
  7504               IN_param_value = function_call_param_iterator.next();
       
  7505             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7506             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7507             
       
  7508             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7509             {
       
  7510         
       
  7511                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  7512                 s4o.print("(");
       
  7513                 return_type_symbol->accept(*this);
       
  7514                 s4o.print(")");
       
  7515                 IN_param_value->accept(*this);
       
  7516                 return NULL;
       
  7517                 
       
  7518             }
       
  7519             
       
  7520             ERROR;
       
  7521         }
       
  7522         
       
  7523     }/*function_bool_to_real*/
       
  7524     break;
       
  7525 
       
  7526 /****
       
  7527  *BOOL_TO_LREAL
       
  7528  */
       
  7529     case function_bool_to_lreal :
       
  7530     {
       
  7531         symbol_c *last_type_symbol = NULL;
       
  7532 
       
  7533         {
       
  7534             identifier_c param_name("IN");
       
  7535             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7536             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7537             
       
  7538             /* Get the value from a foo(<param_value>) style call */
       
  7539             if (IN_param_value == NULL)
       
  7540               IN_param_value = function_call_param_iterator.next();
       
  7541             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7542             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7543             
       
  7544             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7545             {
       
  7546         
       
  7547                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  7548                 s4o.print("(");
       
  7549                 return_type_symbol->accept(*this);
       
  7550                 s4o.print(")");
       
  7551                 IN_param_value->accept(*this);
       
  7552                 return NULL;
       
  7553                 
       
  7554             }
       
  7555             
       
  7556             ERROR;
       
  7557         }
       
  7558         
       
  7559     }/*function_bool_to_lreal*/
       
  7560     break;
       
  7561 
       
  7562 /****
       
  7563  *BOOL_TO_SINT
       
  7564  */
       
  7565     case function_bool_to_sint :
       
  7566     {
       
  7567         symbol_c *last_type_symbol = NULL;
       
  7568 
       
  7569         {
       
  7570             identifier_c param_name("IN");
       
  7571             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7572             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7573             
       
  7574             /* Get the value from a foo(<param_value>) style call */
       
  7575             if (IN_param_value == NULL)
       
  7576               IN_param_value = function_call_param_iterator.next();
       
  7577             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7578             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7579             
       
  7580             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7581             {
       
  7582         
       
  7583                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  7584                 s4o.print("(");
       
  7585                 return_type_symbol->accept(*this);
       
  7586                 s4o.print(")");
       
  7587                 IN_param_value->accept(*this);
       
  7588                 return NULL;
       
  7589                 
       
  7590             }
       
  7591             
       
  7592             ERROR;
       
  7593         }
       
  7594         
       
  7595     }/*function_bool_to_sint*/
       
  7596     break;
       
  7597 
       
  7598 /****
       
  7599  *BOOL_TO_INT
       
  7600  */
       
  7601     case function_bool_to_int :
       
  7602     {
       
  7603         symbol_c *last_type_symbol = NULL;
       
  7604 
       
  7605         {
       
  7606             identifier_c param_name("IN");
       
  7607             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7608             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7609             
       
  7610             /* Get the value from a foo(<param_value>) style call */
       
  7611             if (IN_param_value == NULL)
       
  7612               IN_param_value = function_call_param_iterator.next();
       
  7613             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7614             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7615             
       
  7616             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7617             {
       
  7618         
       
  7619                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  7620                 s4o.print("(");
       
  7621                 return_type_symbol->accept(*this);
       
  7622                 s4o.print(")");
       
  7623                 IN_param_value->accept(*this);
       
  7624                 return NULL;
       
  7625                 
       
  7626             }
       
  7627             
       
  7628             ERROR;
       
  7629         }
       
  7630         
       
  7631     }/*function_bool_to_int*/
       
  7632     break;
       
  7633 
       
  7634 /****
       
  7635  *BOOL_TO_DINT
       
  7636  */
       
  7637     case function_bool_to_dint :
       
  7638     {
       
  7639         symbol_c *last_type_symbol = NULL;
       
  7640 
       
  7641         {
       
  7642             identifier_c param_name("IN");
       
  7643             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7644             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7645             
       
  7646             /* Get the value from a foo(<param_value>) style call */
       
  7647             if (IN_param_value == NULL)
       
  7648               IN_param_value = function_call_param_iterator.next();
       
  7649             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7650             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7651             
       
  7652             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7653             {
       
  7654         
       
  7655                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  7656                 s4o.print("(");
       
  7657                 return_type_symbol->accept(*this);
       
  7658                 s4o.print(")");
       
  7659                 IN_param_value->accept(*this);
       
  7660                 return NULL;
       
  7661                 
       
  7662             }
       
  7663             
       
  7664             ERROR;
       
  7665         }
       
  7666         
       
  7667     }/*function_bool_to_dint*/
       
  7668     break;
       
  7669 
       
  7670 /****
       
  7671  *BOOL_TO_LINT
       
  7672  */
       
  7673     case function_bool_to_lint :
       
  7674     {
       
  7675         symbol_c *last_type_symbol = NULL;
       
  7676 
       
  7677         {
       
  7678             identifier_c param_name("IN");
       
  7679             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7680             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7681             
       
  7682             /* Get the value from a foo(<param_value>) style call */
       
  7683             if (IN_param_value == NULL)
       
  7684               IN_param_value = function_call_param_iterator.next();
       
  7685             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7686             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7687             
       
  7688             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7689             {
       
  7690         
       
  7691                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  7692                 s4o.print("(");
       
  7693                 return_type_symbol->accept(*this);
       
  7694                 s4o.print(")");
       
  7695                 IN_param_value->accept(*this);
       
  7696                 return NULL;
       
  7697                 
       
  7698             }
       
  7699             
       
  7700             ERROR;
       
  7701         }
       
  7702         
       
  7703     }/*function_bool_to_lint*/
       
  7704     break;
       
  7705 
       
  7706 /****
       
  7707  *BOOL_TO_USINT
       
  7708  */
       
  7709     case function_bool_to_usint :
       
  7710     {
       
  7711         symbol_c *last_type_symbol = NULL;
       
  7712 
       
  7713         {
       
  7714             identifier_c param_name("IN");
       
  7715             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7716             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7717             
       
  7718             /* Get the value from a foo(<param_value>) style call */
       
  7719             if (IN_param_value == NULL)
       
  7720               IN_param_value = function_call_param_iterator.next();
       
  7721             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7722             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7723             
       
  7724             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7725             {
       
  7726         
       
  7727                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  7728                 s4o.print("(");
       
  7729                 return_type_symbol->accept(*this);
       
  7730                 s4o.print(")");
       
  7731                 IN_param_value->accept(*this);
       
  7732                 return NULL;
       
  7733                 
       
  7734             }
       
  7735             
       
  7736             ERROR;
       
  7737         }
       
  7738         
       
  7739     }/*function_bool_to_usint*/
       
  7740     break;
       
  7741 
       
  7742 /****
       
  7743  *BOOL_TO_UINT
       
  7744  */
       
  7745     case function_bool_to_uint :
       
  7746     {
       
  7747         symbol_c *last_type_symbol = NULL;
       
  7748 
       
  7749         {
       
  7750             identifier_c param_name("IN");
       
  7751             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7752             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7753             
       
  7754             /* Get the value from a foo(<param_value>) style call */
       
  7755             if (IN_param_value == NULL)
       
  7756               IN_param_value = function_call_param_iterator.next();
       
  7757             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7758             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7759             
       
  7760             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7761             {
       
  7762         
       
  7763                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  7764                 s4o.print("(");
       
  7765                 return_type_symbol->accept(*this);
       
  7766                 s4o.print(")");
       
  7767                 IN_param_value->accept(*this);
       
  7768                 return NULL;
       
  7769                 
       
  7770             }
       
  7771             
       
  7772             ERROR;
       
  7773         }
       
  7774         
       
  7775     }/*function_bool_to_uint*/
       
  7776     break;
       
  7777 
       
  7778 /****
       
  7779  *BOOL_TO_UDINT
       
  7780  */
       
  7781     case function_bool_to_udint :
       
  7782     {
       
  7783         symbol_c *last_type_symbol = NULL;
       
  7784 
       
  7785         {
       
  7786             identifier_c param_name("IN");
       
  7787             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7788             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7789             
       
  7790             /* Get the value from a foo(<param_value>) style call */
       
  7791             if (IN_param_value == NULL)
       
  7792               IN_param_value = function_call_param_iterator.next();
       
  7793             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7794             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7795             
       
  7796             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7797             {
       
  7798         
       
  7799                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  7800                 s4o.print("(");
       
  7801                 return_type_symbol->accept(*this);
       
  7802                 s4o.print(")");
       
  7803                 IN_param_value->accept(*this);
       
  7804                 return NULL;
       
  7805                 
       
  7806             }
       
  7807             
       
  7808             ERROR;
       
  7809         }
       
  7810         
       
  7811     }/*function_bool_to_udint*/
       
  7812     break;
       
  7813 
       
  7814 /****
       
  7815  *BOOL_TO_ULINT
       
  7816  */
       
  7817     case function_bool_to_ulint :
       
  7818     {
       
  7819         symbol_c *last_type_symbol = NULL;
       
  7820 
       
  7821         {
       
  7822             identifier_c param_name("IN");
       
  7823             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7824             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7825             
       
  7826             /* Get the value from a foo(<param_value>) style call */
       
  7827             if (IN_param_value == NULL)
       
  7828               IN_param_value = function_call_param_iterator.next();
       
  7829             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7830             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7831             
       
  7832             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7833             {
       
  7834         
       
  7835                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  7836                 s4o.print("(");
       
  7837                 return_type_symbol->accept(*this);
       
  7838                 s4o.print(")");
       
  7839                 IN_param_value->accept(*this);
       
  7840                 return NULL;
       
  7841                 
       
  7842             }
       
  7843             
       
  7844             ERROR;
       
  7845         }
       
  7846         
       
  7847     }/*function_bool_to_ulint*/
       
  7848     break;
       
  7849 
       
  7850 /****
       
  7851  *BOOL_TO_TIME
       
  7852  */
       
  7853     case function_bool_to_time :
       
  7854     {
       
  7855         symbol_c *last_type_symbol = NULL;
       
  7856 
       
  7857         {
       
  7858             identifier_c param_name("IN");
       
  7859             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7860             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7861             
       
  7862             /* Get the value from a foo(<param_value>) style call */
       
  7863             if (IN_param_value == NULL)
       
  7864               IN_param_value = function_call_param_iterator.next();
       
  7865             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7866             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7867             
       
  7868             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
  1077             {
  7869             {
  1078         
  7870         
  1079                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
  7871                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
  1080                 s4o.print("(");
  7872                 s4o.print("(");
  1081                 return_type_symbol->accept(*this);
  7873                 return_type_symbol->accept(*this);
  1082                 s4o.print(")real_to_time(");
  7874                 s4o.print(")__int_to_time(");
  1083                 IN_param_value->accept(*this);
  7875                 IN_param_value->accept(*this);
  1084                 s4o.print(")");
  7876                 s4o.print(")");
  1085                 return NULL;
  7877                 return NULL;
  1086                 
  7878                 
  1087             }
  7879             }
  1088             
  7880             
  1089             ERROR;
  7881             ERROR;
  1090         }
  7882         }
  1091         
  7883         
  1092     }/*function_lreal_to_time*/
  7884     }/*function_bool_to_time*/
  1093     break;
  7885     break;
  1094 
  7886 
  1095 /****
  7887 /****
  1096  *LREAL_TO_BOOL
  7888  *BOOL_TO_BYTE
  1097  */
  7889  */
  1098     case function_lreal_to_bool :
  7890     case function_bool_to_byte :
  1099     {
  7891     {
  1100         symbol_c *last_type_symbol = NULL;
  7892         symbol_c *last_type_symbol = NULL;
  1101 
  7893 
  1102         {
  7894         {
  1103             identifier_c param_name("IN");
  7895             identifier_c param_name("IN");
  1104             /* Get the value from a foo(<param_name> = <param_value>) style call */
  7896             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1105             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  7897             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1106             
  7898             
  1107             /* Get the value from a foo(<param_value>) style call */
  7899             /* Get the value from a foo(<param_value>) style call */
  1108             if (IN_param_value == NULL)
  7900             if (IN_param_value == NULL)
  1109               IN_param_value = function_call_param_iterator.next();
  7901               IN_param_value = function_call_param_iterator.next();
  1110             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  7902             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1111             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  7903             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1112             
  7904             
  1113             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
  7905             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7906             {
       
  7907         
       
  7908                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  7909                 s4o.print("(");
       
  7910                 return_type_symbol->accept(*this);
       
  7911                 s4o.print(")");
       
  7912                 IN_param_value->accept(*this);
       
  7913                 return NULL;
       
  7914                 
       
  7915             }
       
  7916             
       
  7917             ERROR;
       
  7918         }
       
  7919         
       
  7920     }/*function_bool_to_byte*/
       
  7921     break;
       
  7922 
       
  7923 /****
       
  7924  *BOOL_TO_WORD
       
  7925  */
       
  7926     case function_bool_to_word :
       
  7927     {
       
  7928         symbol_c *last_type_symbol = NULL;
       
  7929 
       
  7930         {
       
  7931             identifier_c param_name("IN");
       
  7932             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7933             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7934             
       
  7935             /* Get the value from a foo(<param_value>) style call */
       
  7936             if (IN_param_value == NULL)
       
  7937               IN_param_value = function_call_param_iterator.next();
       
  7938             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7939             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7940             
       
  7941             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7942             {
       
  7943         
       
  7944                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  7945                 s4o.print("(");
       
  7946                 return_type_symbol->accept(*this);
       
  7947                 s4o.print(")");
       
  7948                 IN_param_value->accept(*this);
       
  7949                 return NULL;
       
  7950                 
       
  7951             }
       
  7952             
       
  7953             ERROR;
       
  7954         }
       
  7955         
       
  7956     }/*function_bool_to_word*/
       
  7957     break;
       
  7958 
       
  7959 /****
       
  7960  *BOOL_TO_DWORD
       
  7961  */
       
  7962     case function_bool_to_dword :
       
  7963     {
       
  7964         symbol_c *last_type_symbol = NULL;
       
  7965 
       
  7966         {
       
  7967             identifier_c param_name("IN");
       
  7968             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7969             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7970             
       
  7971             /* Get the value from a foo(<param_value>) style call */
       
  7972             if (IN_param_value == NULL)
       
  7973               IN_param_value = function_call_param_iterator.next();
       
  7974             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7975             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7976             
       
  7977             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7978             {
       
  7979         
       
  7980                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  7981                 s4o.print("(");
       
  7982                 return_type_symbol->accept(*this);
       
  7983                 s4o.print(")");
       
  7984                 IN_param_value->accept(*this);
       
  7985                 return NULL;
       
  7986                 
       
  7987             }
       
  7988             
       
  7989             ERROR;
       
  7990         }
       
  7991         
       
  7992     }/*function_bool_to_dword*/
       
  7993     break;
       
  7994 
       
  7995 /****
       
  7996  *BOOL_TO_LWORD
       
  7997  */
       
  7998     case function_bool_to_lword :
       
  7999     {
       
  8000         symbol_c *last_type_symbol = NULL;
       
  8001 
       
  8002         {
       
  8003             identifier_c param_name("IN");
       
  8004             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8005             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8006             
       
  8007             /* Get the value from a foo(<param_value>) style call */
       
  8008             if (IN_param_value == NULL)
       
  8009               IN_param_value = function_call_param_iterator.next();
       
  8010             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8011             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8012             
       
  8013             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8014             {
       
  8015         
       
  8016                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  8017                 s4o.print("(");
       
  8018                 return_type_symbol->accept(*this);
       
  8019                 s4o.print(")");
       
  8020                 IN_param_value->accept(*this);
       
  8021                 return NULL;
       
  8022                 
       
  8023             }
       
  8024             
       
  8025             ERROR;
       
  8026         }
       
  8027         
       
  8028     }/*function_bool_to_lword*/
       
  8029     break;
       
  8030 
       
  8031 /****
       
  8032  *BOOL_TO_STRING
       
  8033  */
       
  8034     case function_bool_to_string :
       
  8035     {
       
  8036         symbol_c *last_type_symbol = NULL;
       
  8037 
       
  8038         {
       
  8039             identifier_c param_name("IN");
       
  8040             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8041             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8042             
       
  8043             /* Get the value from a foo(<param_value>) style call */
       
  8044             if (IN_param_value == NULL)
       
  8045               IN_param_value = function_call_param_iterator.next();
       
  8046             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8047             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8048             
       
  8049             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8050             {
       
  8051         
       
  8052                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  8053                 s4o.print("(");
       
  8054                 return_type_symbol->accept(*this);
       
  8055                 s4o.print(")__bool_to_string(");
       
  8056                 IN_param_value->accept(*this);
       
  8057                 s4o.print(")");
       
  8058                 return NULL;
       
  8059                 
       
  8060             }
       
  8061             
       
  8062             ERROR;
       
  8063         }
       
  8064         
       
  8065     }/*function_bool_to_string*/
       
  8066     break;
       
  8067 
       
  8068 /****
       
  8069  *BOOL_TO_DATE
       
  8070  */
       
  8071     case function_bool_to_date :
       
  8072     {
       
  8073         symbol_c *last_type_symbol = NULL;
       
  8074 
       
  8075         {
       
  8076             identifier_c param_name("IN");
       
  8077             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8078             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8079             
       
  8080             /* Get the value from a foo(<param_value>) style call */
       
  8081             if (IN_param_value == NULL)
       
  8082               IN_param_value = function_call_param_iterator.next();
       
  8083             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8084             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8085             
       
  8086             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8087             {
       
  8088         
       
  8089                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  8090                 s4o.print("(");
       
  8091                 return_type_symbol->accept(*this);
       
  8092                 s4o.print(")__int_to_time(");
       
  8093                 IN_param_value->accept(*this);
       
  8094                 s4o.print(")");
       
  8095                 return NULL;
       
  8096                 
       
  8097             }
       
  8098             
       
  8099             ERROR;
       
  8100         }
       
  8101         
       
  8102     }/*function_bool_to_date*/
       
  8103     break;
       
  8104 
       
  8105 /****
       
  8106  *BOOL_TO_TOD
       
  8107  */
       
  8108     case function_bool_to_tod :
       
  8109     {
       
  8110         symbol_c *last_type_symbol = NULL;
       
  8111 
       
  8112         {
       
  8113             identifier_c param_name("IN");
       
  8114             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8115             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8116             
       
  8117             /* Get the value from a foo(<param_value>) style call */
       
  8118             if (IN_param_value == NULL)
       
  8119               IN_param_value = function_call_param_iterator.next();
       
  8120             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8121             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8122             
       
  8123             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8124             {
       
  8125         
       
  8126                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  8127                 s4o.print("(");
       
  8128                 return_type_symbol->accept(*this);
       
  8129                 s4o.print(")__int_to_time(");
       
  8130                 IN_param_value->accept(*this);
       
  8131                 s4o.print(")");
       
  8132                 return NULL;
       
  8133                 
       
  8134             }
       
  8135             
       
  8136             ERROR;
       
  8137         }
       
  8138         
       
  8139     }/*function_bool_to_tod*/
       
  8140     break;
       
  8141 
       
  8142 /****
       
  8143  *BOOL_TO_DT
       
  8144  */
       
  8145     case function_bool_to_dt :
       
  8146     {
       
  8147         symbol_c *last_type_symbol = NULL;
       
  8148 
       
  8149         {
       
  8150             identifier_c param_name("IN");
       
  8151             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8152             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8153             
       
  8154             /* Get the value from a foo(<param_value>) style call */
       
  8155             if (IN_param_value == NULL)
       
  8156               IN_param_value = function_call_param_iterator.next();
       
  8157             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8158             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8159             
       
  8160             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8161             {
       
  8162         
       
  8163                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  8164                 s4o.print("(");
       
  8165                 return_type_symbol->accept(*this);
       
  8166                 s4o.print(")__int_to_time(");
       
  8167                 IN_param_value->accept(*this);
       
  8168                 s4o.print(")");
       
  8169                 return NULL;
       
  8170                 
       
  8171             }
       
  8172             
       
  8173             ERROR;
       
  8174         }
       
  8175         
       
  8176     }/*function_bool_to_dt*/
       
  8177     break;
       
  8178 
       
  8179 /****
       
  8180  *BYTE_TO_REAL
       
  8181  */
       
  8182     case function_byte_to_real :
       
  8183     {
       
  8184         symbol_c *last_type_symbol = NULL;
       
  8185 
       
  8186         {
       
  8187             identifier_c param_name("IN");
       
  8188             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8189             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8190             
       
  8191             /* Get the value from a foo(<param_value>) style call */
       
  8192             if (IN_param_value == NULL)
       
  8193               IN_param_value = function_call_param_iterator.next();
       
  8194             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8195             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8196             
       
  8197             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8198             {
       
  8199         
       
  8200                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  8201                 s4o.print("(");
       
  8202                 return_type_symbol->accept(*this);
       
  8203                 s4o.print(")");
       
  8204                 IN_param_value->accept(*this);
       
  8205                 return NULL;
       
  8206                 
       
  8207             }
       
  8208             
       
  8209             ERROR;
       
  8210         }
       
  8211         
       
  8212     }/*function_byte_to_real*/
       
  8213     break;
       
  8214 
       
  8215 /****
       
  8216  *BYTE_TO_LREAL
       
  8217  */
       
  8218     case function_byte_to_lreal :
       
  8219     {
       
  8220         symbol_c *last_type_symbol = NULL;
       
  8221 
       
  8222         {
       
  8223             identifier_c param_name("IN");
       
  8224             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8225             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8226             
       
  8227             /* Get the value from a foo(<param_value>) style call */
       
  8228             if (IN_param_value == NULL)
       
  8229               IN_param_value = function_call_param_iterator.next();
       
  8230             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8231             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8232             
       
  8233             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8234             {
       
  8235         
       
  8236                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  8237                 s4o.print("(");
       
  8238                 return_type_symbol->accept(*this);
       
  8239                 s4o.print(")");
       
  8240                 IN_param_value->accept(*this);
       
  8241                 return NULL;
       
  8242                 
       
  8243             }
       
  8244             
       
  8245             ERROR;
       
  8246         }
       
  8247         
       
  8248     }/*function_byte_to_lreal*/
       
  8249     break;
       
  8250 
       
  8251 /****
       
  8252  *BYTE_TO_SINT
       
  8253  */
       
  8254     case function_byte_to_sint :
       
  8255     {
       
  8256         symbol_c *last_type_symbol = NULL;
       
  8257 
       
  8258         {
       
  8259             identifier_c param_name("IN");
       
  8260             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8261             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8262             
       
  8263             /* Get the value from a foo(<param_value>) style call */
       
  8264             if (IN_param_value == NULL)
       
  8265               IN_param_value = function_call_param_iterator.next();
       
  8266             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8267             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8268             
       
  8269             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8270             {
       
  8271         
       
  8272                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  8273                 s4o.print("(");
       
  8274                 return_type_symbol->accept(*this);
       
  8275                 s4o.print(")");
       
  8276                 IN_param_value->accept(*this);
       
  8277                 return NULL;
       
  8278                 
       
  8279             }
       
  8280             
       
  8281             ERROR;
       
  8282         }
       
  8283         
       
  8284     }/*function_byte_to_sint*/
       
  8285     break;
       
  8286 
       
  8287 /****
       
  8288  *BYTE_TO_INT
       
  8289  */
       
  8290     case function_byte_to_int :
       
  8291     {
       
  8292         symbol_c *last_type_symbol = NULL;
       
  8293 
       
  8294         {
       
  8295             identifier_c param_name("IN");
       
  8296             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8297             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8298             
       
  8299             /* Get the value from a foo(<param_value>) style call */
       
  8300             if (IN_param_value == NULL)
       
  8301               IN_param_value = function_call_param_iterator.next();
       
  8302             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8303             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8304             
       
  8305             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8306             {
       
  8307         
       
  8308                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  8309                 s4o.print("(");
       
  8310                 return_type_symbol->accept(*this);
       
  8311                 s4o.print(")");
       
  8312                 IN_param_value->accept(*this);
       
  8313                 return NULL;
       
  8314                 
       
  8315             }
       
  8316             
       
  8317             ERROR;
       
  8318         }
       
  8319         
       
  8320     }/*function_byte_to_int*/
       
  8321     break;
       
  8322 
       
  8323 /****
       
  8324  *BYTE_TO_DINT
       
  8325  */
       
  8326     case function_byte_to_dint :
       
  8327     {
       
  8328         symbol_c *last_type_symbol = NULL;
       
  8329 
       
  8330         {
       
  8331             identifier_c param_name("IN");
       
  8332             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8333             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8334             
       
  8335             /* Get the value from a foo(<param_value>) style call */
       
  8336             if (IN_param_value == NULL)
       
  8337               IN_param_value = function_call_param_iterator.next();
       
  8338             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8339             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8340             
       
  8341             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8342             {
       
  8343         
       
  8344                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  8345                 s4o.print("(");
       
  8346                 return_type_symbol->accept(*this);
       
  8347                 s4o.print(")");
       
  8348                 IN_param_value->accept(*this);
       
  8349                 return NULL;
       
  8350                 
       
  8351             }
       
  8352             
       
  8353             ERROR;
       
  8354         }
       
  8355         
       
  8356     }/*function_byte_to_dint*/
       
  8357     break;
       
  8358 
       
  8359 /****
       
  8360  *BYTE_TO_LINT
       
  8361  */
       
  8362     case function_byte_to_lint :
       
  8363     {
       
  8364         symbol_c *last_type_symbol = NULL;
       
  8365 
       
  8366         {
       
  8367             identifier_c param_name("IN");
       
  8368             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8369             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8370             
       
  8371             /* Get the value from a foo(<param_value>) style call */
       
  8372             if (IN_param_value == NULL)
       
  8373               IN_param_value = function_call_param_iterator.next();
       
  8374             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8375             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8376             
       
  8377             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8378             {
       
  8379         
       
  8380                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  8381                 s4o.print("(");
       
  8382                 return_type_symbol->accept(*this);
       
  8383                 s4o.print(")");
       
  8384                 IN_param_value->accept(*this);
       
  8385                 return NULL;
       
  8386                 
       
  8387             }
       
  8388             
       
  8389             ERROR;
       
  8390         }
       
  8391         
       
  8392     }/*function_byte_to_lint*/
       
  8393     break;
       
  8394 
       
  8395 /****
       
  8396  *BYTE_TO_USINT
       
  8397  */
       
  8398     case function_byte_to_usint :
       
  8399     {
       
  8400         symbol_c *last_type_symbol = NULL;
       
  8401 
       
  8402         {
       
  8403             identifier_c param_name("IN");
       
  8404             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8405             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8406             
       
  8407             /* Get the value from a foo(<param_value>) style call */
       
  8408             if (IN_param_value == NULL)
       
  8409               IN_param_value = function_call_param_iterator.next();
       
  8410             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8411             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8412             
       
  8413             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8414             {
       
  8415         
       
  8416                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  8417                 s4o.print("(");
       
  8418                 return_type_symbol->accept(*this);
       
  8419                 s4o.print(")");
       
  8420                 IN_param_value->accept(*this);
       
  8421                 return NULL;
       
  8422                 
       
  8423             }
       
  8424             
       
  8425             ERROR;
       
  8426         }
       
  8427         
       
  8428     }/*function_byte_to_usint*/
       
  8429     break;
       
  8430 
       
  8431 /****
       
  8432  *BYTE_TO_UINT
       
  8433  */
       
  8434     case function_byte_to_uint :
       
  8435     {
       
  8436         symbol_c *last_type_symbol = NULL;
       
  8437 
       
  8438         {
       
  8439             identifier_c param_name("IN");
       
  8440             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8441             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8442             
       
  8443             /* Get the value from a foo(<param_value>) style call */
       
  8444             if (IN_param_value == NULL)
       
  8445               IN_param_value = function_call_param_iterator.next();
       
  8446             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8447             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8448             
       
  8449             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8450             {
       
  8451         
       
  8452                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  8453                 s4o.print("(");
       
  8454                 return_type_symbol->accept(*this);
       
  8455                 s4o.print(")");
       
  8456                 IN_param_value->accept(*this);
       
  8457                 return NULL;
       
  8458                 
       
  8459             }
       
  8460             
       
  8461             ERROR;
       
  8462         }
       
  8463         
       
  8464     }/*function_byte_to_uint*/
       
  8465     break;
       
  8466 
       
  8467 /****
       
  8468  *BYTE_TO_UDINT
       
  8469  */
       
  8470     case function_byte_to_udint :
       
  8471     {
       
  8472         symbol_c *last_type_symbol = NULL;
       
  8473 
       
  8474         {
       
  8475             identifier_c param_name("IN");
       
  8476             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8477             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8478             
       
  8479             /* Get the value from a foo(<param_value>) style call */
       
  8480             if (IN_param_value == NULL)
       
  8481               IN_param_value = function_call_param_iterator.next();
       
  8482             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8483             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8484             
       
  8485             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8486             {
       
  8487         
       
  8488                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  8489                 s4o.print("(");
       
  8490                 return_type_symbol->accept(*this);
       
  8491                 s4o.print(")");
       
  8492                 IN_param_value->accept(*this);
       
  8493                 return NULL;
       
  8494                 
       
  8495             }
       
  8496             
       
  8497             ERROR;
       
  8498         }
       
  8499         
       
  8500     }/*function_byte_to_udint*/
       
  8501     break;
       
  8502 
       
  8503 /****
       
  8504  *BYTE_TO_ULINT
       
  8505  */
       
  8506     case function_byte_to_ulint :
       
  8507     {
       
  8508         symbol_c *last_type_symbol = NULL;
       
  8509 
       
  8510         {
       
  8511             identifier_c param_name("IN");
       
  8512             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8513             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8514             
       
  8515             /* Get the value from a foo(<param_value>) style call */
       
  8516             if (IN_param_value == NULL)
       
  8517               IN_param_value = function_call_param_iterator.next();
       
  8518             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8519             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8520             
       
  8521             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8522             {
       
  8523         
       
  8524                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  8525                 s4o.print("(");
       
  8526                 return_type_symbol->accept(*this);
       
  8527                 s4o.print(")");
       
  8528                 IN_param_value->accept(*this);
       
  8529                 return NULL;
       
  8530                 
       
  8531             }
       
  8532             
       
  8533             ERROR;
       
  8534         }
       
  8535         
       
  8536     }/*function_byte_to_ulint*/
       
  8537     break;
       
  8538 
       
  8539 /****
       
  8540  *BYTE_TO_TIME
       
  8541  */
       
  8542     case function_byte_to_time :
       
  8543     {
       
  8544         symbol_c *last_type_symbol = NULL;
       
  8545 
       
  8546         {
       
  8547             identifier_c param_name("IN");
       
  8548             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8549             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8550             
       
  8551             /* Get the value from a foo(<param_value>) style call */
       
  8552             if (IN_param_value == NULL)
       
  8553               IN_param_value = function_call_param_iterator.next();
       
  8554             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8555             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8556             
       
  8557             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8558             {
       
  8559         
       
  8560                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  8561                 s4o.print("(");
       
  8562                 return_type_symbol->accept(*this);
       
  8563                 s4o.print(")__int_to_time(");
       
  8564                 IN_param_value->accept(*this);
       
  8565                 s4o.print(")");
       
  8566                 return NULL;
       
  8567                 
       
  8568             }
       
  8569             
       
  8570             ERROR;
       
  8571         }
       
  8572         
       
  8573     }/*function_byte_to_time*/
       
  8574     break;
       
  8575 
       
  8576 /****
       
  8577  *BYTE_TO_BOOL
       
  8578  */
       
  8579     case function_byte_to_bool :
       
  8580     {
       
  8581         symbol_c *last_type_symbol = NULL;
       
  8582 
       
  8583         {
       
  8584             identifier_c param_name("IN");
       
  8585             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8586             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8587             
       
  8588             /* Get the value from a foo(<param_value>) style call */
       
  8589             if (IN_param_value == NULL)
       
  8590               IN_param_value = function_call_param_iterator.next();
       
  8591             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8592             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8593             
       
  8594             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
  1114             {
  8595             {
  1115         
  8596         
  1116                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
  8597                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
  1117                 s4o.print("(");
  8598                 s4o.print("(");
  1118                 return_type_symbol->accept(*this);
  8599                 return_type_symbol->accept(*this);
  1123             }
  8604             }
  1124             
  8605             
  1125             ERROR;
  8606             ERROR;
  1126         }
  8607         }
  1127         
  8608         
  1128     }/*function_lreal_to_bool*/
  8609     }/*function_byte_to_bool*/
  1129     break;
  8610     break;
  1130 
  8611 
  1131 /****
  8612 /****
  1132  *LREAL_TO_BYTE
  8613  *BYTE_TO_WORD
  1133  */
  8614  */
  1134     case function_lreal_to_byte :
  8615     case function_byte_to_word :
  1135     {
  8616     {
  1136         symbol_c *last_type_symbol = NULL;
  8617         symbol_c *last_type_symbol = NULL;
  1137 
  8618 
  1138         {
  8619         {
  1139             identifier_c param_name("IN");
  8620             identifier_c param_name("IN");
  1140             /* Get the value from a foo(<param_name> = <param_value>) style call */
  8621             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1141             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  8622             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1142             
  8623             
  1143             /* Get the value from a foo(<param_value>) style call */
  8624             /* Get the value from a foo(<param_value>) style call */
  1144             if (IN_param_value == NULL)
  8625             if (IN_param_value == NULL)
  1145               IN_param_value = function_call_param_iterator.next();
  8626               IN_param_value = function_call_param_iterator.next();
  1146             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  8627             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1147             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  8628             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1148             
  8629             
  1149             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
  8630             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8631             {
       
  8632         
       
  8633                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  8634                 s4o.print("(");
       
  8635                 return_type_symbol->accept(*this);
       
  8636                 s4o.print(")");
       
  8637                 IN_param_value->accept(*this);
       
  8638                 return NULL;
       
  8639                 
       
  8640             }
       
  8641             
       
  8642             ERROR;
       
  8643         }
       
  8644         
       
  8645     }/*function_byte_to_word*/
       
  8646     break;
       
  8647 
       
  8648 /****
       
  8649  *BYTE_TO_DWORD
       
  8650  */
       
  8651     case function_byte_to_dword :
       
  8652     {
       
  8653         symbol_c *last_type_symbol = NULL;
       
  8654 
       
  8655         {
       
  8656             identifier_c param_name("IN");
       
  8657             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8658             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8659             
       
  8660             /* Get the value from a foo(<param_value>) style call */
       
  8661             if (IN_param_value == NULL)
       
  8662               IN_param_value = function_call_param_iterator.next();
       
  8663             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8664             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8665             
       
  8666             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8667             {
       
  8668         
       
  8669                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  8670                 s4o.print("(");
       
  8671                 return_type_symbol->accept(*this);
       
  8672                 s4o.print(")");
       
  8673                 IN_param_value->accept(*this);
       
  8674                 return NULL;
       
  8675                 
       
  8676             }
       
  8677             
       
  8678             ERROR;
       
  8679         }
       
  8680         
       
  8681     }/*function_byte_to_dword*/
       
  8682     break;
       
  8683 
       
  8684 /****
       
  8685  *BYTE_TO_LWORD
       
  8686  */
       
  8687     case function_byte_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 (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  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(")");
       
  8709                 IN_param_value->accept(*this);
       
  8710                 return NULL;
       
  8711                 
       
  8712             }
       
  8713             
       
  8714             ERROR;
       
  8715         }
       
  8716         
       
  8717     }/*function_byte_to_lword*/
       
  8718     break;
       
  8719 
       
  8720 /****
       
  8721  *BYTE_TO_STRING
       
  8722  */
       
  8723     case function_byte_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 (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8739             {
       
  8740         
       
  8741                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  8742                 s4o.print("(");
       
  8743                 return_type_symbol->accept(*this);
       
  8744                 s4o.print(")__bit_to_string(");
       
  8745                 IN_param_value->accept(*this);
       
  8746                 s4o.print(")");
       
  8747                 return NULL;
       
  8748                 
       
  8749             }
       
  8750             
       
  8751             ERROR;
       
  8752         }
       
  8753         
       
  8754     }/*function_byte_to_string*/
       
  8755     break;
       
  8756 
       
  8757 /****
       
  8758  *BYTE_TO_DATE
       
  8759  */
       
  8760     case function_byte_to_date :
       
  8761     {
       
  8762         symbol_c *last_type_symbol = NULL;
       
  8763 
       
  8764         {
       
  8765             identifier_c param_name("IN");
       
  8766             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8767             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8768             
       
  8769             /* Get the value from a foo(<param_value>) style call */
       
  8770             if (IN_param_value == NULL)
       
  8771               IN_param_value = function_call_param_iterator.next();
       
  8772             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8773             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8774             
       
  8775             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8776             {
       
  8777         
       
  8778                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  8779                 s4o.print("(");
       
  8780                 return_type_symbol->accept(*this);
       
  8781                 s4o.print(")__int_to_time(");
       
  8782                 IN_param_value->accept(*this);
       
  8783                 s4o.print(")");
       
  8784                 return NULL;
       
  8785                 
       
  8786             }
       
  8787             
       
  8788             ERROR;
       
  8789         }
       
  8790         
       
  8791     }/*function_byte_to_date*/
       
  8792     break;
       
  8793 
       
  8794 /****
       
  8795  *BYTE_TO_TOD
       
  8796  */
       
  8797     case function_byte_to_tod :
       
  8798     {
       
  8799         symbol_c *last_type_symbol = NULL;
       
  8800 
       
  8801         {
       
  8802             identifier_c param_name("IN");
       
  8803             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8804             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8805             
       
  8806             /* Get the value from a foo(<param_value>) style call */
       
  8807             if (IN_param_value == NULL)
       
  8808               IN_param_value = function_call_param_iterator.next();
       
  8809             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8810             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8811             
       
  8812             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8813             {
       
  8814         
       
  8815                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  8816                 s4o.print("(");
       
  8817                 return_type_symbol->accept(*this);
       
  8818                 s4o.print(")__int_to_time(");
       
  8819                 IN_param_value->accept(*this);
       
  8820                 s4o.print(")");
       
  8821                 return NULL;
       
  8822                 
       
  8823             }
       
  8824             
       
  8825             ERROR;
       
  8826         }
       
  8827         
       
  8828     }/*function_byte_to_tod*/
       
  8829     break;
       
  8830 
       
  8831 /****
       
  8832  *BYTE_TO_DT
       
  8833  */
       
  8834     case function_byte_to_dt :
       
  8835     {
       
  8836         symbol_c *last_type_symbol = NULL;
       
  8837 
       
  8838         {
       
  8839             identifier_c param_name("IN");
       
  8840             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8841             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8842             
       
  8843             /* Get the value from a foo(<param_value>) style call */
       
  8844             if (IN_param_value == NULL)
       
  8845               IN_param_value = function_call_param_iterator.next();
       
  8846             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8847             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8848             
       
  8849             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8850             {
       
  8851         
       
  8852                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  8853                 s4o.print("(");
       
  8854                 return_type_symbol->accept(*this);
       
  8855                 s4o.print(")__int_to_time(");
       
  8856                 IN_param_value->accept(*this);
       
  8857                 s4o.print(")");
       
  8858                 return NULL;
       
  8859                 
       
  8860             }
       
  8861             
       
  8862             ERROR;
       
  8863         }
       
  8864         
       
  8865     }/*function_byte_to_dt*/
       
  8866     break;
       
  8867 
       
  8868 /****
       
  8869  *WORD_TO_REAL
       
  8870  */
       
  8871     case function_word_to_real :
       
  8872     {
       
  8873         symbol_c *last_type_symbol = NULL;
       
  8874 
       
  8875         {
       
  8876             identifier_c param_name("IN");
       
  8877             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8878             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8879             
       
  8880             /* Get the value from a foo(<param_value>) style call */
       
  8881             if (IN_param_value == NULL)
       
  8882               IN_param_value = function_call_param_iterator.next();
       
  8883             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8884             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8885             
       
  8886             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  8887             {
       
  8888         
       
  8889                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  8890                 s4o.print("(");
       
  8891                 return_type_symbol->accept(*this);
       
  8892                 s4o.print(")");
       
  8893                 IN_param_value->accept(*this);
       
  8894                 return NULL;
       
  8895                 
       
  8896             }
       
  8897             
       
  8898             ERROR;
       
  8899         }
       
  8900         
       
  8901     }/*function_word_to_real*/
       
  8902     break;
       
  8903 
       
  8904 /****
       
  8905  *WORD_TO_LREAL
       
  8906  */
       
  8907     case function_word_to_lreal :
       
  8908     {
       
  8909         symbol_c *last_type_symbol = NULL;
       
  8910 
       
  8911         {
       
  8912             identifier_c param_name("IN");
       
  8913             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8914             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8915             
       
  8916             /* Get the value from a foo(<param_value>) style call */
       
  8917             if (IN_param_value == NULL)
       
  8918               IN_param_value = function_call_param_iterator.next();
       
  8919             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8920             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8921             
       
  8922             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  8923             {
       
  8924         
       
  8925                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  8926                 s4o.print("(");
       
  8927                 return_type_symbol->accept(*this);
       
  8928                 s4o.print(")");
       
  8929                 IN_param_value->accept(*this);
       
  8930                 return NULL;
       
  8931                 
       
  8932             }
       
  8933             
       
  8934             ERROR;
       
  8935         }
       
  8936         
       
  8937     }/*function_word_to_lreal*/
       
  8938     break;
       
  8939 
       
  8940 /****
       
  8941  *WORD_TO_SINT
       
  8942  */
       
  8943     case function_word_to_sint :
       
  8944     {
       
  8945         symbol_c *last_type_symbol = NULL;
       
  8946 
       
  8947         {
       
  8948             identifier_c param_name("IN");
       
  8949             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8950             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8951             
       
  8952             /* Get the value from a foo(<param_value>) style call */
       
  8953             if (IN_param_value == NULL)
       
  8954               IN_param_value = function_call_param_iterator.next();
       
  8955             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8956             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8957             
       
  8958             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  8959             {
       
  8960         
       
  8961                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  8962                 s4o.print("(");
       
  8963                 return_type_symbol->accept(*this);
       
  8964                 s4o.print(")");
       
  8965                 IN_param_value->accept(*this);
       
  8966                 return NULL;
       
  8967                 
       
  8968             }
       
  8969             
       
  8970             ERROR;
       
  8971         }
       
  8972         
       
  8973     }/*function_word_to_sint*/
       
  8974     break;
       
  8975 
       
  8976 /****
       
  8977  *WORD_TO_INT
       
  8978  */
       
  8979     case function_word_to_int :
       
  8980     {
       
  8981         symbol_c *last_type_symbol = NULL;
       
  8982 
       
  8983         {
       
  8984             identifier_c param_name("IN");
       
  8985             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8986             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8987             
       
  8988             /* Get the value from a foo(<param_value>) style call */
       
  8989             if (IN_param_value == NULL)
       
  8990               IN_param_value = function_call_param_iterator.next();
       
  8991             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8992             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8993             
       
  8994             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  8995             {
       
  8996         
       
  8997                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  8998                 s4o.print("(");
       
  8999                 return_type_symbol->accept(*this);
       
  9000                 s4o.print(")");
       
  9001                 IN_param_value->accept(*this);
       
  9002                 return NULL;
       
  9003                 
       
  9004             }
       
  9005             
       
  9006             ERROR;
       
  9007         }
       
  9008         
       
  9009     }/*function_word_to_int*/
       
  9010     break;
       
  9011 
       
  9012 /****
       
  9013  *WORD_TO_DINT
       
  9014  */
       
  9015     case function_word_to_dint :
       
  9016     {
       
  9017         symbol_c *last_type_symbol = NULL;
       
  9018 
       
  9019         {
       
  9020             identifier_c param_name("IN");
       
  9021             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9022             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9023             
       
  9024             /* Get the value from a foo(<param_value>) style call */
       
  9025             if (IN_param_value == NULL)
       
  9026               IN_param_value = function_call_param_iterator.next();
       
  9027             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9028             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9029             
       
  9030             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9031             {
       
  9032         
       
  9033                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  9034                 s4o.print("(");
       
  9035                 return_type_symbol->accept(*this);
       
  9036                 s4o.print(")");
       
  9037                 IN_param_value->accept(*this);
       
  9038                 return NULL;
       
  9039                 
       
  9040             }
       
  9041             
       
  9042             ERROR;
       
  9043         }
       
  9044         
       
  9045     }/*function_word_to_dint*/
       
  9046     break;
       
  9047 
       
  9048 /****
       
  9049  *WORD_TO_LINT
       
  9050  */
       
  9051     case function_word_to_lint :
       
  9052     {
       
  9053         symbol_c *last_type_symbol = NULL;
       
  9054 
       
  9055         {
       
  9056             identifier_c param_name("IN");
       
  9057             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9058             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9059             
       
  9060             /* Get the value from a foo(<param_value>) style call */
       
  9061             if (IN_param_value == NULL)
       
  9062               IN_param_value = function_call_param_iterator.next();
       
  9063             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9064             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9065             
       
  9066             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9067             {
       
  9068         
       
  9069                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  9070                 s4o.print("(");
       
  9071                 return_type_symbol->accept(*this);
       
  9072                 s4o.print(")");
       
  9073                 IN_param_value->accept(*this);
       
  9074                 return NULL;
       
  9075                 
       
  9076             }
       
  9077             
       
  9078             ERROR;
       
  9079         }
       
  9080         
       
  9081     }/*function_word_to_lint*/
       
  9082     break;
       
  9083 
       
  9084 /****
       
  9085  *WORD_TO_USINT
       
  9086  */
       
  9087     case function_word_to_usint :
       
  9088     {
       
  9089         symbol_c *last_type_symbol = NULL;
       
  9090 
       
  9091         {
       
  9092             identifier_c param_name("IN");
       
  9093             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9094             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9095             
       
  9096             /* Get the value from a foo(<param_value>) style call */
       
  9097             if (IN_param_value == NULL)
       
  9098               IN_param_value = function_call_param_iterator.next();
       
  9099             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9100             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9101             
       
  9102             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9103             {
       
  9104         
       
  9105                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  9106                 s4o.print("(");
       
  9107                 return_type_symbol->accept(*this);
       
  9108                 s4o.print(")");
       
  9109                 IN_param_value->accept(*this);
       
  9110                 return NULL;
       
  9111                 
       
  9112             }
       
  9113             
       
  9114             ERROR;
       
  9115         }
       
  9116         
       
  9117     }/*function_word_to_usint*/
       
  9118     break;
       
  9119 
       
  9120 /****
       
  9121  *WORD_TO_UINT
       
  9122  */
       
  9123     case function_word_to_uint :
       
  9124     {
       
  9125         symbol_c *last_type_symbol = NULL;
       
  9126 
       
  9127         {
       
  9128             identifier_c param_name("IN");
       
  9129             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9130             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9131             
       
  9132             /* Get the value from a foo(<param_value>) style call */
       
  9133             if (IN_param_value == NULL)
       
  9134               IN_param_value = function_call_param_iterator.next();
       
  9135             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9136             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9137             
       
  9138             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9139             {
       
  9140         
       
  9141                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  9142                 s4o.print("(");
       
  9143                 return_type_symbol->accept(*this);
       
  9144                 s4o.print(")");
       
  9145                 IN_param_value->accept(*this);
       
  9146                 return NULL;
       
  9147                 
       
  9148             }
       
  9149             
       
  9150             ERROR;
       
  9151         }
       
  9152         
       
  9153     }/*function_word_to_uint*/
       
  9154     break;
       
  9155 
       
  9156 /****
       
  9157  *WORD_TO_UDINT
       
  9158  */
       
  9159     case function_word_to_udint :
       
  9160     {
       
  9161         symbol_c *last_type_symbol = NULL;
       
  9162 
       
  9163         {
       
  9164             identifier_c param_name("IN");
       
  9165             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9166             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9167             
       
  9168             /* Get the value from a foo(<param_value>) style call */
       
  9169             if (IN_param_value == NULL)
       
  9170               IN_param_value = function_call_param_iterator.next();
       
  9171             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9172             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9173             
       
  9174             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9175             {
       
  9176         
       
  9177                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  9178                 s4o.print("(");
       
  9179                 return_type_symbol->accept(*this);
       
  9180                 s4o.print(")");
       
  9181                 IN_param_value->accept(*this);
       
  9182                 return NULL;
       
  9183                 
       
  9184             }
       
  9185             
       
  9186             ERROR;
       
  9187         }
       
  9188         
       
  9189     }/*function_word_to_udint*/
       
  9190     break;
       
  9191 
       
  9192 /****
       
  9193  *WORD_TO_ULINT
       
  9194  */
       
  9195     case function_word_to_ulint :
       
  9196     {
       
  9197         symbol_c *last_type_symbol = NULL;
       
  9198 
       
  9199         {
       
  9200             identifier_c param_name("IN");
       
  9201             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9202             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9203             
       
  9204             /* Get the value from a foo(<param_value>) style call */
       
  9205             if (IN_param_value == NULL)
       
  9206               IN_param_value = function_call_param_iterator.next();
       
  9207             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9208             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9209             
       
  9210             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9211             {
       
  9212         
       
  9213                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  9214                 s4o.print("(");
       
  9215                 return_type_symbol->accept(*this);
       
  9216                 s4o.print(")");
       
  9217                 IN_param_value->accept(*this);
       
  9218                 return NULL;
       
  9219                 
       
  9220             }
       
  9221             
       
  9222             ERROR;
       
  9223         }
       
  9224         
       
  9225     }/*function_word_to_ulint*/
       
  9226     break;
       
  9227 
       
  9228 /****
       
  9229  *WORD_TO_TIME
       
  9230  */
       
  9231     case function_word_to_time :
       
  9232     {
       
  9233         symbol_c *last_type_symbol = NULL;
       
  9234 
       
  9235         {
       
  9236             identifier_c param_name("IN");
       
  9237             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9238             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9239             
       
  9240             /* Get the value from a foo(<param_value>) style call */
       
  9241             if (IN_param_value == NULL)
       
  9242               IN_param_value = function_call_param_iterator.next();
       
  9243             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9244             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9245             
       
  9246             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9247             {
       
  9248         
       
  9249                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  9250                 s4o.print("(");
       
  9251                 return_type_symbol->accept(*this);
       
  9252                 s4o.print(")__int_to_time(");
       
  9253                 IN_param_value->accept(*this);
       
  9254                 s4o.print(")");
       
  9255                 return NULL;
       
  9256                 
       
  9257             }
       
  9258             
       
  9259             ERROR;
       
  9260         }
       
  9261         
       
  9262     }/*function_word_to_time*/
       
  9263     break;
       
  9264 
       
  9265 /****
       
  9266  *WORD_TO_BOOL
       
  9267  */
       
  9268     case function_word_to_bool :
       
  9269     {
       
  9270         symbol_c *last_type_symbol = NULL;
       
  9271 
       
  9272         {
       
  9273             identifier_c param_name("IN");
       
  9274             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9275             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9276             
       
  9277             /* Get the value from a foo(<param_value>) style call */
       
  9278             if (IN_param_value == NULL)
       
  9279               IN_param_value = function_call_param_iterator.next();
       
  9280             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9281             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9282             
       
  9283             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9284             {
       
  9285         
       
  9286                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  9287                 s4o.print("(");
       
  9288                 return_type_symbol->accept(*this);
       
  9289                 s4o.print(")");
       
  9290                 IN_param_value->accept(*this);
       
  9291                 return NULL;
       
  9292                 
       
  9293             }
       
  9294             
       
  9295             ERROR;
       
  9296         }
       
  9297         
       
  9298     }/*function_word_to_bool*/
       
  9299     break;
       
  9300 
       
  9301 /****
       
  9302  *WORD_TO_BYTE
       
  9303  */
       
  9304     case function_word_to_byte :
       
  9305     {
       
  9306         symbol_c *last_type_symbol = NULL;
       
  9307 
       
  9308         {
       
  9309             identifier_c param_name("IN");
       
  9310             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9311             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9312             
       
  9313             /* Get the value from a foo(<param_value>) style call */
       
  9314             if (IN_param_value == NULL)
       
  9315               IN_param_value = function_call_param_iterator.next();
       
  9316             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9317             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9318             
       
  9319             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
  1150             {
  9320             {
  1151         
  9321         
  1152                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
  9322                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
  1153                 s4o.print("(");
  9323                 s4o.print("(");
  1154                 return_type_symbol->accept(*this);
  9324                 return_type_symbol->accept(*this);
  1159             }
  9329             }
  1160             
  9330             
  1161             ERROR;
  9331             ERROR;
  1162         }
  9332         }
  1163         
  9333         
  1164     }/*function_lreal_to_byte*/
  9334     }/*function_word_to_byte*/
  1165     break;
  9335     break;
  1166 
  9336 
  1167 /****
  9337 /****
  1168  *LREAL_TO_WORD
  9338  *WORD_TO_DWORD
  1169  */
  9339  */
  1170     case function_lreal_to_word :
  9340     case function_word_to_dword :
  1171     {
  9341     {
  1172         symbol_c *last_type_symbol = NULL;
  9342         symbol_c *last_type_symbol = NULL;
  1173 
  9343 
  1174         {
  9344         {
  1175             identifier_c param_name("IN");
  9345             identifier_c param_name("IN");
  1176             /* Get the value from a foo(<param_name> = <param_value>) style call */
  9346             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1177             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  9347             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1178             
  9348             
  1179             /* Get the value from a foo(<param_value>) style call */
  9349             /* Get the value from a foo(<param_value>) style call */
  1180             if (IN_param_value == NULL)
  9350             if (IN_param_value == NULL)
  1181               IN_param_value = function_call_param_iterator.next();
  9351               IN_param_value = function_call_param_iterator.next();
  1182             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  9352             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1183             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  9353             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1184             
  9354             
  1185             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
  9355             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9356             {
       
  9357         
       
  9358                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  9359                 s4o.print("(");
       
  9360                 return_type_symbol->accept(*this);
       
  9361                 s4o.print(")");
       
  9362                 IN_param_value->accept(*this);
       
  9363                 return NULL;
       
  9364                 
       
  9365             }
       
  9366             
       
  9367             ERROR;
       
  9368         }
       
  9369         
       
  9370     }/*function_word_to_dword*/
       
  9371     break;
       
  9372 
       
  9373 /****
       
  9374  *WORD_TO_LWORD
       
  9375  */
       
  9376     case function_word_to_lword :
       
  9377     {
       
  9378         symbol_c *last_type_symbol = NULL;
       
  9379 
       
  9380         {
       
  9381             identifier_c param_name("IN");
       
  9382             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9383             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9384             
       
  9385             /* Get the value from a foo(<param_value>) style call */
       
  9386             if (IN_param_value == NULL)
       
  9387               IN_param_value = function_call_param_iterator.next();
       
  9388             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9389             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9390             
       
  9391             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9392             {
       
  9393         
       
  9394                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  9395                 s4o.print("(");
       
  9396                 return_type_symbol->accept(*this);
       
  9397                 s4o.print(")");
       
  9398                 IN_param_value->accept(*this);
       
  9399                 return NULL;
       
  9400                 
       
  9401             }
       
  9402             
       
  9403             ERROR;
       
  9404         }
       
  9405         
       
  9406     }/*function_word_to_lword*/
       
  9407     break;
       
  9408 
       
  9409 /****
       
  9410  *WORD_TO_STRING
       
  9411  */
       
  9412     case function_word_to_string :
       
  9413     {
       
  9414         symbol_c *last_type_symbol = NULL;
       
  9415 
       
  9416         {
       
  9417             identifier_c param_name("IN");
       
  9418             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9419             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9420             
       
  9421             /* Get the value from a foo(<param_value>) style call */
       
  9422             if (IN_param_value == NULL)
       
  9423               IN_param_value = function_call_param_iterator.next();
       
  9424             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9425             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9426             
       
  9427             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9428             {
       
  9429         
       
  9430                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  9431                 s4o.print("(");
       
  9432                 return_type_symbol->accept(*this);
       
  9433                 s4o.print(")__bit_to_string(");
       
  9434                 IN_param_value->accept(*this);
       
  9435                 s4o.print(")");
       
  9436                 return NULL;
       
  9437                 
       
  9438             }
       
  9439             
       
  9440             ERROR;
       
  9441         }
       
  9442         
       
  9443     }/*function_word_to_string*/
       
  9444     break;
       
  9445 
       
  9446 /****
       
  9447  *WORD_TO_DATE
       
  9448  */
       
  9449     case function_word_to_date :
       
  9450     {
       
  9451         symbol_c *last_type_symbol = NULL;
       
  9452 
       
  9453         {
       
  9454             identifier_c param_name("IN");
       
  9455             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9456             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9457             
       
  9458             /* Get the value from a foo(<param_value>) style call */
       
  9459             if (IN_param_value == NULL)
       
  9460               IN_param_value = function_call_param_iterator.next();
       
  9461             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9462             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9463             
       
  9464             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9465             {
       
  9466         
       
  9467                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  9468                 s4o.print("(");
       
  9469                 return_type_symbol->accept(*this);
       
  9470                 s4o.print(")__int_to_time(");
       
  9471                 IN_param_value->accept(*this);
       
  9472                 s4o.print(")");
       
  9473                 return NULL;
       
  9474                 
       
  9475             }
       
  9476             
       
  9477             ERROR;
       
  9478         }
       
  9479         
       
  9480     }/*function_word_to_date*/
       
  9481     break;
       
  9482 
       
  9483 /****
       
  9484  *WORD_TO_TOD
       
  9485  */
       
  9486     case function_word_to_tod :
       
  9487     {
       
  9488         symbol_c *last_type_symbol = NULL;
       
  9489 
       
  9490         {
       
  9491             identifier_c param_name("IN");
       
  9492             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9493             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9494             
       
  9495             /* Get the value from a foo(<param_value>) style call */
       
  9496             if (IN_param_value == NULL)
       
  9497               IN_param_value = function_call_param_iterator.next();
       
  9498             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9499             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9500             
       
  9501             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9502             {
       
  9503         
       
  9504                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  9505                 s4o.print("(");
       
  9506                 return_type_symbol->accept(*this);
       
  9507                 s4o.print(")__int_to_time(");
       
  9508                 IN_param_value->accept(*this);
       
  9509                 s4o.print(")");
       
  9510                 return NULL;
       
  9511                 
       
  9512             }
       
  9513             
       
  9514             ERROR;
       
  9515         }
       
  9516         
       
  9517     }/*function_word_to_tod*/
       
  9518     break;
       
  9519 
       
  9520 /****
       
  9521  *WORD_TO_DT
       
  9522  */
       
  9523     case function_word_to_dt :
       
  9524     {
       
  9525         symbol_c *last_type_symbol = NULL;
       
  9526 
       
  9527         {
       
  9528             identifier_c param_name("IN");
       
  9529             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9530             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9531             
       
  9532             /* Get the value from a foo(<param_value>) style call */
       
  9533             if (IN_param_value == NULL)
       
  9534               IN_param_value = function_call_param_iterator.next();
       
  9535             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9536             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9537             
       
  9538             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9539             {
       
  9540         
       
  9541                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  9542                 s4o.print("(");
       
  9543                 return_type_symbol->accept(*this);
       
  9544                 s4o.print(")__int_to_time(");
       
  9545                 IN_param_value->accept(*this);
       
  9546                 s4o.print(")");
       
  9547                 return NULL;
       
  9548                 
       
  9549             }
       
  9550             
       
  9551             ERROR;
       
  9552         }
       
  9553         
       
  9554     }/*function_word_to_dt*/
       
  9555     break;
       
  9556 
       
  9557 /****
       
  9558  *DWORD_TO_REAL
       
  9559  */
       
  9560     case function_dword_to_real :
       
  9561     {
       
  9562         symbol_c *last_type_symbol = NULL;
       
  9563 
       
  9564         {
       
  9565             identifier_c param_name("IN");
       
  9566             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9567             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9568             
       
  9569             /* Get the value from a foo(<param_value>) style call */
       
  9570             if (IN_param_value == NULL)
       
  9571               IN_param_value = function_call_param_iterator.next();
       
  9572             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9573             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9574             
       
  9575             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
  9576             {
       
  9577         
       
  9578                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  9579                 s4o.print("(");
       
  9580                 return_type_symbol->accept(*this);
       
  9581                 s4o.print(")");
       
  9582                 IN_param_value->accept(*this);
       
  9583                 return NULL;
       
  9584                 
       
  9585             }
       
  9586             
       
  9587             ERROR;
       
  9588         }
       
  9589         
       
  9590     }/*function_dword_to_real*/
       
  9591     break;
       
  9592 
       
  9593 /****
       
  9594  *DWORD_TO_LREAL
       
  9595  */
       
  9596     case function_dword_to_lreal :
       
  9597     {
       
  9598         symbol_c *last_type_symbol = NULL;
       
  9599 
       
  9600         {
       
  9601             identifier_c param_name("IN");
       
  9602             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9603             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9604             
       
  9605             /* Get the value from a foo(<param_value>) style call */
       
  9606             if (IN_param_value == NULL)
       
  9607               IN_param_value = function_call_param_iterator.next();
       
  9608             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9609             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9610             
       
  9611             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
  9612             {
       
  9613         
       
  9614                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  9615                 s4o.print("(");
       
  9616                 return_type_symbol->accept(*this);
       
  9617                 s4o.print(")");
       
  9618                 IN_param_value->accept(*this);
       
  9619                 return NULL;
       
  9620                 
       
  9621             }
       
  9622             
       
  9623             ERROR;
       
  9624         }
       
  9625         
       
  9626     }/*function_dword_to_lreal*/
       
  9627     break;
       
  9628 
       
  9629 /****
       
  9630  *DWORD_TO_SINT
       
  9631  */
       
  9632     case function_dword_to_sint :
       
  9633     {
       
  9634         symbol_c *last_type_symbol = NULL;
       
  9635 
       
  9636         {
       
  9637             identifier_c param_name("IN");
       
  9638             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9639             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9640             
       
  9641             /* Get the value from a foo(<param_value>) style call */
       
  9642             if (IN_param_value == NULL)
       
  9643               IN_param_value = function_call_param_iterator.next();
       
  9644             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9645             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9646             
       
  9647             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
  9648             {
       
  9649         
       
  9650                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  9651                 s4o.print("(");
       
  9652                 return_type_symbol->accept(*this);
       
  9653                 s4o.print(")");
       
  9654                 IN_param_value->accept(*this);
       
  9655                 return NULL;
       
  9656                 
       
  9657             }
       
  9658             
       
  9659             ERROR;
       
  9660         }
       
  9661         
       
  9662     }/*function_dword_to_sint*/
       
  9663     break;
       
  9664 
       
  9665 /****
       
  9666  *DWORD_TO_INT
       
  9667  */
       
  9668     case function_dword_to_int :
       
  9669     {
       
  9670         symbol_c *last_type_symbol = NULL;
       
  9671 
       
  9672         {
       
  9673             identifier_c param_name("IN");
       
  9674             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9675             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9676             
       
  9677             /* Get the value from a foo(<param_value>) style call */
       
  9678             if (IN_param_value == NULL)
       
  9679               IN_param_value = function_call_param_iterator.next();
       
  9680             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9681             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9682             
       
  9683             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
  9684             {
       
  9685         
       
  9686                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  9687                 s4o.print("(");
       
  9688                 return_type_symbol->accept(*this);
       
  9689                 s4o.print(")");
       
  9690                 IN_param_value->accept(*this);
       
  9691                 return NULL;
       
  9692                 
       
  9693             }
       
  9694             
       
  9695             ERROR;
       
  9696         }
       
  9697         
       
  9698     }/*function_dword_to_int*/
       
  9699     break;
       
  9700 
       
  9701 /****
       
  9702  *DWORD_TO_DINT
       
  9703  */
       
  9704     case function_dword_to_dint :
       
  9705     {
       
  9706         symbol_c *last_type_symbol = NULL;
       
  9707 
       
  9708         {
       
  9709             identifier_c param_name("IN");
       
  9710             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9711             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9712             
       
  9713             /* Get the value from a foo(<param_value>) style call */
       
  9714             if (IN_param_value == NULL)
       
  9715               IN_param_value = function_call_param_iterator.next();
       
  9716             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9717             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9718             
       
  9719             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
  9720             {
       
  9721         
       
  9722                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  9723                 s4o.print("(");
       
  9724                 return_type_symbol->accept(*this);
       
  9725                 s4o.print(")");
       
  9726                 IN_param_value->accept(*this);
       
  9727                 return NULL;
       
  9728                 
       
  9729             }
       
  9730             
       
  9731             ERROR;
       
  9732         }
       
  9733         
       
  9734     }/*function_dword_to_dint*/
       
  9735     break;
       
  9736 
       
  9737 /****
       
  9738  *DWORD_TO_LINT
       
  9739  */
       
  9740     case function_dword_to_lint :
       
  9741     {
       
  9742         symbol_c *last_type_symbol = NULL;
       
  9743 
       
  9744         {
       
  9745             identifier_c param_name("IN");
       
  9746             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9747             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9748             
       
  9749             /* Get the value from a foo(<param_value>) style call */
       
  9750             if (IN_param_value == NULL)
       
  9751               IN_param_value = function_call_param_iterator.next();
       
  9752             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9753             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9754             
       
  9755             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
  9756             {
       
  9757         
       
  9758                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  9759                 s4o.print("(");
       
  9760                 return_type_symbol->accept(*this);
       
  9761                 s4o.print(")");
       
  9762                 IN_param_value->accept(*this);
       
  9763                 return NULL;
       
  9764                 
       
  9765             }
       
  9766             
       
  9767             ERROR;
       
  9768         }
       
  9769         
       
  9770     }/*function_dword_to_lint*/
       
  9771     break;
       
  9772 
       
  9773 /****
       
  9774  *DWORD_TO_USINT
       
  9775  */
       
  9776     case function_dword_to_usint :
       
  9777     {
       
  9778         symbol_c *last_type_symbol = NULL;
       
  9779 
       
  9780         {
       
  9781             identifier_c param_name("IN");
       
  9782             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9783             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9784             
       
  9785             /* Get the value from a foo(<param_value>) style call */
       
  9786             if (IN_param_value == NULL)
       
  9787               IN_param_value = function_call_param_iterator.next();
       
  9788             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9789             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9790             
       
  9791             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
  9792             {
       
  9793         
       
  9794                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  9795                 s4o.print("(");
       
  9796                 return_type_symbol->accept(*this);
       
  9797                 s4o.print(")");
       
  9798                 IN_param_value->accept(*this);
       
  9799                 return NULL;
       
  9800                 
       
  9801             }
       
  9802             
       
  9803             ERROR;
       
  9804         }
       
  9805         
       
  9806     }/*function_dword_to_usint*/
       
  9807     break;
       
  9808 
       
  9809 /****
       
  9810  *DWORD_TO_UINT
       
  9811  */
       
  9812     case function_dword_to_uint :
       
  9813     {
       
  9814         symbol_c *last_type_symbol = NULL;
       
  9815 
       
  9816         {
       
  9817             identifier_c param_name("IN");
       
  9818             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9819             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9820             
       
  9821             /* Get the value from a foo(<param_value>) style call */
       
  9822             if (IN_param_value == NULL)
       
  9823               IN_param_value = function_call_param_iterator.next();
       
  9824             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9825             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9826             
       
  9827             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
  9828             {
       
  9829         
       
  9830                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  9831                 s4o.print("(");
       
  9832                 return_type_symbol->accept(*this);
       
  9833                 s4o.print(")");
       
  9834                 IN_param_value->accept(*this);
       
  9835                 return NULL;
       
  9836                 
       
  9837             }
       
  9838             
       
  9839             ERROR;
       
  9840         }
       
  9841         
       
  9842     }/*function_dword_to_uint*/
       
  9843     break;
       
  9844 
       
  9845 /****
       
  9846  *DWORD_TO_UDINT
       
  9847  */
       
  9848     case function_dword_to_udint :
       
  9849     {
       
  9850         symbol_c *last_type_symbol = NULL;
       
  9851 
       
  9852         {
       
  9853             identifier_c param_name("IN");
       
  9854             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9855             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9856             
       
  9857             /* Get the value from a foo(<param_value>) style call */
       
  9858             if (IN_param_value == NULL)
       
  9859               IN_param_value = function_call_param_iterator.next();
       
  9860             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9861             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9862             
       
  9863             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
  9864             {
       
  9865         
       
  9866                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  9867                 s4o.print("(");
       
  9868                 return_type_symbol->accept(*this);
       
  9869                 s4o.print(")");
       
  9870                 IN_param_value->accept(*this);
       
  9871                 return NULL;
       
  9872                 
       
  9873             }
       
  9874             
       
  9875             ERROR;
       
  9876         }
       
  9877         
       
  9878     }/*function_dword_to_udint*/
       
  9879     break;
       
  9880 
       
  9881 /****
       
  9882  *DWORD_TO_ULINT
       
  9883  */
       
  9884     case function_dword_to_ulint :
       
  9885     {
       
  9886         symbol_c *last_type_symbol = NULL;
       
  9887 
       
  9888         {
       
  9889             identifier_c param_name("IN");
       
  9890             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9891             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9892             
       
  9893             /* Get the value from a foo(<param_value>) style call */
       
  9894             if (IN_param_value == NULL)
       
  9895               IN_param_value = function_call_param_iterator.next();
       
  9896             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9897             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9898             
       
  9899             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
  9900             {
       
  9901         
       
  9902                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  9903                 s4o.print("(");
       
  9904                 return_type_symbol->accept(*this);
       
  9905                 s4o.print(")");
       
  9906                 IN_param_value->accept(*this);
       
  9907                 return NULL;
       
  9908                 
       
  9909             }
       
  9910             
       
  9911             ERROR;
       
  9912         }
       
  9913         
       
  9914     }/*function_dword_to_ulint*/
       
  9915     break;
       
  9916 
       
  9917 /****
       
  9918  *DWORD_TO_TIME
       
  9919  */
       
  9920     case function_dword_to_time :
       
  9921     {
       
  9922         symbol_c *last_type_symbol = NULL;
       
  9923 
       
  9924         {
       
  9925             identifier_c param_name("IN");
       
  9926             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9927             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9928             
       
  9929             /* Get the value from a foo(<param_value>) style call */
       
  9930             if (IN_param_value == NULL)
       
  9931               IN_param_value = function_call_param_iterator.next();
       
  9932             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9933             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9934             
       
  9935             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
  9936             {
       
  9937         
       
  9938                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  9939                 s4o.print("(");
       
  9940                 return_type_symbol->accept(*this);
       
  9941                 s4o.print(")__int_to_time(");
       
  9942                 IN_param_value->accept(*this);
       
  9943                 s4o.print(")");
       
  9944                 return NULL;
       
  9945                 
       
  9946             }
       
  9947             
       
  9948             ERROR;
       
  9949         }
       
  9950         
       
  9951     }/*function_dword_to_time*/
       
  9952     break;
       
  9953 
       
  9954 /****
       
  9955  *DWORD_TO_BOOL
       
  9956  */
       
  9957     case function_dword_to_bool :
       
  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 (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
  9973             {
       
  9974         
       
  9975                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  9976                 s4o.print("(");
       
  9977                 return_type_symbol->accept(*this);
       
  9978                 s4o.print(")");
       
  9979                 IN_param_value->accept(*this);
       
  9980                 return NULL;
       
  9981                 
       
  9982             }
       
  9983             
       
  9984             ERROR;
       
  9985         }
       
  9986         
       
  9987     }/*function_dword_to_bool*/
       
  9988     break;
       
  9989 
       
  9990 /****
       
  9991  *DWORD_TO_BYTE
       
  9992  */
       
  9993     case function_dword_to_byte :
       
  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 (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10009             {
       
 10010         
       
 10011                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 10012                 s4o.print("(");
       
 10013                 return_type_symbol->accept(*this);
       
 10014                 s4o.print(")");
       
 10015                 IN_param_value->accept(*this);
       
 10016                 return NULL;
       
 10017                 
       
 10018             }
       
 10019             
       
 10020             ERROR;
       
 10021         }
       
 10022         
       
 10023     }/*function_dword_to_byte*/
       
 10024     break;
       
 10025 
       
 10026 /****
       
 10027  *DWORD_TO_WORD
       
 10028  */
       
 10029     case function_dword_to_word :
       
 10030     {
       
 10031         symbol_c *last_type_symbol = NULL;
       
 10032 
       
 10033         {
       
 10034             identifier_c param_name("IN");
       
 10035             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10036             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10037             
       
 10038             /* Get the value from a foo(<param_value>) style call */
       
 10039             if (IN_param_value == NULL)
       
 10040               IN_param_value = function_call_param_iterator.next();
       
 10041             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10042             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10043             
       
 10044             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
  1186             {
 10045             {
  1187         
 10046         
  1188                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
 10047                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
  1189                 s4o.print("(");
 10048                 s4o.print("(");
  1190                 return_type_symbol->accept(*this);
 10049                 return_type_symbol->accept(*this);
  1195             }
 10054             }
  1196             
 10055             
  1197             ERROR;
 10056             ERROR;
  1198         }
 10057         }
  1199         
 10058         
  1200     }/*function_lreal_to_word*/
 10059     }/*function_dword_to_word*/
  1201     break;
 10060     break;
  1202 
 10061 
  1203 /****
 10062 /****
  1204  *LREAL_TO_DWORD
 10063  *DWORD_TO_LWORD
  1205  */
 10064  */
  1206     case function_lreal_to_dword :
 10065     case function_dword_to_lword :
  1207     {
 10066     {
  1208         symbol_c *last_type_symbol = NULL;
 10067         symbol_c *last_type_symbol = NULL;
  1209 
 10068 
  1210         {
 10069         {
  1211             identifier_c param_name("IN");
 10070             identifier_c param_name("IN");
  1212             /* Get the value from a foo(<param_name> = <param_value>) style call */
 10071             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1213             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 10072             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1214             
 10073             
  1215             /* Get the value from a foo(<param_value>) style call */
 10074             /* Get the value from a foo(<param_value>) style call */
  1216             if (IN_param_value == NULL)
 10075             if (IN_param_value == NULL)
  1217               IN_param_value = function_call_param_iterator.next();
 10076               IN_param_value = function_call_param_iterator.next();
  1218             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 10077             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1219             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 10078             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1220             
 10079             
  1221             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
 10080             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10081             {
       
 10082         
       
 10083                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 10084                 s4o.print("(");
       
 10085                 return_type_symbol->accept(*this);
       
 10086                 s4o.print(")");
       
 10087                 IN_param_value->accept(*this);
       
 10088                 return NULL;
       
 10089                 
       
 10090             }
       
 10091             
       
 10092             ERROR;
       
 10093         }
       
 10094         
       
 10095     }/*function_dword_to_lword*/
       
 10096     break;
       
 10097 
       
 10098 /****
       
 10099  *DWORD_TO_STRING
       
 10100  */
       
 10101     case function_dword_to_string :
       
 10102     {
       
 10103         symbol_c *last_type_symbol = NULL;
       
 10104 
       
 10105         {
       
 10106             identifier_c param_name("IN");
       
 10107             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10108             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10109             
       
 10110             /* Get the value from a foo(<param_value>) style call */
       
 10111             if (IN_param_value == NULL)
       
 10112               IN_param_value = function_call_param_iterator.next();
       
 10113             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10114             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10115             
       
 10116             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10117             {
       
 10118         
       
 10119                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 10120                 s4o.print("(");
       
 10121                 return_type_symbol->accept(*this);
       
 10122                 s4o.print(")__bit_to_string(");
       
 10123                 IN_param_value->accept(*this);
       
 10124                 s4o.print(")");
       
 10125                 return NULL;
       
 10126                 
       
 10127             }
       
 10128             
       
 10129             ERROR;
       
 10130         }
       
 10131         
       
 10132     }/*function_dword_to_string*/
       
 10133     break;
       
 10134 
       
 10135 /****
       
 10136  *DWORD_TO_DATE
       
 10137  */
       
 10138     case function_dword_to_date :
       
 10139     {
       
 10140         symbol_c *last_type_symbol = NULL;
       
 10141 
       
 10142         {
       
 10143             identifier_c param_name("IN");
       
 10144             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10145             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10146             
       
 10147             /* Get the value from a foo(<param_value>) style call */
       
 10148             if (IN_param_value == NULL)
       
 10149               IN_param_value = function_call_param_iterator.next();
       
 10150             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10151             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10152             
       
 10153             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10154             {
       
 10155         
       
 10156                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 10157                 s4o.print("(");
       
 10158                 return_type_symbol->accept(*this);
       
 10159                 s4o.print(")__int_to_time(");
       
 10160                 IN_param_value->accept(*this);
       
 10161                 s4o.print(")");
       
 10162                 return NULL;
       
 10163                 
       
 10164             }
       
 10165             
       
 10166             ERROR;
       
 10167         }
       
 10168         
       
 10169     }/*function_dword_to_date*/
       
 10170     break;
       
 10171 
       
 10172 /****
       
 10173  *DWORD_TO_TOD
       
 10174  */
       
 10175     case function_dword_to_tod :
       
 10176     {
       
 10177         symbol_c *last_type_symbol = NULL;
       
 10178 
       
 10179         {
       
 10180             identifier_c param_name("IN");
       
 10181             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10182             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10183             
       
 10184             /* Get the value from a foo(<param_value>) style call */
       
 10185             if (IN_param_value == NULL)
       
 10186               IN_param_value = function_call_param_iterator.next();
       
 10187             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10188             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10189             
       
 10190             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10191             {
       
 10192         
       
 10193                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 10194                 s4o.print("(");
       
 10195                 return_type_symbol->accept(*this);
       
 10196                 s4o.print(")__int_to_time(");
       
 10197                 IN_param_value->accept(*this);
       
 10198                 s4o.print(")");
       
 10199                 return NULL;
       
 10200                 
       
 10201             }
       
 10202             
       
 10203             ERROR;
       
 10204         }
       
 10205         
       
 10206     }/*function_dword_to_tod*/
       
 10207     break;
       
 10208 
       
 10209 /****
       
 10210  *DWORD_TO_DT
       
 10211  */
       
 10212     case function_dword_to_dt :
       
 10213     {
       
 10214         symbol_c *last_type_symbol = NULL;
       
 10215 
       
 10216         {
       
 10217             identifier_c param_name("IN");
       
 10218             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10219             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10220             
       
 10221             /* Get the value from a foo(<param_value>) style call */
       
 10222             if (IN_param_value == NULL)
       
 10223               IN_param_value = function_call_param_iterator.next();
       
 10224             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10225             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10226             
       
 10227             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10228             {
       
 10229         
       
 10230                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 10231                 s4o.print("(");
       
 10232                 return_type_symbol->accept(*this);
       
 10233                 s4o.print(")__int_to_time(");
       
 10234                 IN_param_value->accept(*this);
       
 10235                 s4o.print(")");
       
 10236                 return NULL;
       
 10237                 
       
 10238             }
       
 10239             
       
 10240             ERROR;
       
 10241         }
       
 10242         
       
 10243     }/*function_dword_to_dt*/
       
 10244     break;
       
 10245 
       
 10246 /****
       
 10247  *LWORD_TO_REAL
       
 10248  */
       
 10249     case function_lword_to_real :
       
 10250     {
       
 10251         symbol_c *last_type_symbol = NULL;
       
 10252 
       
 10253         {
       
 10254             identifier_c param_name("IN");
       
 10255             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10256             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10257             
       
 10258             /* Get the value from a foo(<param_value>) style call */
       
 10259             if (IN_param_value == NULL)
       
 10260               IN_param_value = function_call_param_iterator.next();
       
 10261             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10262             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10263             
       
 10264             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10265             {
       
 10266         
       
 10267                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 10268                 s4o.print("(");
       
 10269                 return_type_symbol->accept(*this);
       
 10270                 s4o.print(")");
       
 10271                 IN_param_value->accept(*this);
       
 10272                 return NULL;
       
 10273                 
       
 10274             }
       
 10275             
       
 10276             ERROR;
       
 10277         }
       
 10278         
       
 10279     }/*function_lword_to_real*/
       
 10280     break;
       
 10281 
       
 10282 /****
       
 10283  *LWORD_TO_LREAL
       
 10284  */
       
 10285     case function_lword_to_lreal :
       
 10286     {
       
 10287         symbol_c *last_type_symbol = NULL;
       
 10288 
       
 10289         {
       
 10290             identifier_c param_name("IN");
       
 10291             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10292             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10293             
       
 10294             /* Get the value from a foo(<param_value>) style call */
       
 10295             if (IN_param_value == NULL)
       
 10296               IN_param_value = function_call_param_iterator.next();
       
 10297             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10298             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10299             
       
 10300             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10301             {
       
 10302         
       
 10303                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 10304                 s4o.print("(");
       
 10305                 return_type_symbol->accept(*this);
       
 10306                 s4o.print(")");
       
 10307                 IN_param_value->accept(*this);
       
 10308                 return NULL;
       
 10309                 
       
 10310             }
       
 10311             
       
 10312             ERROR;
       
 10313         }
       
 10314         
       
 10315     }/*function_lword_to_lreal*/
       
 10316     break;
       
 10317 
       
 10318 /****
       
 10319  *LWORD_TO_SINT
       
 10320  */
       
 10321     case function_lword_to_sint :
       
 10322     {
       
 10323         symbol_c *last_type_symbol = NULL;
       
 10324 
       
 10325         {
       
 10326             identifier_c param_name("IN");
       
 10327             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10328             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10329             
       
 10330             /* Get the value from a foo(<param_value>) style call */
       
 10331             if (IN_param_value == NULL)
       
 10332               IN_param_value = function_call_param_iterator.next();
       
 10333             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10334             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10335             
       
 10336             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10337             {
       
 10338         
       
 10339                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 10340                 s4o.print("(");
       
 10341                 return_type_symbol->accept(*this);
       
 10342                 s4o.print(")");
       
 10343                 IN_param_value->accept(*this);
       
 10344                 return NULL;
       
 10345                 
       
 10346             }
       
 10347             
       
 10348             ERROR;
       
 10349         }
       
 10350         
       
 10351     }/*function_lword_to_sint*/
       
 10352     break;
       
 10353 
       
 10354 /****
       
 10355  *LWORD_TO_INT
       
 10356  */
       
 10357     case function_lword_to_int :
       
 10358     {
       
 10359         symbol_c *last_type_symbol = NULL;
       
 10360 
       
 10361         {
       
 10362             identifier_c param_name("IN");
       
 10363             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10364             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10365             
       
 10366             /* Get the value from a foo(<param_value>) style call */
       
 10367             if (IN_param_value == NULL)
       
 10368               IN_param_value = function_call_param_iterator.next();
       
 10369             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10370             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10371             
       
 10372             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10373             {
       
 10374         
       
 10375                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 10376                 s4o.print("(");
       
 10377                 return_type_symbol->accept(*this);
       
 10378                 s4o.print(")");
       
 10379                 IN_param_value->accept(*this);
       
 10380                 return NULL;
       
 10381                 
       
 10382             }
       
 10383             
       
 10384             ERROR;
       
 10385         }
       
 10386         
       
 10387     }/*function_lword_to_int*/
       
 10388     break;
       
 10389 
       
 10390 /****
       
 10391  *LWORD_TO_DINT
       
 10392  */
       
 10393     case function_lword_to_dint :
       
 10394     {
       
 10395         symbol_c *last_type_symbol = NULL;
       
 10396 
       
 10397         {
       
 10398             identifier_c param_name("IN");
       
 10399             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10400             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10401             
       
 10402             /* Get the value from a foo(<param_value>) style call */
       
 10403             if (IN_param_value == NULL)
       
 10404               IN_param_value = function_call_param_iterator.next();
       
 10405             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10406             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10407             
       
 10408             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10409             {
       
 10410         
       
 10411                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 10412                 s4o.print("(");
       
 10413                 return_type_symbol->accept(*this);
       
 10414                 s4o.print(")");
       
 10415                 IN_param_value->accept(*this);
       
 10416                 return NULL;
       
 10417                 
       
 10418             }
       
 10419             
       
 10420             ERROR;
       
 10421         }
       
 10422         
       
 10423     }/*function_lword_to_dint*/
       
 10424     break;
       
 10425 
       
 10426 /****
       
 10427  *LWORD_TO_LINT
       
 10428  */
       
 10429     case function_lword_to_lint :
       
 10430     {
       
 10431         symbol_c *last_type_symbol = NULL;
       
 10432 
       
 10433         {
       
 10434             identifier_c param_name("IN");
       
 10435             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10436             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10437             
       
 10438             /* Get the value from a foo(<param_value>) style call */
       
 10439             if (IN_param_value == NULL)
       
 10440               IN_param_value = function_call_param_iterator.next();
       
 10441             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10442             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10443             
       
 10444             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10445             {
       
 10446         
       
 10447                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 10448                 s4o.print("(");
       
 10449                 return_type_symbol->accept(*this);
       
 10450                 s4o.print(")");
       
 10451                 IN_param_value->accept(*this);
       
 10452                 return NULL;
       
 10453                 
       
 10454             }
       
 10455             
       
 10456             ERROR;
       
 10457         }
       
 10458         
       
 10459     }/*function_lword_to_lint*/
       
 10460     break;
       
 10461 
       
 10462 /****
       
 10463  *LWORD_TO_USINT
       
 10464  */
       
 10465     case function_lword_to_usint :
       
 10466     {
       
 10467         symbol_c *last_type_symbol = NULL;
       
 10468 
       
 10469         {
       
 10470             identifier_c param_name("IN");
       
 10471             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10472             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10473             
       
 10474             /* Get the value from a foo(<param_value>) style call */
       
 10475             if (IN_param_value == NULL)
       
 10476               IN_param_value = function_call_param_iterator.next();
       
 10477             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10478             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10479             
       
 10480             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10481             {
       
 10482         
       
 10483                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 10484                 s4o.print("(");
       
 10485                 return_type_symbol->accept(*this);
       
 10486                 s4o.print(")");
       
 10487                 IN_param_value->accept(*this);
       
 10488                 return NULL;
       
 10489                 
       
 10490             }
       
 10491             
       
 10492             ERROR;
       
 10493         }
       
 10494         
       
 10495     }/*function_lword_to_usint*/
       
 10496     break;
       
 10497 
       
 10498 /****
       
 10499  *LWORD_TO_UINT
       
 10500  */
       
 10501     case function_lword_to_uint :
       
 10502     {
       
 10503         symbol_c *last_type_symbol = NULL;
       
 10504 
       
 10505         {
       
 10506             identifier_c param_name("IN");
       
 10507             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10508             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10509             
       
 10510             /* Get the value from a foo(<param_value>) style call */
       
 10511             if (IN_param_value == NULL)
       
 10512               IN_param_value = function_call_param_iterator.next();
       
 10513             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10514             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10515             
       
 10516             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10517             {
       
 10518         
       
 10519                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 10520                 s4o.print("(");
       
 10521                 return_type_symbol->accept(*this);
       
 10522                 s4o.print(")");
       
 10523                 IN_param_value->accept(*this);
       
 10524                 return NULL;
       
 10525                 
       
 10526             }
       
 10527             
       
 10528             ERROR;
       
 10529         }
       
 10530         
       
 10531     }/*function_lword_to_uint*/
       
 10532     break;
       
 10533 
       
 10534 /****
       
 10535  *LWORD_TO_UDINT
       
 10536  */
       
 10537     case function_lword_to_udint :
       
 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 (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10553             {
       
 10554         
       
 10555                 symbol_c * return_type_symbol = &search_constant_type_c::udint_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_lword_to_udint*/
       
 10568     break;
       
 10569 
       
 10570 /****
       
 10571  *LWORD_TO_ULINT
       
 10572  */
       
 10573     case function_lword_to_ulint :
       
 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 (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10589             {
       
 10590         
       
 10591                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_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_lword_to_ulint*/
       
 10604     break;
       
 10605 
       
 10606 /****
       
 10607  *LWORD_TO_TIME
       
 10608  */
       
 10609     case function_lword_to_time :
       
 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 (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10625             {
       
 10626         
       
 10627                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 10628                 s4o.print("(");
       
 10629                 return_type_symbol->accept(*this);
       
 10630                 s4o.print(")__int_to_time(");
       
 10631                 IN_param_value->accept(*this);
       
 10632                 s4o.print(")");
       
 10633                 return NULL;
       
 10634                 
       
 10635             }
       
 10636             
       
 10637             ERROR;
       
 10638         }
       
 10639         
       
 10640     }/*function_lword_to_time*/
       
 10641     break;
       
 10642 
       
 10643 /****
       
 10644  *LWORD_TO_BOOL
       
 10645  */
       
 10646     case function_lword_to_bool :
       
 10647     {
       
 10648         symbol_c *last_type_symbol = NULL;
       
 10649 
       
 10650         {
       
 10651             identifier_c param_name("IN");
       
 10652             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10653             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10654             
       
 10655             /* Get the value from a foo(<param_value>) style call */
       
 10656             if (IN_param_value == NULL)
       
 10657               IN_param_value = function_call_param_iterator.next();
       
 10658             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10659             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10660             
       
 10661             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10662             {
       
 10663         
       
 10664                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 10665                 s4o.print("(");
       
 10666                 return_type_symbol->accept(*this);
       
 10667                 s4o.print(")");
       
 10668                 IN_param_value->accept(*this);
       
 10669                 return NULL;
       
 10670                 
       
 10671             }
       
 10672             
       
 10673             ERROR;
       
 10674         }
       
 10675         
       
 10676     }/*function_lword_to_bool*/
       
 10677     break;
       
 10678 
       
 10679 /****
       
 10680  *LWORD_TO_BYTE
       
 10681  */
       
 10682     case function_lword_to_byte :
       
 10683     {
       
 10684         symbol_c *last_type_symbol = NULL;
       
 10685 
       
 10686         {
       
 10687             identifier_c param_name("IN");
       
 10688             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10689             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10690             
       
 10691             /* Get the value from a foo(<param_value>) style call */
       
 10692             if (IN_param_value == NULL)
       
 10693               IN_param_value = function_call_param_iterator.next();
       
 10694             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10695             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10696             
       
 10697             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10698             {
       
 10699         
       
 10700                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 10701                 s4o.print("(");
       
 10702                 return_type_symbol->accept(*this);
       
 10703                 s4o.print(")");
       
 10704                 IN_param_value->accept(*this);
       
 10705                 return NULL;
       
 10706                 
       
 10707             }
       
 10708             
       
 10709             ERROR;
       
 10710         }
       
 10711         
       
 10712     }/*function_lword_to_byte*/
       
 10713     break;
       
 10714 
       
 10715 /****
       
 10716  *LWORD_TO_WORD
       
 10717  */
       
 10718     case function_lword_to_word :
       
 10719     {
       
 10720         symbol_c *last_type_symbol = NULL;
       
 10721 
       
 10722         {
       
 10723             identifier_c param_name("IN");
       
 10724             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10725             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10726             
       
 10727             /* Get the value from a foo(<param_value>) style call */
       
 10728             if (IN_param_value == NULL)
       
 10729               IN_param_value = function_call_param_iterator.next();
       
 10730             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10731             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10732             
       
 10733             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10734             {
       
 10735         
       
 10736                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 10737                 s4o.print("(");
       
 10738                 return_type_symbol->accept(*this);
       
 10739                 s4o.print(")");
       
 10740                 IN_param_value->accept(*this);
       
 10741                 return NULL;
       
 10742                 
       
 10743             }
       
 10744             
       
 10745             ERROR;
       
 10746         }
       
 10747         
       
 10748     }/*function_lword_to_word*/
       
 10749     break;
       
 10750 
       
 10751 /****
       
 10752  *LWORD_TO_DWORD
       
 10753  */
       
 10754     case function_lword_to_dword :
       
 10755     {
       
 10756         symbol_c *last_type_symbol = NULL;
       
 10757 
       
 10758         {
       
 10759             identifier_c param_name("IN");
       
 10760             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10761             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10762             
       
 10763             /* Get the value from a foo(<param_value>) style call */
       
 10764             if (IN_param_value == NULL)
       
 10765               IN_param_value = function_call_param_iterator.next();
       
 10766             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10767             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10768             
       
 10769             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
  1222             {
 10770             {
  1223         
 10771         
  1224                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
 10772                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
  1225                 s4o.print("(");
 10773                 s4o.print("(");
  1226                 return_type_symbol->accept(*this);
 10774                 return_type_symbol->accept(*this);
  1231             }
 10779             }
  1232             
 10780             
  1233             ERROR;
 10781             ERROR;
  1234         }
 10782         }
  1235         
 10783         
  1236     }/*function_lreal_to_dword*/
 10784     }/*function_lword_to_dword*/
  1237     break;
 10785     break;
  1238 
 10786 
  1239 /****
 10787 /****
  1240  *LREAL_TO_LWORD
 10788  *LWORD_TO_STRING
  1241  */
 10789  */
  1242     case function_lreal_to_lword :
 10790     case function_lword_to_string :
  1243     {
 10791     {
  1244         symbol_c *last_type_symbol = NULL;
 10792         symbol_c *last_type_symbol = NULL;
  1245 
 10793 
  1246         {
 10794         {
  1247             identifier_c param_name("IN");
 10795             identifier_c param_name("IN");
  1248             /* Get the value from a foo(<param_name> = <param_value>) style call */
 10796             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1249             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 10797             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1250             
 10798             
  1251             /* Get the value from a foo(<param_value>) style call */
 10799             /* Get the value from a foo(<param_value>) style call */
  1252             if (IN_param_value == NULL)
 10800             if (IN_param_value == NULL)
  1253               IN_param_value = function_call_param_iterator.next();
 10801               IN_param_value = function_call_param_iterator.next();
  1254             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 10802             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1255             last_type_symbol = last_type_symbol && search_expression_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             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1256             
 10804             
  1257             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
 10805             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10806             {
       
 10807         
       
 10808                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 10809                 s4o.print("(");
       
 10810                 return_type_symbol->accept(*this);
       
 10811                 s4o.print(")__bit_to_string(");
       
 10812                 IN_param_value->accept(*this);
       
 10813                 s4o.print(")");
       
 10814                 return NULL;
       
 10815                 
       
 10816             }
       
 10817             
       
 10818             ERROR;
       
 10819         }
       
 10820         
       
 10821     }/*function_lword_to_string*/
       
 10822     break;
       
 10823 
       
 10824 /****
       
 10825  *LWORD_TO_DATE
       
 10826  */
       
 10827     case function_lword_to_date :
       
 10828     {
       
 10829         symbol_c *last_type_symbol = NULL;
       
 10830 
       
 10831         {
       
 10832             identifier_c param_name("IN");
       
 10833             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10834             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10835             
       
 10836             /* Get the value from a foo(<param_value>) style call */
       
 10837             if (IN_param_value == NULL)
       
 10838               IN_param_value = function_call_param_iterator.next();
       
 10839             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10840             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10841             
       
 10842             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10843             {
       
 10844         
       
 10845                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 10846                 s4o.print("(");
       
 10847                 return_type_symbol->accept(*this);
       
 10848                 s4o.print(")__int_to_time(");
       
 10849                 IN_param_value->accept(*this);
       
 10850                 s4o.print(")");
       
 10851                 return NULL;
       
 10852                 
       
 10853             }
       
 10854             
       
 10855             ERROR;
       
 10856         }
       
 10857         
       
 10858     }/*function_lword_to_date*/
       
 10859     break;
       
 10860 
       
 10861 /****
       
 10862  *LWORD_TO_TOD
       
 10863  */
       
 10864     case function_lword_to_tod :
       
 10865     {
       
 10866         symbol_c *last_type_symbol = NULL;
       
 10867 
       
 10868         {
       
 10869             identifier_c param_name("IN");
       
 10870             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10871             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10872             
       
 10873             /* Get the value from a foo(<param_value>) style call */
       
 10874             if (IN_param_value == NULL)
       
 10875               IN_param_value = function_call_param_iterator.next();
       
 10876             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10877             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10878             
       
 10879             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10880             {
       
 10881         
       
 10882                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 10883                 s4o.print("(");
       
 10884                 return_type_symbol->accept(*this);
       
 10885                 s4o.print(")__int_to_time(");
       
 10886                 IN_param_value->accept(*this);
       
 10887                 s4o.print(")");
       
 10888                 return NULL;
       
 10889                 
       
 10890             }
       
 10891             
       
 10892             ERROR;
       
 10893         }
       
 10894         
       
 10895     }/*function_lword_to_tod*/
       
 10896     break;
       
 10897 
       
 10898 /****
       
 10899  *LWORD_TO_DT
       
 10900  */
       
 10901     case function_lword_to_dt :
       
 10902     {
       
 10903         symbol_c *last_type_symbol = NULL;
       
 10904 
       
 10905         {
       
 10906             identifier_c param_name("IN");
       
 10907             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10908             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10909             
       
 10910             /* Get the value from a foo(<param_value>) style call */
       
 10911             if (IN_param_value == NULL)
       
 10912               IN_param_value = function_call_param_iterator.next();
       
 10913             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10914             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10915             
       
 10916             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10917             {
       
 10918         
       
 10919                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 10920                 s4o.print("(");
       
 10921                 return_type_symbol->accept(*this);
       
 10922                 s4o.print(")__int_to_time(");
       
 10923                 IN_param_value->accept(*this);
       
 10924                 s4o.print(")");
       
 10925                 return NULL;
       
 10926                 
       
 10927             }
       
 10928             
       
 10929             ERROR;
       
 10930         }
       
 10931         
       
 10932     }/*function_lword_to_dt*/
       
 10933     break;
       
 10934 
       
 10935 /****
       
 10936  *STRING_TO_REAL
       
 10937  */
       
 10938     case function_string_to_real :
       
 10939     {
       
 10940         symbol_c *last_type_symbol = NULL;
       
 10941 
       
 10942         {
       
 10943             identifier_c param_name("IN");
       
 10944             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10945             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10946             
       
 10947             /* Get the value from a foo(<param_value>) style call */
       
 10948             if (IN_param_value == NULL)
       
 10949               IN_param_value = function_call_param_iterator.next();
       
 10950             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10951             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10952             
       
 10953             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 10954             {
       
 10955         
       
 10956                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 10957                 s4o.print("(");
       
 10958                 return_type_symbol->accept(*this);
       
 10959                 s4o.print(")__string_to_real(");
       
 10960                 IN_param_value->accept(*this);
       
 10961                 s4o.print(")");
       
 10962                 return NULL;
       
 10963                 
       
 10964             }
       
 10965             
       
 10966             ERROR;
       
 10967         }
       
 10968         
       
 10969     }/*function_string_to_real*/
       
 10970     break;
       
 10971 
       
 10972 /****
       
 10973  *STRING_TO_LREAL
       
 10974  */
       
 10975     case function_string_to_lreal :
       
 10976     {
       
 10977         symbol_c *last_type_symbol = NULL;
       
 10978 
       
 10979         {
       
 10980             identifier_c param_name("IN");
       
 10981             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10982             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10983             
       
 10984             /* Get the value from a foo(<param_value>) style call */
       
 10985             if (IN_param_value == NULL)
       
 10986               IN_param_value = function_call_param_iterator.next();
       
 10987             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10988             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10989             
       
 10990             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 10991             {
       
 10992         
       
 10993                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 10994                 s4o.print("(");
       
 10995                 return_type_symbol->accept(*this);
       
 10996                 s4o.print(")__string_to_real(");
       
 10997                 IN_param_value->accept(*this);
       
 10998                 s4o.print(")");
       
 10999                 return NULL;
       
 11000                 
       
 11001             }
       
 11002             
       
 11003             ERROR;
       
 11004         }
       
 11005         
       
 11006     }/*function_string_to_lreal*/
       
 11007     break;
       
 11008 
       
 11009 /****
       
 11010  *STRING_TO_SINT
       
 11011  */
       
 11012     case function_string_to_sint :
       
 11013     {
       
 11014         symbol_c *last_type_symbol = NULL;
       
 11015 
       
 11016         {
       
 11017             identifier_c param_name("IN");
       
 11018             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11019             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11020             
       
 11021             /* Get the value from a foo(<param_value>) style call */
       
 11022             if (IN_param_value == NULL)
       
 11023               IN_param_value = function_call_param_iterator.next();
       
 11024             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11025             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11026             
       
 11027             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11028             {
       
 11029         
       
 11030                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 11031                 s4o.print("(");
       
 11032                 return_type_symbol->accept(*this);
       
 11033                 s4o.print(")__string_to_sint(");
       
 11034                 IN_param_value->accept(*this);
       
 11035                 s4o.print(")");
       
 11036                 return NULL;
       
 11037                 
       
 11038             }
       
 11039             
       
 11040             ERROR;
       
 11041         }
       
 11042         
       
 11043     }/*function_string_to_sint*/
       
 11044     break;
       
 11045 
       
 11046 /****
       
 11047  *STRING_TO_INT
       
 11048  */
       
 11049     case function_string_to_int :
       
 11050     {
       
 11051         symbol_c *last_type_symbol = NULL;
       
 11052 
       
 11053         {
       
 11054             identifier_c param_name("IN");
       
 11055             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11056             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11057             
       
 11058             /* Get the value from a foo(<param_value>) style call */
       
 11059             if (IN_param_value == NULL)
       
 11060               IN_param_value = function_call_param_iterator.next();
       
 11061             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11062             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11063             
       
 11064             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11065             {
       
 11066         
       
 11067                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 11068                 s4o.print("(");
       
 11069                 return_type_symbol->accept(*this);
       
 11070                 s4o.print(")__string_to_sint(");
       
 11071                 IN_param_value->accept(*this);
       
 11072                 s4o.print(")");
       
 11073                 return NULL;
       
 11074                 
       
 11075             }
       
 11076             
       
 11077             ERROR;
       
 11078         }
       
 11079         
       
 11080     }/*function_string_to_int*/
       
 11081     break;
       
 11082 
       
 11083 /****
       
 11084  *STRING_TO_DINT
       
 11085  */
       
 11086     case function_string_to_dint :
       
 11087     {
       
 11088         symbol_c *last_type_symbol = NULL;
       
 11089 
       
 11090         {
       
 11091             identifier_c param_name("IN");
       
 11092             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11093             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11094             
       
 11095             /* Get the value from a foo(<param_value>) style call */
       
 11096             if (IN_param_value == NULL)
       
 11097               IN_param_value = function_call_param_iterator.next();
       
 11098             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11099             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11100             
       
 11101             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11102             {
       
 11103         
       
 11104                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 11105                 s4o.print("(");
       
 11106                 return_type_symbol->accept(*this);
       
 11107                 s4o.print(")__string_to_sint(");
       
 11108                 IN_param_value->accept(*this);
       
 11109                 s4o.print(")");
       
 11110                 return NULL;
       
 11111                 
       
 11112             }
       
 11113             
       
 11114             ERROR;
       
 11115         }
       
 11116         
       
 11117     }/*function_string_to_dint*/
       
 11118     break;
       
 11119 
       
 11120 /****
       
 11121  *STRING_TO_LINT
       
 11122  */
       
 11123     case function_string_to_lint :
       
 11124     {
       
 11125         symbol_c *last_type_symbol = NULL;
       
 11126 
       
 11127         {
       
 11128             identifier_c param_name("IN");
       
 11129             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11130             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11131             
       
 11132             /* Get the value from a foo(<param_value>) style call */
       
 11133             if (IN_param_value == NULL)
       
 11134               IN_param_value = function_call_param_iterator.next();
       
 11135             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11136             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11137             
       
 11138             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11139             {
       
 11140         
       
 11141                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 11142                 s4o.print("(");
       
 11143                 return_type_symbol->accept(*this);
       
 11144                 s4o.print(")__string_to_sint(");
       
 11145                 IN_param_value->accept(*this);
       
 11146                 s4o.print(")");
       
 11147                 return NULL;
       
 11148                 
       
 11149             }
       
 11150             
       
 11151             ERROR;
       
 11152         }
       
 11153         
       
 11154     }/*function_string_to_lint*/
       
 11155     break;
       
 11156 
       
 11157 /****
       
 11158  *STRING_TO_USINT
       
 11159  */
       
 11160     case function_string_to_usint :
       
 11161     {
       
 11162         symbol_c *last_type_symbol = NULL;
       
 11163 
       
 11164         {
       
 11165             identifier_c param_name("IN");
       
 11166             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11167             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11168             
       
 11169             /* Get the value from a foo(<param_value>) style call */
       
 11170             if (IN_param_value == NULL)
       
 11171               IN_param_value = function_call_param_iterator.next();
       
 11172             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11173             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11174             
       
 11175             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11176             {
       
 11177         
       
 11178                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 11179                 s4o.print("(");
       
 11180                 return_type_symbol->accept(*this);
       
 11181                 s4o.print(")__string_to_uint(");
       
 11182                 IN_param_value->accept(*this);
       
 11183                 s4o.print(")");
       
 11184                 return NULL;
       
 11185                 
       
 11186             }
       
 11187             
       
 11188             ERROR;
       
 11189         }
       
 11190         
       
 11191     }/*function_string_to_usint*/
       
 11192     break;
       
 11193 
       
 11194 /****
       
 11195  *STRING_TO_UINT
       
 11196  */
       
 11197     case function_string_to_uint :
       
 11198     {
       
 11199         symbol_c *last_type_symbol = NULL;
       
 11200 
       
 11201         {
       
 11202             identifier_c param_name("IN");
       
 11203             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11204             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11205             
       
 11206             /* Get the value from a foo(<param_value>) style call */
       
 11207             if (IN_param_value == NULL)
       
 11208               IN_param_value = function_call_param_iterator.next();
       
 11209             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11210             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11211             
       
 11212             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11213             {
       
 11214         
       
 11215                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 11216                 s4o.print("(");
       
 11217                 return_type_symbol->accept(*this);
       
 11218                 s4o.print(")__string_to_uint(");
       
 11219                 IN_param_value->accept(*this);
       
 11220                 s4o.print(")");
       
 11221                 return NULL;
       
 11222                 
       
 11223             }
       
 11224             
       
 11225             ERROR;
       
 11226         }
       
 11227         
       
 11228     }/*function_string_to_uint*/
       
 11229     break;
       
 11230 
       
 11231 /****
       
 11232  *STRING_TO_UDINT
       
 11233  */
       
 11234     case function_string_to_udint :
       
 11235     {
       
 11236         symbol_c *last_type_symbol = NULL;
       
 11237 
       
 11238         {
       
 11239             identifier_c param_name("IN");
       
 11240             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11241             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11242             
       
 11243             /* Get the value from a foo(<param_value>) style call */
       
 11244             if (IN_param_value == NULL)
       
 11245               IN_param_value = function_call_param_iterator.next();
       
 11246             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11247             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11248             
       
 11249             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11250             {
       
 11251         
       
 11252                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 11253                 s4o.print("(");
       
 11254                 return_type_symbol->accept(*this);
       
 11255                 s4o.print(")__string_to_uint(");
       
 11256                 IN_param_value->accept(*this);
       
 11257                 s4o.print(")");
       
 11258                 return NULL;
       
 11259                 
       
 11260             }
       
 11261             
       
 11262             ERROR;
       
 11263         }
       
 11264         
       
 11265     }/*function_string_to_udint*/
       
 11266     break;
       
 11267 
       
 11268 /****
       
 11269  *STRING_TO_ULINT
       
 11270  */
       
 11271     case function_string_to_ulint :
       
 11272     {
       
 11273         symbol_c *last_type_symbol = NULL;
       
 11274 
       
 11275         {
       
 11276             identifier_c param_name("IN");
       
 11277             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11278             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11279             
       
 11280             /* Get the value from a foo(<param_value>) style call */
       
 11281             if (IN_param_value == NULL)
       
 11282               IN_param_value = function_call_param_iterator.next();
       
 11283             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11284             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11285             
       
 11286             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11287             {
       
 11288         
       
 11289                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 11290                 s4o.print("(");
       
 11291                 return_type_symbol->accept(*this);
       
 11292                 s4o.print(")__string_to_uint(");
       
 11293                 IN_param_value->accept(*this);
       
 11294                 s4o.print(")");
       
 11295                 return NULL;
       
 11296                 
       
 11297             }
       
 11298             
       
 11299             ERROR;
       
 11300         }
       
 11301         
       
 11302     }/*function_string_to_ulint*/
       
 11303     break;
       
 11304 
       
 11305 /****
       
 11306  *STRING_TO_TIME
       
 11307  */
       
 11308     case function_string_to_time :
       
 11309     {
       
 11310         symbol_c *last_type_symbol = NULL;
       
 11311 
       
 11312         {
       
 11313             identifier_c param_name("IN");
       
 11314             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11315             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11316             
       
 11317             /* Get the value from a foo(<param_value>) style call */
       
 11318             if (IN_param_value == NULL)
       
 11319               IN_param_value = function_call_param_iterator.next();
       
 11320             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11321             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11322             
       
 11323             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11324             {
       
 11325         
       
 11326                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 11327                 s4o.print("(");
       
 11328                 return_type_symbol->accept(*this);
       
 11329                 s4o.print(")__string_to_time(");
       
 11330                 IN_param_value->accept(*this);
       
 11331                 s4o.print(")");
       
 11332                 return NULL;
       
 11333                 
       
 11334             }
       
 11335             
       
 11336             ERROR;
       
 11337         }
       
 11338         
       
 11339     }/*function_string_to_time*/
       
 11340     break;
       
 11341 
       
 11342 /****
       
 11343  *STRING_TO_BOOL
       
 11344  */
       
 11345     case function_string_to_bool :
       
 11346     {
       
 11347         symbol_c *last_type_symbol = NULL;
       
 11348 
       
 11349         {
       
 11350             identifier_c param_name("IN");
       
 11351             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11352             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11353             
       
 11354             /* Get the value from a foo(<param_value>) style call */
       
 11355             if (IN_param_value == NULL)
       
 11356               IN_param_value = function_call_param_iterator.next();
       
 11357             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11358             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11359             
       
 11360             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11361             {
       
 11362         
       
 11363                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 11364                 s4o.print("(");
       
 11365                 return_type_symbol->accept(*this);
       
 11366                 s4o.print(")__string_to_bool(");
       
 11367                 IN_param_value->accept(*this);
       
 11368                 s4o.print(")");
       
 11369                 return NULL;
       
 11370                 
       
 11371             }
       
 11372             
       
 11373             ERROR;
       
 11374         }
       
 11375         
       
 11376     }/*function_string_to_bool*/
       
 11377     break;
       
 11378 
       
 11379 /****
       
 11380  *STRING_TO_BYTE
       
 11381  */
       
 11382     case function_string_to_byte :
       
 11383     {
       
 11384         symbol_c *last_type_symbol = NULL;
       
 11385 
       
 11386         {
       
 11387             identifier_c param_name("IN");
       
 11388             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11389             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11390             
       
 11391             /* Get the value from a foo(<param_value>) style call */
       
 11392             if (IN_param_value == NULL)
       
 11393               IN_param_value = function_call_param_iterator.next();
       
 11394             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11395             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11396             
       
 11397             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11398             {
       
 11399         
       
 11400                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 11401                 s4o.print("(");
       
 11402                 return_type_symbol->accept(*this);
       
 11403                 s4o.print(")__string_to_bit(");
       
 11404                 IN_param_value->accept(*this);
       
 11405                 s4o.print(")");
       
 11406                 return NULL;
       
 11407                 
       
 11408             }
       
 11409             
       
 11410             ERROR;
       
 11411         }
       
 11412         
       
 11413     }/*function_string_to_byte*/
       
 11414     break;
       
 11415 
       
 11416 /****
       
 11417  *STRING_TO_WORD
       
 11418  */
       
 11419     case function_string_to_word :
       
 11420     {
       
 11421         symbol_c *last_type_symbol = NULL;
       
 11422 
       
 11423         {
       
 11424             identifier_c param_name("IN");
       
 11425             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11426             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11427             
       
 11428             /* Get the value from a foo(<param_value>) style call */
       
 11429             if (IN_param_value == NULL)
       
 11430               IN_param_value = function_call_param_iterator.next();
       
 11431             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11432             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11433             
       
 11434             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11435             {
       
 11436         
       
 11437                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 11438                 s4o.print("(");
       
 11439                 return_type_symbol->accept(*this);
       
 11440                 s4o.print(")__string_to_bit(");
       
 11441                 IN_param_value->accept(*this);
       
 11442                 s4o.print(")");
       
 11443                 return NULL;
       
 11444                 
       
 11445             }
       
 11446             
       
 11447             ERROR;
       
 11448         }
       
 11449         
       
 11450     }/*function_string_to_word*/
       
 11451     break;
       
 11452 
       
 11453 /****
       
 11454  *STRING_TO_DWORD
       
 11455  */
       
 11456     case function_string_to_dword :
       
 11457     {
       
 11458         symbol_c *last_type_symbol = NULL;
       
 11459 
       
 11460         {
       
 11461             identifier_c param_name("IN");
       
 11462             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11463             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11464             
       
 11465             /* Get the value from a foo(<param_value>) style call */
       
 11466             if (IN_param_value == NULL)
       
 11467               IN_param_value = function_call_param_iterator.next();
       
 11468             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11469             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11470             
       
 11471             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11472             {
       
 11473         
       
 11474                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 11475                 s4o.print("(");
       
 11476                 return_type_symbol->accept(*this);
       
 11477                 s4o.print(")__string_to_bit(");
       
 11478                 IN_param_value->accept(*this);
       
 11479                 s4o.print(")");
       
 11480                 return NULL;
       
 11481                 
       
 11482             }
       
 11483             
       
 11484             ERROR;
       
 11485         }
       
 11486         
       
 11487     }/*function_string_to_dword*/
       
 11488     break;
       
 11489 
       
 11490 /****
       
 11491  *STRING_TO_LWORD
       
 11492  */
       
 11493     case function_string_to_lword :
       
 11494     {
       
 11495         symbol_c *last_type_symbol = NULL;
       
 11496 
       
 11497         {
       
 11498             identifier_c param_name("IN");
       
 11499             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11500             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11501             
       
 11502             /* Get the value from a foo(<param_value>) style call */
       
 11503             if (IN_param_value == NULL)
       
 11504               IN_param_value = function_call_param_iterator.next();
       
 11505             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11506             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11507             
       
 11508             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
  1258             {
 11509             {
  1259         
 11510         
  1260                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
 11511                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
  1261                 s4o.print("(");
 11512                 s4o.print("(");
  1262                 return_type_symbol->accept(*this);
 11513                 return_type_symbol->accept(*this);
  1263                 s4o.print(")");
 11514                 s4o.print(")__string_to_bit(");
  1264                 IN_param_value->accept(*this);
 11515                 IN_param_value->accept(*this);
  1265                 return NULL;
 11516                 s4o.print(")");
  1266                 
 11517                 return NULL;
  1267             }
 11518                 
  1268             
 11519             }
  1269             ERROR;
 11520             
  1270         }
 11521             ERROR;
  1271         
 11522         }
  1272     }/*function_lreal_to_lword*/
 11523         
  1273     break;
 11524     }/*function_string_to_lword*/
  1274 
 11525     break;
  1275 /****
 11526 
  1276  *LREAL_TO_STRING
 11527 /****
  1277  */
 11528  *STRING_TO_DATE
  1278     case function_lreal_to_string :
 11529  */
  1279     {
 11530     case function_string_to_date :
  1280         symbol_c *last_type_symbol = NULL;
 11531     {
  1281 
 11532         symbol_c *last_type_symbol = NULL;
  1282         {
 11533 
  1283             identifier_c param_name("IN");
 11534         {
  1284             /* Get the value from a foo(<param_name> = <param_value>) style call */
 11535             identifier_c param_name("IN");
  1285             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 11536             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1286             
 11537             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1287             /* Get the value from a foo(<param_value>) style call */
 11538             
  1288             if (IN_param_value == NULL)
 11539             /* Get the value from a foo(<param_value>) style call */
  1289               IN_param_value = function_call_param_iterator.next();
 11540             if (IN_param_value == NULL)
  1290             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 11541               IN_param_value = function_call_param_iterator.next();
  1291             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 11542             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1292             
 11543             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1293             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
 11544             
       
 11545             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11546             {
       
 11547         
       
 11548                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 11549                 s4o.print("(");
       
 11550                 return_type_symbol->accept(*this);
       
 11551                 s4o.print(")__string_to_time(");
       
 11552                 IN_param_value->accept(*this);
       
 11553                 s4o.print(")");
       
 11554                 return NULL;
       
 11555                 
       
 11556             }
       
 11557             
       
 11558             ERROR;
       
 11559         }
       
 11560         
       
 11561     }/*function_string_to_date*/
       
 11562     break;
       
 11563 
       
 11564 /****
       
 11565  *STRING_TO_TOD
       
 11566  */
       
 11567     case function_string_to_tod :
       
 11568     {
       
 11569         symbol_c *last_type_symbol = NULL;
       
 11570 
       
 11571         {
       
 11572             identifier_c param_name("IN");
       
 11573             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11574             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11575             
       
 11576             /* Get the value from a foo(<param_value>) style call */
       
 11577             if (IN_param_value == NULL)
       
 11578               IN_param_value = function_call_param_iterator.next();
       
 11579             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11580             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11581             
       
 11582             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11583             {
       
 11584         
       
 11585                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 11586                 s4o.print("(");
       
 11587                 return_type_symbol->accept(*this);
       
 11588                 s4o.print(")__string_to_time(");
       
 11589                 IN_param_value->accept(*this);
       
 11590                 s4o.print(")");
       
 11591                 return NULL;
       
 11592                 
       
 11593             }
       
 11594             
       
 11595             ERROR;
       
 11596         }
       
 11597         
       
 11598     }/*function_string_to_tod*/
       
 11599     break;
       
 11600 
       
 11601 /****
       
 11602  *STRING_TO_DT
       
 11603  */
       
 11604     case function_string_to_dt :
       
 11605     {
       
 11606         symbol_c *last_type_symbol = NULL;
       
 11607 
       
 11608         {
       
 11609             identifier_c param_name("IN");
       
 11610             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11611             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11612             
       
 11613             /* Get the value from a foo(<param_value>) style call */
       
 11614             if (IN_param_value == NULL)
       
 11615               IN_param_value = function_call_param_iterator.next();
       
 11616             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11617             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11618             
       
 11619             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11620             {
       
 11621         
       
 11622                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 11623                 s4o.print("(");
       
 11624                 return_type_symbol->accept(*this);
       
 11625                 s4o.print(")__string_to_time(");
       
 11626                 IN_param_value->accept(*this);
       
 11627                 s4o.print(")");
       
 11628                 return NULL;
       
 11629                 
       
 11630             }
       
 11631             
       
 11632             ERROR;
       
 11633         }
       
 11634         
       
 11635     }/*function_string_to_dt*/
       
 11636     break;
       
 11637 
       
 11638 /****
       
 11639  *DATE_TO_REAL
       
 11640  */
       
 11641     case function_date_to_real :
       
 11642     {
       
 11643         symbol_c *last_type_symbol = NULL;
       
 11644 
       
 11645         {
       
 11646             identifier_c param_name("IN");
       
 11647             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11648             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11649             
       
 11650             /* Get the value from a foo(<param_value>) style call */
       
 11651             if (IN_param_value == NULL)
       
 11652               IN_param_value = function_call_param_iterator.next();
       
 11653             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11654             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11655             
       
 11656             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 11657             {
       
 11658         
       
 11659                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 11660                 s4o.print("(");
       
 11661                 return_type_symbol->accept(*this);
       
 11662                 s4o.print(")__time_to_real(");
       
 11663                 IN_param_value->accept(*this);
       
 11664                 s4o.print(")");
       
 11665                 return NULL;
       
 11666                 
       
 11667             }
       
 11668             
       
 11669             ERROR;
       
 11670         }
       
 11671         
       
 11672     }/*function_date_to_real*/
       
 11673     break;
       
 11674 
       
 11675 /****
       
 11676  *DATE_TO_LREAL
       
 11677  */
       
 11678     case function_date_to_lreal :
       
 11679     {
       
 11680         symbol_c *last_type_symbol = NULL;
       
 11681 
       
 11682         {
       
 11683             identifier_c param_name("IN");
       
 11684             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11685             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11686             
       
 11687             /* Get the value from a foo(<param_value>) style call */
       
 11688             if (IN_param_value == NULL)
       
 11689               IN_param_value = function_call_param_iterator.next();
       
 11690             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11691             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11692             
       
 11693             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 11694             {
       
 11695         
       
 11696                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 11697                 s4o.print("(");
       
 11698                 return_type_symbol->accept(*this);
       
 11699                 s4o.print(")__time_to_real(");
       
 11700                 IN_param_value->accept(*this);
       
 11701                 s4o.print(")");
       
 11702                 return NULL;
       
 11703                 
       
 11704             }
       
 11705             
       
 11706             ERROR;
       
 11707         }
       
 11708         
       
 11709     }/*function_date_to_lreal*/
       
 11710     break;
       
 11711 
       
 11712 /****
       
 11713  *DATE_TO_SINT
       
 11714  */
       
 11715     case function_date_to_sint :
       
 11716     {
       
 11717         symbol_c *last_type_symbol = NULL;
       
 11718 
       
 11719         {
       
 11720             identifier_c param_name("IN");
       
 11721             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11722             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11723             
       
 11724             /* Get the value from a foo(<param_value>) style call */
       
 11725             if (IN_param_value == NULL)
       
 11726               IN_param_value = function_call_param_iterator.next();
       
 11727             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11728             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11729             
       
 11730             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 11731             {
       
 11732         
       
 11733                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 11734                 s4o.print("(");
       
 11735                 return_type_symbol->accept(*this);
       
 11736                 s4o.print(")__time_to_int(");
       
 11737                 IN_param_value->accept(*this);
       
 11738                 s4o.print(")");
       
 11739                 return NULL;
       
 11740                 
       
 11741             }
       
 11742             
       
 11743             ERROR;
       
 11744         }
       
 11745         
       
 11746     }/*function_date_to_sint*/
       
 11747     break;
       
 11748 
       
 11749 /****
       
 11750  *DATE_TO_INT
       
 11751  */
       
 11752     case function_date_to_int :
       
 11753     {
       
 11754         symbol_c *last_type_symbol = NULL;
       
 11755 
       
 11756         {
       
 11757             identifier_c param_name("IN");
       
 11758             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11759             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11760             
       
 11761             /* Get the value from a foo(<param_value>) style call */
       
 11762             if (IN_param_value == NULL)
       
 11763               IN_param_value = function_call_param_iterator.next();
       
 11764             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11765             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11766             
       
 11767             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 11768             {
       
 11769         
       
 11770                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 11771                 s4o.print("(");
       
 11772                 return_type_symbol->accept(*this);
       
 11773                 s4o.print(")__time_to_int(");
       
 11774                 IN_param_value->accept(*this);
       
 11775                 s4o.print(")");
       
 11776                 return NULL;
       
 11777                 
       
 11778             }
       
 11779             
       
 11780             ERROR;
       
 11781         }
       
 11782         
       
 11783     }/*function_date_to_int*/
       
 11784     break;
       
 11785 
       
 11786 /****
       
 11787  *DATE_TO_DINT
       
 11788  */
       
 11789     case function_date_to_dint :
       
 11790     {
       
 11791         symbol_c *last_type_symbol = NULL;
       
 11792 
       
 11793         {
       
 11794             identifier_c param_name("IN");
       
 11795             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11796             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11797             
       
 11798             /* Get the value from a foo(<param_value>) style call */
       
 11799             if (IN_param_value == NULL)
       
 11800               IN_param_value = function_call_param_iterator.next();
       
 11801             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11802             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11803             
       
 11804             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 11805             {
       
 11806         
       
 11807                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 11808                 s4o.print("(");
       
 11809                 return_type_symbol->accept(*this);
       
 11810                 s4o.print(")__time_to_int(");
       
 11811                 IN_param_value->accept(*this);
       
 11812                 s4o.print(")");
       
 11813                 return NULL;
       
 11814                 
       
 11815             }
       
 11816             
       
 11817             ERROR;
       
 11818         }
       
 11819         
       
 11820     }/*function_date_to_dint*/
       
 11821     break;
       
 11822 
       
 11823 /****
       
 11824  *DATE_TO_LINT
       
 11825  */
       
 11826     case function_date_to_lint :
       
 11827     {
       
 11828         symbol_c *last_type_symbol = NULL;
       
 11829 
       
 11830         {
       
 11831             identifier_c param_name("IN");
       
 11832             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11833             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11834             
       
 11835             /* Get the value from a foo(<param_value>) style call */
       
 11836             if (IN_param_value == NULL)
       
 11837               IN_param_value = function_call_param_iterator.next();
       
 11838             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11839             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11840             
       
 11841             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 11842             {
       
 11843         
       
 11844                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 11845                 s4o.print("(");
       
 11846                 return_type_symbol->accept(*this);
       
 11847                 s4o.print(")__time_to_int(");
       
 11848                 IN_param_value->accept(*this);
       
 11849                 s4o.print(")");
       
 11850                 return NULL;
       
 11851                 
       
 11852             }
       
 11853             
       
 11854             ERROR;
       
 11855         }
       
 11856         
       
 11857     }/*function_date_to_lint*/
       
 11858     break;
       
 11859 
       
 11860 /****
       
 11861  *DATE_TO_USINT
       
 11862  */
       
 11863     case function_date_to_usint :
       
 11864     {
       
 11865         symbol_c *last_type_symbol = NULL;
       
 11866 
       
 11867         {
       
 11868             identifier_c param_name("IN");
       
 11869             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11870             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11871             
       
 11872             /* Get the value from a foo(<param_value>) style call */
       
 11873             if (IN_param_value == NULL)
       
 11874               IN_param_value = function_call_param_iterator.next();
       
 11875             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11876             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11877             
       
 11878             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 11879             {
       
 11880         
       
 11881                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 11882                 s4o.print("(");
       
 11883                 return_type_symbol->accept(*this);
       
 11884                 s4o.print(")__time_to_int(");
       
 11885                 IN_param_value->accept(*this);
       
 11886                 s4o.print(")");
       
 11887                 return NULL;
       
 11888                 
       
 11889             }
       
 11890             
       
 11891             ERROR;
       
 11892         }
       
 11893         
       
 11894     }/*function_date_to_usint*/
       
 11895     break;
       
 11896 
       
 11897 /****
       
 11898  *DATE_TO_UINT
       
 11899  */
       
 11900     case function_date_to_uint :
       
 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 (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 11916             {
       
 11917         
       
 11918                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 11919                 s4o.print("(");
       
 11920                 return_type_symbol->accept(*this);
       
 11921                 s4o.print(")__time_to_int(");
       
 11922                 IN_param_value->accept(*this);
       
 11923                 s4o.print(")");
       
 11924                 return NULL;
       
 11925                 
       
 11926             }
       
 11927             
       
 11928             ERROR;
       
 11929         }
       
 11930         
       
 11931     }/*function_date_to_uint*/
       
 11932     break;
       
 11933 
       
 11934 /****
       
 11935  *DATE_TO_UDINT
       
 11936  */
       
 11937     case function_date_to_udint :
       
 11938     {
       
 11939         symbol_c *last_type_symbol = NULL;
       
 11940 
       
 11941         {
       
 11942             identifier_c param_name("IN");
       
 11943             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11944             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11945             
       
 11946             /* Get the value from a foo(<param_value>) style call */
       
 11947             if (IN_param_value == NULL)
       
 11948               IN_param_value = function_call_param_iterator.next();
       
 11949             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11950             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11951             
       
 11952             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 11953             {
       
 11954         
       
 11955                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 11956                 s4o.print("(");
       
 11957                 return_type_symbol->accept(*this);
       
 11958                 s4o.print(")__time_to_int(");
       
 11959                 IN_param_value->accept(*this);
       
 11960                 s4o.print(")");
       
 11961                 return NULL;
       
 11962                 
       
 11963             }
       
 11964             
       
 11965             ERROR;
       
 11966         }
       
 11967         
       
 11968     }/*function_date_to_udint*/
       
 11969     break;
       
 11970 
       
 11971 /****
       
 11972  *DATE_TO_ULINT
       
 11973  */
       
 11974     case function_date_to_ulint :
       
 11975     {
       
 11976         symbol_c *last_type_symbol = NULL;
       
 11977 
       
 11978         {
       
 11979             identifier_c param_name("IN");
       
 11980             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11981             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11982             
       
 11983             /* Get the value from a foo(<param_value>) style call */
       
 11984             if (IN_param_value == NULL)
       
 11985               IN_param_value = function_call_param_iterator.next();
       
 11986             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11987             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11988             
       
 11989             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 11990             {
       
 11991         
       
 11992                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 11993                 s4o.print("(");
       
 11994                 return_type_symbol->accept(*this);
       
 11995                 s4o.print(")__time_to_int(");
       
 11996                 IN_param_value->accept(*this);
       
 11997                 s4o.print(")");
       
 11998                 return NULL;
       
 11999                 
       
 12000             }
       
 12001             
       
 12002             ERROR;
       
 12003         }
       
 12004         
       
 12005     }/*function_date_to_ulint*/
       
 12006     break;
       
 12007 
       
 12008 /****
       
 12009  *DATE_TO_BOOL
       
 12010  */
       
 12011     case function_date_to_bool :
       
 12012     {
       
 12013         symbol_c *last_type_symbol = NULL;
       
 12014 
       
 12015         {
       
 12016             identifier_c param_name("IN");
       
 12017             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12018             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12019             
       
 12020             /* Get the value from a foo(<param_value>) style call */
       
 12021             if (IN_param_value == NULL)
       
 12022               IN_param_value = function_call_param_iterator.next();
       
 12023             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12024             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12025             
       
 12026             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 12027             {
       
 12028         
       
 12029                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 12030                 s4o.print("(");
       
 12031                 return_type_symbol->accept(*this);
       
 12032                 s4o.print(")__time_to_int(");
       
 12033                 IN_param_value->accept(*this);
       
 12034                 s4o.print(")");
       
 12035                 return NULL;
       
 12036                 
       
 12037             }
       
 12038             
       
 12039             ERROR;
       
 12040         }
       
 12041         
       
 12042     }/*function_date_to_bool*/
       
 12043     break;
       
 12044 
       
 12045 /****
       
 12046  *DATE_TO_BYTE
       
 12047  */
       
 12048     case function_date_to_byte :
       
 12049     {
       
 12050         symbol_c *last_type_symbol = NULL;
       
 12051 
       
 12052         {
       
 12053             identifier_c param_name("IN");
       
 12054             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12055             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12056             
       
 12057             /* Get the value from a foo(<param_value>) style call */
       
 12058             if (IN_param_value == NULL)
       
 12059               IN_param_value = function_call_param_iterator.next();
       
 12060             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12061             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12062             
       
 12063             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 12064             {
       
 12065         
       
 12066                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 12067                 s4o.print("(");
       
 12068                 return_type_symbol->accept(*this);
       
 12069                 s4o.print(")__time_to_int(");
       
 12070                 IN_param_value->accept(*this);
       
 12071                 s4o.print(")");
       
 12072                 return NULL;
       
 12073                 
       
 12074             }
       
 12075             
       
 12076             ERROR;
       
 12077         }
       
 12078         
       
 12079     }/*function_date_to_byte*/
       
 12080     break;
       
 12081 
       
 12082 /****
       
 12083  *DATE_TO_WORD
       
 12084  */
       
 12085     case function_date_to_word :
       
 12086     {
       
 12087         symbol_c *last_type_symbol = NULL;
       
 12088 
       
 12089         {
       
 12090             identifier_c param_name("IN");
       
 12091             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12092             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12093             
       
 12094             /* Get the value from a foo(<param_value>) style call */
       
 12095             if (IN_param_value == NULL)
       
 12096               IN_param_value = function_call_param_iterator.next();
       
 12097             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12098             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12099             
       
 12100             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 12101             {
       
 12102         
       
 12103                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 12104                 s4o.print("(");
       
 12105                 return_type_symbol->accept(*this);
       
 12106                 s4o.print(")__time_to_int(");
       
 12107                 IN_param_value->accept(*this);
       
 12108                 s4o.print(")");
       
 12109                 return NULL;
       
 12110                 
       
 12111             }
       
 12112             
       
 12113             ERROR;
       
 12114         }
       
 12115         
       
 12116     }/*function_date_to_word*/
       
 12117     break;
       
 12118 
       
 12119 /****
       
 12120  *DATE_TO_DWORD
       
 12121  */
       
 12122     case function_date_to_dword :
       
 12123     {
       
 12124         symbol_c *last_type_symbol = NULL;
       
 12125 
       
 12126         {
       
 12127             identifier_c param_name("IN");
       
 12128             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12129             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12130             
       
 12131             /* Get the value from a foo(<param_value>) style call */
       
 12132             if (IN_param_value == NULL)
       
 12133               IN_param_value = function_call_param_iterator.next();
       
 12134             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12135             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12136             
       
 12137             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 12138             {
       
 12139         
       
 12140                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 12141                 s4o.print("(");
       
 12142                 return_type_symbol->accept(*this);
       
 12143                 s4o.print(")__time_to_int(");
       
 12144                 IN_param_value->accept(*this);
       
 12145                 s4o.print(")");
       
 12146                 return NULL;
       
 12147                 
       
 12148             }
       
 12149             
       
 12150             ERROR;
       
 12151         }
       
 12152         
       
 12153     }/*function_date_to_dword*/
       
 12154     break;
       
 12155 
       
 12156 /****
       
 12157  *DATE_TO_LWORD
       
 12158  */
       
 12159     case function_date_to_lword :
       
 12160     {
       
 12161         symbol_c *last_type_symbol = NULL;
       
 12162 
       
 12163         {
       
 12164             identifier_c param_name("IN");
       
 12165             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12166             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12167             
       
 12168             /* Get the value from a foo(<param_value>) style call */
       
 12169             if (IN_param_value == NULL)
       
 12170               IN_param_value = function_call_param_iterator.next();
       
 12171             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12172             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12173             
       
 12174             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 12175             {
       
 12176         
       
 12177                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 12178                 s4o.print("(");
       
 12179                 return_type_symbol->accept(*this);
       
 12180                 s4o.print(")__time_to_int(");
       
 12181                 IN_param_value->accept(*this);
       
 12182                 s4o.print(")");
       
 12183                 return NULL;
       
 12184                 
       
 12185             }
       
 12186             
       
 12187             ERROR;
       
 12188         }
       
 12189         
       
 12190     }/*function_date_to_lword*/
       
 12191     break;
       
 12192 
       
 12193 /****
       
 12194  *DATE_TO_STRING
       
 12195  */
       
 12196     case function_date_to_string :
       
 12197     {
       
 12198         symbol_c *last_type_symbol = NULL;
       
 12199 
       
 12200         {
       
 12201             identifier_c param_name("IN");
       
 12202             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12203             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12204             
       
 12205             /* Get the value from a foo(<param_value>) style call */
       
 12206             if (IN_param_value == NULL)
       
 12207               IN_param_value = function_call_param_iterator.next();
       
 12208             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12209             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12210             
       
 12211             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
  1294             {
 12212             {
  1295         
 12213         
  1296                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 12214                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
  1297                 s4o.print("(");
 12215                 s4o.print("(");
  1298                 return_type_symbol->accept(*this);
 12216                 return_type_symbol->accept(*this);
  1299                 s4o.print(")int_to_string(");
 12217                 s4o.print(")__date_to_string(");
  1300                 IN_param_value->accept(*this);
 12218                 IN_param_value->accept(*this);
  1301                 s4o.print(", 10)");
 12219                 s4o.print(")");
  1302                 return NULL;
 12220                 return NULL;
  1303                 
 12221                 
  1304             }
 12222             }
  1305             
 12223             
  1306             ERROR;
 12224             ERROR;
  1307         }
 12225         }
  1308         
 12226         
  1309     }/*function_lreal_to_string*/
 12227     }/*function_date_to_string*/
  1310     break;
 12228     break;
  1311 
 12229 
  1312 /****
 12230 /****
  1313  *LREAL_TO_WSTRING
 12231  *TOD_TO_REAL
  1314  */
 12232  */
  1315     case function_lreal_to_wstring :
 12233     case function_tod_to_real :
  1316     {
 12234     {
  1317         symbol_c *last_type_symbol = NULL;
 12235         symbol_c *last_type_symbol = NULL;
  1318 
 12236 
  1319         {
 12237         {
  1320             identifier_c param_name("IN");
 12238             identifier_c param_name("IN");
  1321             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12239             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1322             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12240             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1323             
 12241             
  1324             /* Get the value from a foo(<param_value>) style call */
 12242             /* Get the value from a foo(<param_value>) style call */
  1325             if (IN_param_value == NULL)
 12243             if (IN_param_value == NULL)
  1326               IN_param_value = function_call_param_iterator.next();
 12244               IN_param_value = function_call_param_iterator.next();
  1327             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12245             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1328             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12246             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1329             
 12247             
  1330             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
 12248             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  1331             {
       
  1332         
       
  1333                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
  1334                 s4o.print("(");
       
  1335                 return_type_symbol->accept(*this);
       
  1336                 s4o.print(")int_to_string(");
       
  1337                 IN_param_value->accept(*this);
       
  1338                 s4o.print(", 10)");
       
  1339                 return NULL;
       
  1340                 
       
  1341             }
       
  1342             
       
  1343             ERROR;
       
  1344         }
       
  1345         
       
  1346     }/*function_lreal_to_wstring*/
       
  1347     break;
       
  1348 
       
  1349 /****
       
  1350  *LREAL_TO_DATE
       
  1351  */
       
  1352     case function_lreal_to_date :
       
  1353     {
       
  1354         symbol_c *last_type_symbol = NULL;
       
  1355 
       
  1356         {
       
  1357             identifier_c param_name("IN");
       
  1358             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1359             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1360             
       
  1361             /* Get the value from a foo(<param_value>) style call */
       
  1362             if (IN_param_value == NULL)
       
  1363               IN_param_value = function_call_param_iterator.next();
       
  1364             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1365             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1366             
       
  1367             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
  1368             {
       
  1369         
       
  1370                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  1371                 s4o.print("(");
       
  1372                 return_type_symbol->accept(*this);
       
  1373                 s4o.print(")real_to_time(");
       
  1374                 IN_param_value->accept(*this);
       
  1375                 s4o.print(")");
       
  1376                 return NULL;
       
  1377                 
       
  1378             }
       
  1379             
       
  1380             ERROR;
       
  1381         }
       
  1382         
       
  1383     }/*function_lreal_to_date*/
       
  1384     break;
       
  1385 
       
  1386 /****
       
  1387  *LREAL_TO_TOD
       
  1388  */
       
  1389     case function_lreal_to_tod :
       
  1390     {
       
  1391         symbol_c *last_type_symbol = NULL;
       
  1392 
       
  1393         {
       
  1394             identifier_c param_name("IN");
       
  1395             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1396             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1397             
       
  1398             /* Get the value from a foo(<param_value>) style call */
       
  1399             if (IN_param_value == NULL)
       
  1400               IN_param_value = function_call_param_iterator.next();
       
  1401             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1402             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1403             
       
  1404             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
  1405             {
       
  1406         
       
  1407                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  1408                 s4o.print("(");
       
  1409                 return_type_symbol->accept(*this);
       
  1410                 s4o.print(")real_to_time(");
       
  1411                 IN_param_value->accept(*this);
       
  1412                 s4o.print(")");
       
  1413                 return NULL;
       
  1414                 
       
  1415             }
       
  1416             
       
  1417             ERROR;
       
  1418         }
       
  1419         
       
  1420     }/*function_lreal_to_tod*/
       
  1421     break;
       
  1422 
       
  1423 /****
       
  1424  *LREAL_TO_DT
       
  1425  */
       
  1426     case function_lreal_to_dt :
       
  1427     {
       
  1428         symbol_c *last_type_symbol = NULL;
       
  1429 
       
  1430         {
       
  1431             identifier_c param_name("IN");
       
  1432             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1433             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1434             
       
  1435             /* Get the value from a foo(<param_value>) style call */
       
  1436             if (IN_param_value == NULL)
       
  1437               IN_param_value = function_call_param_iterator.next();
       
  1438             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1439             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1440             
       
  1441             if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
       
  1442             {
       
  1443         
       
  1444                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  1445                 s4o.print("(");
       
  1446                 return_type_symbol->accept(*this);
       
  1447                 s4o.print(")real_to_time(");
       
  1448                 IN_param_value->accept(*this);
       
  1449                 s4o.print(")");
       
  1450                 return NULL;
       
  1451                 
       
  1452             }
       
  1453             
       
  1454             ERROR;
       
  1455         }
       
  1456         
       
  1457     }/*function_lreal_to_dt*/
       
  1458     break;
       
  1459 
       
  1460 /****
       
  1461  *SINT_TO_REAL
       
  1462  */
       
  1463     case function_sint_to_real :
       
  1464     {
       
  1465         symbol_c *last_type_symbol = NULL;
       
  1466 
       
  1467         {
       
  1468             identifier_c param_name("IN");
       
  1469             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1470             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1471             
       
  1472             /* Get the value from a foo(<param_value>) style call */
       
  1473             if (IN_param_value == NULL)
       
  1474               IN_param_value = function_call_param_iterator.next();
       
  1475             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1476             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1477             
       
  1478             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1479             {
 12249             {
  1480         
 12250         
  1481                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
 12251                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
  1482                 s4o.print("(");
 12252                 s4o.print("(");
  1483                 return_type_symbol->accept(*this);
 12253                 return_type_symbol->accept(*this);
  1484                 s4o.print(")");
 12254                 s4o.print(")__time_to_real(");
  1485                 IN_param_value->accept(*this);
 12255                 IN_param_value->accept(*this);
  1486                 return NULL;
 12256                 s4o.print(")");
  1487                 
 12257                 return NULL;
  1488             }
 12258                 
  1489             
 12259             }
  1490             ERROR;
 12260             
  1491         }
 12261             ERROR;
  1492         
 12262         }
  1493     }/*function_sint_to_real*/
 12263         
  1494     break;
 12264     }/*function_tod_to_real*/
  1495 
 12265     break;
  1496 /****
 12266 
  1497  *SINT_TO_LREAL
 12267 /****
  1498  */
 12268  *TOD_TO_LREAL
  1499     case function_sint_to_lreal :
 12269  */
  1500     {
 12270     case function_tod_to_lreal :
  1501         symbol_c *last_type_symbol = NULL;
 12271     {
  1502 
 12272         symbol_c *last_type_symbol = NULL;
  1503         {
 12273 
  1504             identifier_c param_name("IN");
 12274         {
  1505             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12275             identifier_c param_name("IN");
  1506             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12276             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1507             
 12277             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1508             /* Get the value from a foo(<param_value>) style call */
 12278             
  1509             if (IN_param_value == NULL)
 12279             /* Get the value from a foo(<param_value>) style call */
  1510               IN_param_value = function_call_param_iterator.next();
 12280             if (IN_param_value == NULL)
  1511             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12281               IN_param_value = function_call_param_iterator.next();
  1512             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12282             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1513             
 12283             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1514             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12284             
       
 12285             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  1515             {
 12286             {
  1516         
 12287         
  1517                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
 12288                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
  1518                 s4o.print("(");
 12289                 s4o.print("(");
  1519                 return_type_symbol->accept(*this);
 12290                 return_type_symbol->accept(*this);
  1520                 s4o.print(")");
 12291                 s4o.print(")__time_to_real(");
  1521                 IN_param_value->accept(*this);
 12292                 IN_param_value->accept(*this);
  1522                 return NULL;
 12293                 s4o.print(")");
  1523                 
 12294                 return NULL;
  1524             }
 12295                 
  1525             
 12296             }
  1526             ERROR;
 12297             
  1527         }
 12298             ERROR;
  1528         
 12299         }
  1529     }/*function_sint_to_lreal*/
 12300         
  1530     break;
 12301     }/*function_tod_to_lreal*/
  1531 
 12302     break;
  1532 /****
 12303 
  1533  *SINT_TO_INT
 12304 /****
  1534  */
 12305  *TOD_TO_SINT
  1535     case function_sint_to_int :
 12306  */
  1536     {
 12307     case function_tod_to_sint :
  1537         symbol_c *last_type_symbol = NULL;
 12308     {
  1538 
 12309         symbol_c *last_type_symbol = NULL;
  1539         {
 12310 
  1540             identifier_c param_name("IN");
 12311         {
  1541             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12312             identifier_c param_name("IN");
  1542             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12313             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1543             
 12314             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1544             /* Get the value from a foo(<param_value>) style call */
 12315             
  1545             if (IN_param_value == NULL)
 12316             /* Get the value from a foo(<param_value>) style call */
  1546               IN_param_value = function_call_param_iterator.next();
 12317             if (IN_param_value == NULL)
  1547             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12318               IN_param_value = function_call_param_iterator.next();
  1548             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12319             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1549             
 12320             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1550             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12321             
       
 12322             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 12323             {
       
 12324         
       
 12325                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 12326                 s4o.print("(");
       
 12327                 return_type_symbol->accept(*this);
       
 12328                 s4o.print(")__time_to_int(");
       
 12329                 IN_param_value->accept(*this);
       
 12330                 s4o.print(")");
       
 12331                 return NULL;
       
 12332                 
       
 12333             }
       
 12334             
       
 12335             ERROR;
       
 12336         }
       
 12337         
       
 12338     }/*function_tod_to_sint*/
       
 12339     break;
       
 12340 
       
 12341 /****
       
 12342  *TOD_TO_INT
       
 12343  */
       
 12344     case function_tod_to_int :
       
 12345     {
       
 12346         symbol_c *last_type_symbol = NULL;
       
 12347 
       
 12348         {
       
 12349             identifier_c param_name("IN");
       
 12350             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12351             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12352             
       
 12353             /* Get the value from a foo(<param_value>) style call */
       
 12354             if (IN_param_value == NULL)
       
 12355               IN_param_value = function_call_param_iterator.next();
       
 12356             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12357             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12358             
       
 12359             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  1551             {
 12360             {
  1552         
 12361         
  1553                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
 12362                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
  1554                 s4o.print("(");
 12363                 s4o.print("(");
  1555                 return_type_symbol->accept(*this);
 12364                 return_type_symbol->accept(*this);
  1556                 s4o.print(")");
 12365                 s4o.print(")__time_to_int(");
  1557                 IN_param_value->accept(*this);
 12366                 IN_param_value->accept(*this);
  1558                 return NULL;
 12367                 s4o.print(")");
  1559                 
 12368                 return NULL;
  1560             }
 12369                 
  1561             
 12370             }
  1562             ERROR;
 12371             
  1563         }
 12372             ERROR;
  1564         
 12373         }
  1565     }/*function_sint_to_int*/
 12374         
  1566     break;
 12375     }/*function_tod_to_int*/
  1567 
 12376     break;
  1568 /****
 12377 
  1569  *SINT_TO_DINT
 12378 /****
  1570  */
 12379  *TOD_TO_DINT
  1571     case function_sint_to_dint :
 12380  */
  1572     {
 12381     case function_tod_to_dint :
  1573         symbol_c *last_type_symbol = NULL;
 12382     {
  1574 
 12383         symbol_c *last_type_symbol = NULL;
  1575         {
 12384 
  1576             identifier_c param_name("IN");
 12385         {
  1577             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12386             identifier_c param_name("IN");
  1578             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12387             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1579             
 12388             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1580             /* Get the value from a foo(<param_value>) style call */
 12389             
  1581             if (IN_param_value == NULL)
 12390             /* Get the value from a foo(<param_value>) style call */
  1582               IN_param_value = function_call_param_iterator.next();
 12391             if (IN_param_value == NULL)
  1583             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12392               IN_param_value = function_call_param_iterator.next();
  1584             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12393             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1585             
 12394             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1586             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12395             
       
 12396             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  1587             {
 12397             {
  1588         
 12398         
  1589                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
 12399                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
  1590                 s4o.print("(");
 12400                 s4o.print("(");
  1591                 return_type_symbol->accept(*this);
 12401                 return_type_symbol->accept(*this);
  1592                 s4o.print(")");
 12402                 s4o.print(")__time_to_int(");
  1593                 IN_param_value->accept(*this);
 12403                 IN_param_value->accept(*this);
  1594                 return NULL;
 12404                 s4o.print(")");
  1595                 
 12405                 return NULL;
  1596             }
 12406                 
  1597             
 12407             }
  1598             ERROR;
 12408             
  1599         }
 12409             ERROR;
  1600         
 12410         }
  1601     }/*function_sint_to_dint*/
 12411         
  1602     break;
 12412     }/*function_tod_to_dint*/
  1603 
 12413     break;
  1604 /****
 12414 
  1605  *SINT_TO_LINT
 12415 /****
  1606  */
 12416  *TOD_TO_LINT
  1607     case function_sint_to_lint :
 12417  */
  1608     {
 12418     case function_tod_to_lint :
  1609         symbol_c *last_type_symbol = NULL;
 12419     {
  1610 
 12420         symbol_c *last_type_symbol = NULL;
  1611         {
 12421 
  1612             identifier_c param_name("IN");
 12422         {
  1613             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12423             identifier_c param_name("IN");
  1614             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12424             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1615             
 12425             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1616             /* Get the value from a foo(<param_value>) style call */
 12426             
  1617             if (IN_param_value == NULL)
 12427             /* Get the value from a foo(<param_value>) style call */
  1618               IN_param_value = function_call_param_iterator.next();
 12428             if (IN_param_value == NULL)
  1619             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12429               IN_param_value = function_call_param_iterator.next();
  1620             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12430             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1621             
 12431             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1622             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12432             
       
 12433             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  1623             {
 12434             {
  1624         
 12435         
  1625                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
 12436                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
  1626                 s4o.print("(");
 12437                 s4o.print("(");
  1627                 return_type_symbol->accept(*this);
 12438                 return_type_symbol->accept(*this);
  1628                 s4o.print(")");
 12439                 s4o.print(")__time_to_int(");
  1629                 IN_param_value->accept(*this);
 12440                 IN_param_value->accept(*this);
  1630                 return NULL;
 12441                 s4o.print(")");
  1631                 
 12442                 return NULL;
  1632             }
 12443                 
  1633             
 12444             }
  1634             ERROR;
 12445             
  1635         }
 12446             ERROR;
  1636         
 12447         }
  1637     }/*function_sint_to_lint*/
 12448         
  1638     break;
 12449     }/*function_tod_to_lint*/
  1639 
 12450     break;
  1640 /****
 12451 
  1641  *SINT_TO_USINT
 12452 /****
  1642  */
 12453  *TOD_TO_USINT
  1643     case function_sint_to_usint :
 12454  */
  1644     {
 12455     case function_tod_to_usint :
  1645         symbol_c *last_type_symbol = NULL;
 12456     {
  1646 
 12457         symbol_c *last_type_symbol = NULL;
  1647         {
 12458 
  1648             identifier_c param_name("IN");
 12459         {
  1649             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12460             identifier_c param_name("IN");
  1650             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12461             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1651             
 12462             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1652             /* Get the value from a foo(<param_value>) style call */
 12463             
  1653             if (IN_param_value == NULL)
 12464             /* Get the value from a foo(<param_value>) style call */
  1654               IN_param_value = function_call_param_iterator.next();
 12465             if (IN_param_value == NULL)
  1655             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12466               IN_param_value = function_call_param_iterator.next();
  1656             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12467             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1657             
 12468             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1658             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12469             
       
 12470             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  1659             {
 12471             {
  1660         
 12472         
  1661                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
 12473                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
  1662                 s4o.print("(");
 12474                 s4o.print("(");
  1663                 return_type_symbol->accept(*this);
 12475                 return_type_symbol->accept(*this);
  1664                 s4o.print(")");
 12476                 s4o.print(")__time_to_int(");
  1665                 IN_param_value->accept(*this);
 12477                 IN_param_value->accept(*this);
  1666                 return NULL;
 12478                 s4o.print(")");
  1667                 
 12479                 return NULL;
  1668             }
 12480                 
  1669             
 12481             }
  1670             ERROR;
 12482             
  1671         }
 12483             ERROR;
  1672         
 12484         }
  1673     }/*function_sint_to_usint*/
 12485         
  1674     break;
 12486     }/*function_tod_to_usint*/
  1675 
 12487     break;
  1676 /****
 12488 
  1677  *SINT_TO_UINT
 12489 /****
  1678  */
 12490  *TOD_TO_UINT
  1679     case function_sint_to_uint :
 12491  */
  1680     {
 12492     case function_tod_to_uint :
  1681         symbol_c *last_type_symbol = NULL;
 12493     {
  1682 
 12494         symbol_c *last_type_symbol = NULL;
  1683         {
 12495 
  1684             identifier_c param_name("IN");
 12496         {
  1685             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12497             identifier_c param_name("IN");
  1686             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12498             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1687             
 12499             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1688             /* Get the value from a foo(<param_value>) style call */
 12500             
  1689             if (IN_param_value == NULL)
 12501             /* Get the value from a foo(<param_value>) style call */
  1690               IN_param_value = function_call_param_iterator.next();
 12502             if (IN_param_value == NULL)
  1691             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12503               IN_param_value = function_call_param_iterator.next();
  1692             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12504             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1693             
 12505             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1694             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12506             
       
 12507             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  1695             {
 12508             {
  1696         
 12509         
  1697                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
 12510                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
  1698                 s4o.print("(");
 12511                 s4o.print("(");
  1699                 return_type_symbol->accept(*this);
 12512                 return_type_symbol->accept(*this);
  1700                 s4o.print(")");
 12513                 s4o.print(")__time_to_int(");
  1701                 IN_param_value->accept(*this);
 12514                 IN_param_value->accept(*this);
  1702                 return NULL;
 12515                 s4o.print(")");
  1703                 
 12516                 return NULL;
  1704             }
 12517                 
  1705             
 12518             }
  1706             ERROR;
 12519             
  1707         }
 12520             ERROR;
  1708         
 12521         }
  1709     }/*function_sint_to_uint*/
 12522         
  1710     break;
 12523     }/*function_tod_to_uint*/
  1711 
 12524     break;
  1712 /****
 12525 
  1713  *SINT_TO_UDINT
 12526 /****
  1714  */
 12527  *TOD_TO_UDINT
  1715     case function_sint_to_udint :
 12528  */
  1716     {
 12529     case function_tod_to_udint :
  1717         symbol_c *last_type_symbol = NULL;
 12530     {
  1718 
 12531         symbol_c *last_type_symbol = NULL;
  1719         {
 12532 
  1720             identifier_c param_name("IN");
 12533         {
  1721             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12534             identifier_c param_name("IN");
  1722             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12535             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1723             
 12536             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1724             /* Get the value from a foo(<param_value>) style call */
 12537             
  1725             if (IN_param_value == NULL)
 12538             /* Get the value from a foo(<param_value>) style call */
  1726               IN_param_value = function_call_param_iterator.next();
 12539             if (IN_param_value == NULL)
  1727             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12540               IN_param_value = function_call_param_iterator.next();
  1728             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12541             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1729             
 12542             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1730             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12543             
       
 12544             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  1731             {
 12545             {
  1732         
 12546         
  1733                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
 12547                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
  1734                 s4o.print("(");
 12548                 s4o.print("(");
  1735                 return_type_symbol->accept(*this);
 12549                 return_type_symbol->accept(*this);
  1736                 s4o.print(")");
 12550                 s4o.print(")__time_to_int(");
  1737                 IN_param_value->accept(*this);
 12551                 IN_param_value->accept(*this);
  1738                 return NULL;
 12552                 s4o.print(")");
  1739                 
 12553                 return NULL;
  1740             }
 12554                 
  1741             
 12555             }
  1742             ERROR;
 12556             
  1743         }
 12557             ERROR;
  1744         
 12558         }
  1745     }/*function_sint_to_udint*/
 12559         
  1746     break;
 12560     }/*function_tod_to_udint*/
  1747 
 12561     break;
  1748 /****
 12562 
  1749  *SINT_TO_ULINT
 12563 /****
  1750  */
 12564  *TOD_TO_ULINT
  1751     case function_sint_to_ulint :
 12565  */
  1752     {
 12566     case function_tod_to_ulint :
  1753         symbol_c *last_type_symbol = NULL;
 12567     {
  1754 
 12568         symbol_c *last_type_symbol = NULL;
  1755         {
 12569 
  1756             identifier_c param_name("IN");
 12570         {
  1757             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12571             identifier_c param_name("IN");
  1758             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12572             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1759             
 12573             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1760             /* Get the value from a foo(<param_value>) style call */
 12574             
  1761             if (IN_param_value == NULL)
 12575             /* Get the value from a foo(<param_value>) style call */
  1762               IN_param_value = function_call_param_iterator.next();
 12576             if (IN_param_value == NULL)
  1763             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12577               IN_param_value = function_call_param_iterator.next();
  1764             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12578             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1765             
 12579             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1766             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12580             
       
 12581             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  1767             {
 12582             {
  1768         
 12583         
  1769                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
 12584                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
  1770                 s4o.print("(");
 12585                 s4o.print("(");
  1771                 return_type_symbol->accept(*this);
 12586                 return_type_symbol->accept(*this);
  1772                 s4o.print(")");
 12587                 s4o.print(")__time_to_int(");
  1773                 IN_param_value->accept(*this);
 12588                 IN_param_value->accept(*this);
  1774                 return NULL;
 12589                 s4o.print(")");
  1775                 
 12590                 return NULL;
  1776             }
 12591                 
  1777             
 12592             }
  1778             ERROR;
 12593             
  1779         }
 12594             ERROR;
  1780         
 12595         }
  1781     }/*function_sint_to_ulint*/
 12596         
  1782     break;
 12597     }/*function_tod_to_ulint*/
  1783 
 12598     break;
  1784 /****
 12599 
  1785  *SINT_TO_TIME
 12600 /****
  1786  */
 12601  *TOD_TO_BOOL
  1787     case function_sint_to_time :
 12602  */
  1788     {
 12603     case function_tod_to_bool :
  1789         symbol_c *last_type_symbol = NULL;
 12604     {
  1790 
 12605         symbol_c *last_type_symbol = NULL;
  1791         {
 12606 
  1792             identifier_c param_name("IN");
 12607         {
  1793             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12608             identifier_c param_name("IN");
  1794             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12609             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1795             
 12610             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1796             /* Get the value from a foo(<param_value>) style call */
 12611             
  1797             if (IN_param_value == NULL)
 12612             /* Get the value from a foo(<param_value>) style call */
  1798               IN_param_value = function_call_param_iterator.next();
 12613             if (IN_param_value == NULL)
  1799             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12614               IN_param_value = function_call_param_iterator.next();
  1800             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12615             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1801             
 12616             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1802             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12617             
  1803             {
 12618             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  1804         
       
  1805                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  1806                 s4o.print("(");
       
  1807                 return_type_symbol->accept(*this);
       
  1808                 s4o.print(")real_to_time(");
       
  1809                 IN_param_value->accept(*this);
       
  1810                 s4o.print(")");
       
  1811                 return NULL;
       
  1812                 
       
  1813             }
       
  1814             
       
  1815             ERROR;
       
  1816         }
       
  1817         
       
  1818     }/*function_sint_to_time*/
       
  1819     break;
       
  1820 
       
  1821 /****
       
  1822  *SINT_TO_BOOL
       
  1823  */
       
  1824     case function_sint_to_bool :
       
  1825     {
       
  1826         symbol_c *last_type_symbol = NULL;
       
  1827 
       
  1828         {
       
  1829             identifier_c param_name("IN");
       
  1830             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  1831             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  1832             
       
  1833             /* Get the value from a foo(<param_value>) style call */
       
  1834             if (IN_param_value == NULL)
       
  1835               IN_param_value = function_call_param_iterator.next();
       
  1836             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  1837             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  1838             
       
  1839             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  1840             {
 12619             {
  1841         
 12620         
  1842                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
 12621                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
  1843                 s4o.print("(");
 12622                 s4o.print("(");
  1844                 return_type_symbol->accept(*this);
 12623                 return_type_symbol->accept(*this);
  1845                 s4o.print(")");
 12624                 s4o.print(")__time_to_int(");
  1846                 IN_param_value->accept(*this);
 12625                 IN_param_value->accept(*this);
  1847                 return NULL;
 12626                 s4o.print(")");
  1848                 
 12627                 return NULL;
  1849             }
 12628                 
  1850             
 12629             }
  1851             ERROR;
 12630             
  1852         }
 12631             ERROR;
  1853         
 12632         }
  1854     }/*function_sint_to_bool*/
 12633         
  1855     break;
 12634     }/*function_tod_to_bool*/
  1856 
 12635     break;
  1857 /****
 12636 
  1858  *SINT_TO_BYTE
 12637 /****
  1859  */
 12638  *TOD_TO_BYTE
  1860     case function_sint_to_byte :
 12639  */
  1861     {
 12640     case function_tod_to_byte :
  1862         symbol_c *last_type_symbol = NULL;
 12641     {
  1863 
 12642         symbol_c *last_type_symbol = NULL;
  1864         {
 12643 
  1865             identifier_c param_name("IN");
 12644         {
  1866             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12645             identifier_c param_name("IN");
  1867             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12646             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1868             
 12647             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1869             /* Get the value from a foo(<param_value>) style call */
 12648             
  1870             if (IN_param_value == NULL)
 12649             /* Get the value from a foo(<param_value>) style call */
  1871               IN_param_value = function_call_param_iterator.next();
 12650             if (IN_param_value == NULL)
  1872             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12651               IN_param_value = function_call_param_iterator.next();
  1873             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12652             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1874             
 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 ;
  1875             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12654             
       
 12655             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  1876             {
 12656             {
  1877         
 12657         
  1878                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
 12658                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
  1879                 s4o.print("(");
 12659                 s4o.print("(");
  1880                 return_type_symbol->accept(*this);
 12660                 return_type_symbol->accept(*this);
  1881                 s4o.print(")");
 12661                 s4o.print(")__time_to_int(");
  1882                 IN_param_value->accept(*this);
 12662                 IN_param_value->accept(*this);
  1883                 return NULL;
 12663                 s4o.print(")");
  1884                 
 12664                 return NULL;
  1885             }
 12665                 
  1886             
 12666             }
  1887             ERROR;
 12667             
  1888         }
 12668             ERROR;
  1889         
 12669         }
  1890     }/*function_sint_to_byte*/
 12670         
  1891     break;
 12671     }/*function_tod_to_byte*/
  1892 
 12672     break;
  1893 /****
 12673 
  1894  *SINT_TO_WORD
 12674 /****
  1895  */
 12675  *TOD_TO_WORD
  1896     case function_sint_to_word :
 12676  */
  1897     {
 12677     case function_tod_to_word :
  1898         symbol_c *last_type_symbol = NULL;
 12678     {
  1899 
 12679         symbol_c *last_type_symbol = NULL;
  1900         {
 12680 
  1901             identifier_c param_name("IN");
 12681         {
  1902             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12682             identifier_c param_name("IN");
  1903             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12683             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1904             
 12684             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1905             /* Get the value from a foo(<param_value>) style call */
 12685             
  1906             if (IN_param_value == NULL)
 12686             /* Get the value from a foo(<param_value>) style call */
  1907               IN_param_value = function_call_param_iterator.next();
 12687             if (IN_param_value == NULL)
  1908             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12688               IN_param_value = function_call_param_iterator.next();
  1909             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12689             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1910             
 12690             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1911             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12691             
       
 12692             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  1912             {
 12693             {
  1913         
 12694         
  1914                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
 12695                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
  1915                 s4o.print("(");
 12696                 s4o.print("(");
  1916                 return_type_symbol->accept(*this);
 12697                 return_type_symbol->accept(*this);
  1917                 s4o.print(")");
 12698                 s4o.print(")__time_to_int(");
  1918                 IN_param_value->accept(*this);
 12699                 IN_param_value->accept(*this);
  1919                 return NULL;
 12700                 s4o.print(")");
  1920                 
 12701                 return NULL;
  1921             }
 12702                 
  1922             
 12703             }
  1923             ERROR;
 12704             
  1924         }
 12705             ERROR;
  1925         
 12706         }
  1926     }/*function_sint_to_word*/
 12707         
  1927     break;
 12708     }/*function_tod_to_word*/
  1928 
 12709     break;
  1929 /****
 12710 
  1930  *SINT_TO_DWORD
 12711 /****
  1931  */
 12712  *TOD_TO_DWORD
  1932     case function_sint_to_dword :
 12713  */
  1933     {
 12714     case function_tod_to_dword :
  1934         symbol_c *last_type_symbol = NULL;
 12715     {
  1935 
 12716         symbol_c *last_type_symbol = NULL;
  1936         {
 12717 
  1937             identifier_c param_name("IN");
 12718         {
  1938             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12719             identifier_c param_name("IN");
  1939             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12720             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1940             
 12721             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1941             /* Get the value from a foo(<param_value>) style call */
 12722             
  1942             if (IN_param_value == NULL)
 12723             /* Get the value from a foo(<param_value>) style call */
  1943               IN_param_value = function_call_param_iterator.next();
 12724             if (IN_param_value == NULL)
  1944             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12725               IN_param_value = function_call_param_iterator.next();
  1945             last_type_symbol = last_type_symbol && search_expression_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             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1946             
 12727             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1947             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12728             
       
 12729             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  1948             {
 12730             {
  1949         
 12731         
  1950                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
 12732                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
  1951                 s4o.print("(");
 12733                 s4o.print("(");
  1952                 return_type_symbol->accept(*this);
 12734                 return_type_symbol->accept(*this);
  1953                 s4o.print(")");
 12735                 s4o.print(")__time_to_int(");
  1954                 IN_param_value->accept(*this);
 12736                 IN_param_value->accept(*this);
  1955                 return NULL;
 12737                 s4o.print(")");
  1956                 
 12738                 return NULL;
  1957             }
 12739                 
  1958             
 12740             }
  1959             ERROR;
 12741             
  1960         }
 12742             ERROR;
  1961         
 12743         }
  1962     }/*function_sint_to_dword*/
 12744         
  1963     break;
 12745     }/*function_tod_to_dword*/
  1964 
 12746     break;
  1965 /****
 12747 
  1966  *SINT_TO_LWORD
 12748 /****
  1967  */
 12749  *TOD_TO_LWORD
  1968     case function_sint_to_lword :
 12750  */
  1969     {
 12751     case function_tod_to_lword :
  1970         symbol_c *last_type_symbol = NULL;
 12752     {
  1971 
 12753         symbol_c *last_type_symbol = NULL;
  1972         {
 12754 
  1973             identifier_c param_name("IN");
 12755         {
  1974             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12756             identifier_c param_name("IN");
  1975             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12757             /* Get the value from a foo(<param_name> = <param_value>) style call */
  1976             
 12758             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  1977             /* Get the value from a foo(<param_value>) style call */
 12759             
  1978             if (IN_param_value == NULL)
 12760             /* Get the value from a foo(<param_value>) style call */
  1979               IN_param_value = function_call_param_iterator.next();
 12761             if (IN_param_value == NULL)
  1980             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12762               IN_param_value = function_call_param_iterator.next();
  1981             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12763             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  1982             
 12764             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  1983             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12765             
       
 12766             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  1984             {
 12767             {
  1985         
 12768         
  1986                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
 12769                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
  1987                 s4o.print("(");
 12770                 s4o.print("(");
  1988                 return_type_symbol->accept(*this);
 12771                 return_type_symbol->accept(*this);
  1989                 s4o.print(")");
 12772                 s4o.print(")__time_to_int(");
  1990                 IN_param_value->accept(*this);
 12773                 IN_param_value->accept(*this);
  1991                 return NULL;
 12774                 s4o.print(")");
  1992                 
 12775                 return NULL;
  1993             }
 12776                 
  1994             
 12777             }
  1995             ERROR;
 12778             
  1996         }
 12779             ERROR;
  1997         
 12780         }
  1998     }/*function_sint_to_lword*/
 12781         
  1999     break;
 12782     }/*function_tod_to_lword*/
  2000 
 12783     break;
  2001 /****
 12784 
  2002  *SINT_TO_STRING
 12785 /****
  2003  */
 12786  *TOD_TO_STRING
  2004     case function_sint_to_string :
 12787  */
  2005     {
 12788     case function_tod_to_string :
  2006         symbol_c *last_type_symbol = NULL;
 12789     {
  2007 
 12790         symbol_c *last_type_symbol = NULL;
  2008         {
 12791 
  2009             identifier_c param_name("IN");
 12792         {
  2010             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12793             identifier_c param_name("IN");
  2011             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12794             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2012             
 12795             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2013             /* Get the value from a foo(<param_value>) style call */
 12796             
  2014             if (IN_param_value == NULL)
 12797             /* Get the value from a foo(<param_value>) style call */
  2015               IN_param_value = function_call_param_iterator.next();
 12798             if (IN_param_value == NULL)
  2016             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12799               IN_param_value = function_call_param_iterator.next();
  2017             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12800             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2018             
 12801             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2019             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12802             
       
 12803             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
  2020             {
 12804             {
  2021         
 12805         
  2022                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 12806                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
  2023                 s4o.print("(");
 12807                 s4o.print("(");
  2024                 return_type_symbol->accept(*this);
 12808                 return_type_symbol->accept(*this);
  2025                 s4o.print(")int_to_string(");
 12809                 s4o.print(")__tod_to_string(");
  2026                 IN_param_value->accept(*this);
 12810                 IN_param_value->accept(*this);
  2027                 s4o.print(", 10)");
 12811                 s4o.print(")");
  2028                 return NULL;
 12812                 return NULL;
  2029                 
 12813                 
  2030             }
 12814             }
  2031             
 12815             
  2032             ERROR;
 12816             ERROR;
  2033         }
 12817         }
  2034         
 12818         
  2035     }/*function_sint_to_string*/
 12819     }/*function_tod_to_string*/
  2036     break;
 12820     break;
  2037 
 12821 
  2038 /****
 12822 /****
  2039  *SINT_TO_WSTRING
 12823  *DT_TO_REAL
  2040  */
 12824  */
  2041     case function_sint_to_wstring :
 12825     case function_dt_to_real :
  2042     {
 12826     {
  2043         symbol_c *last_type_symbol = NULL;
 12827         symbol_c *last_type_symbol = NULL;
  2044 
 12828 
  2045         {
 12829         {
  2046             identifier_c param_name("IN");
 12830             identifier_c param_name("IN");
  2047             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12831             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2048             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12832             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2049             
 12833             
  2050             /* Get the value from a foo(<param_value>) style call */
 12834             /* Get the value from a foo(<param_value>) style call */
  2051             if (IN_param_value == NULL)
 12835             if (IN_param_value == NULL)
  2052               IN_param_value = function_call_param_iterator.next();
 12836               IN_param_value = function_call_param_iterator.next();
  2053             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12837             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2054             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12838             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2055             
 12839             
  2056             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 12840             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2057             {
       
  2058         
       
  2059                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
  2060                 s4o.print("(");
       
  2061                 return_type_symbol->accept(*this);
       
  2062                 s4o.print(")int_to_string(");
       
  2063                 IN_param_value->accept(*this);
       
  2064                 s4o.print(", 10)");
       
  2065                 return NULL;
       
  2066                 
       
  2067             }
       
  2068             
       
  2069             ERROR;
       
  2070         }
       
  2071         
       
  2072     }/*function_sint_to_wstring*/
       
  2073     break;
       
  2074 
       
  2075 /****
       
  2076  *SINT_TO_DATE
       
  2077  */
       
  2078     case function_sint_to_date :
       
  2079     {
       
  2080         symbol_c *last_type_symbol = NULL;
       
  2081 
       
  2082         {
       
  2083             identifier_c param_name("IN");
       
  2084             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2085             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2086             
       
  2087             /* Get the value from a foo(<param_value>) style call */
       
  2088             if (IN_param_value == NULL)
       
  2089               IN_param_value = function_call_param_iterator.next();
       
  2090             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2091             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2092             
       
  2093             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  2094             {
       
  2095         
       
  2096                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  2097                 s4o.print("(");
       
  2098                 return_type_symbol->accept(*this);
       
  2099                 s4o.print(")real_to_time(");
       
  2100                 IN_param_value->accept(*this);
       
  2101                 s4o.print(")");
       
  2102                 return NULL;
       
  2103                 
       
  2104             }
       
  2105             
       
  2106             ERROR;
       
  2107         }
       
  2108         
       
  2109     }/*function_sint_to_date*/
       
  2110     break;
       
  2111 
       
  2112 /****
       
  2113  *SINT_TO_TOD
       
  2114  */
       
  2115     case function_sint_to_tod :
       
  2116     {
       
  2117         symbol_c *last_type_symbol = NULL;
       
  2118 
       
  2119         {
       
  2120             identifier_c param_name("IN");
       
  2121             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2122             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2123             
       
  2124             /* Get the value from a foo(<param_value>) style call */
       
  2125             if (IN_param_value == NULL)
       
  2126               IN_param_value = function_call_param_iterator.next();
       
  2127             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2128             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2129             
       
  2130             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  2131             {
       
  2132         
       
  2133                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  2134                 s4o.print("(");
       
  2135                 return_type_symbol->accept(*this);
       
  2136                 s4o.print(")real_to_time(");
       
  2137                 IN_param_value->accept(*this);
       
  2138                 s4o.print(")");
       
  2139                 return NULL;
       
  2140                 
       
  2141             }
       
  2142             
       
  2143             ERROR;
       
  2144         }
       
  2145         
       
  2146     }/*function_sint_to_tod*/
       
  2147     break;
       
  2148 
       
  2149 /****
       
  2150  *SINT_TO_DT
       
  2151  */
       
  2152     case function_sint_to_dt :
       
  2153     {
       
  2154         symbol_c *last_type_symbol = NULL;
       
  2155 
       
  2156         {
       
  2157             identifier_c param_name("IN");
       
  2158             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2159             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2160             
       
  2161             /* Get the value from a foo(<param_value>) style call */
       
  2162             if (IN_param_value == NULL)
       
  2163               IN_param_value = function_call_param_iterator.next();
       
  2164             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2165             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2166             
       
  2167             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
       
  2168             {
       
  2169         
       
  2170                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  2171                 s4o.print("(");
       
  2172                 return_type_symbol->accept(*this);
       
  2173                 s4o.print(")real_to_time(");
       
  2174                 IN_param_value->accept(*this);
       
  2175                 s4o.print(")");
       
  2176                 return NULL;
       
  2177                 
       
  2178             }
       
  2179             
       
  2180             ERROR;
       
  2181         }
       
  2182         
       
  2183     }/*function_sint_to_dt*/
       
  2184     break;
       
  2185 
       
  2186 /****
       
  2187  *INT_TO_REAL
       
  2188  */
       
  2189     case function_int_to_real :
       
  2190     {
       
  2191         symbol_c *last_type_symbol = NULL;
       
  2192 
       
  2193         {
       
  2194             identifier_c param_name("IN");
       
  2195             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2196             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2197             
       
  2198             /* Get the value from a foo(<param_value>) style call */
       
  2199             if (IN_param_value == NULL)
       
  2200               IN_param_value = function_call_param_iterator.next();
       
  2201             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2202             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2203             
       
  2204             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2205             {
 12841             {
  2206         
 12842         
  2207                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
 12843                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
  2208                 s4o.print("(");
 12844                 s4o.print("(");
  2209                 return_type_symbol->accept(*this);
 12845                 return_type_symbol->accept(*this);
  2210                 s4o.print(")");
 12846                 s4o.print(")__time_to_real(");
  2211                 IN_param_value->accept(*this);
 12847                 IN_param_value->accept(*this);
  2212                 return NULL;
 12848                 s4o.print(")");
  2213                 
 12849                 return NULL;
  2214             }
 12850                 
  2215             
 12851             }
  2216             ERROR;
 12852             
  2217         }
 12853             ERROR;
  2218         
 12854         }
  2219     }/*function_int_to_real*/
 12855         
  2220     break;
 12856     }/*function_dt_to_real*/
  2221 
 12857     break;
  2222 /****
 12858 
  2223  *INT_TO_LREAL
 12859 /****
  2224  */
 12860  *DT_TO_LREAL
  2225     case function_int_to_lreal :
 12861  */
  2226     {
 12862     case function_dt_to_lreal :
  2227         symbol_c *last_type_symbol = NULL;
 12863     {
  2228 
 12864         symbol_c *last_type_symbol = NULL;
  2229         {
 12865 
  2230             identifier_c param_name("IN");
 12866         {
  2231             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12867             identifier_c param_name("IN");
  2232             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12868             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2233             
 12869             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2234             /* Get the value from a foo(<param_value>) style call */
 12870             
  2235             if (IN_param_value == NULL)
 12871             /* Get the value from a foo(<param_value>) style call */
  2236               IN_param_value = function_call_param_iterator.next();
 12872             if (IN_param_value == NULL)
  2237             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12873               IN_param_value = function_call_param_iterator.next();
  2238             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12874             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2239             
 12875             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2240             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 12876             
       
 12877             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2241             {
 12878             {
  2242         
 12879         
  2243                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
 12880                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
  2244                 s4o.print("(");
 12881                 s4o.print("(");
  2245                 return_type_symbol->accept(*this);
 12882                 return_type_symbol->accept(*this);
  2246                 s4o.print(")");
 12883                 s4o.print(")__time_to_real(");
  2247                 IN_param_value->accept(*this);
 12884                 IN_param_value->accept(*this);
  2248                 return NULL;
 12885                 s4o.print(")");
  2249                 
 12886                 return NULL;
  2250             }
 12887                 
  2251             
 12888             }
  2252             ERROR;
 12889             
  2253         }
 12890             ERROR;
  2254         
 12891         }
  2255     }/*function_int_to_lreal*/
 12892         
  2256     break;
 12893     }/*function_dt_to_lreal*/
  2257 
 12894     break;
  2258 /****
 12895 
  2259  *INT_TO_SINT
 12896 /****
  2260  */
 12897  *DT_TO_SINT
  2261     case function_int_to_sint :
 12898  */
  2262     {
 12899     case function_dt_to_sint :
  2263         symbol_c *last_type_symbol = NULL;
 12900     {
  2264 
 12901         symbol_c *last_type_symbol = NULL;
  2265         {
 12902 
  2266             identifier_c param_name("IN");
 12903         {
  2267             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12904             identifier_c param_name("IN");
  2268             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12905             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2269             
 12906             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2270             /* Get the value from a foo(<param_value>) style call */
 12907             
  2271             if (IN_param_value == NULL)
 12908             /* Get the value from a foo(<param_value>) style call */
  2272               IN_param_value = function_call_param_iterator.next();
 12909             if (IN_param_value == NULL)
  2273             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12910               IN_param_value = function_call_param_iterator.next();
  2274             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12911             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2275             
 12912             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2276             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 12913             
       
 12914             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2277             {
 12915             {
  2278         
 12916         
  2279                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
 12917                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
  2280                 s4o.print("(");
 12918                 s4o.print("(");
  2281                 return_type_symbol->accept(*this);
 12919                 return_type_symbol->accept(*this);
  2282                 s4o.print(")");
 12920                 s4o.print(")__time_to_int(");
  2283                 IN_param_value->accept(*this);
 12921                 IN_param_value->accept(*this);
  2284                 return NULL;
 12922                 s4o.print(")");
  2285                 
 12923                 return NULL;
  2286             }
 12924                 
  2287             
 12925             }
  2288             ERROR;
 12926             
  2289         }
 12927             ERROR;
  2290         
 12928         }
  2291     }/*function_int_to_sint*/
 12929         
  2292     break;
 12930     }/*function_dt_to_sint*/
  2293 
 12931     break;
  2294 /****
 12932 
  2295  *INT_TO_DINT
 12933 /****
  2296  */
 12934  *DT_TO_INT
  2297     case function_int_to_dint :
 12935  */
  2298     {
 12936     case function_dt_to_int :
  2299         symbol_c *last_type_symbol = NULL;
 12937     {
  2300 
 12938         symbol_c *last_type_symbol = NULL;
  2301         {
 12939 
  2302             identifier_c param_name("IN");
 12940         {
  2303             /* Get the value from a foo(<param_name> = <param_value>) style call */
 12941             identifier_c param_name("IN");
  2304             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 12942             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2305             
 12943             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2306             /* Get the value from a foo(<param_value>) style call */
 12944             
  2307             if (IN_param_value == NULL)
 12945             /* Get the value from a foo(<param_value>) style call */
  2308               IN_param_value = function_call_param_iterator.next();
 12946             if (IN_param_value == NULL)
  2309             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 12947               IN_param_value = function_call_param_iterator.next();
  2310             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 12948             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2311             
 12949             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2312             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 12950             
       
 12951             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 12952             {
       
 12953         
       
 12954                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 12955                 s4o.print("(");
       
 12956                 return_type_symbol->accept(*this);
       
 12957                 s4o.print(")__time_to_int(");
       
 12958                 IN_param_value->accept(*this);
       
 12959                 s4o.print(")");
       
 12960                 return NULL;
       
 12961                 
       
 12962             }
       
 12963             
       
 12964             ERROR;
       
 12965         }
       
 12966         
       
 12967     }/*function_dt_to_int*/
       
 12968     break;
       
 12969 
       
 12970 /****
       
 12971  *DT_TO_DINT
       
 12972  */
       
 12973     case function_dt_to_dint :
       
 12974     {
       
 12975         symbol_c *last_type_symbol = NULL;
       
 12976 
       
 12977         {
       
 12978             identifier_c param_name("IN");
       
 12979             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12980             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12981             
       
 12982             /* Get the value from a foo(<param_value>) style call */
       
 12983             if (IN_param_value == NULL)
       
 12984               IN_param_value = function_call_param_iterator.next();
       
 12985             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12986             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12987             
       
 12988             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2313             {
 12989             {
  2314         
 12990         
  2315                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
 12991                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
  2316                 s4o.print("(");
 12992                 s4o.print("(");
  2317                 return_type_symbol->accept(*this);
 12993                 return_type_symbol->accept(*this);
  2318                 s4o.print(")");
 12994                 s4o.print(")__time_to_int(");
  2319                 IN_param_value->accept(*this);
 12995                 IN_param_value->accept(*this);
  2320                 return NULL;
 12996                 s4o.print(")");
  2321                 
 12997                 return NULL;
  2322             }
 12998                 
  2323             
 12999             }
  2324             ERROR;
 13000             
  2325         }
 13001             ERROR;
  2326         
 13002         }
  2327     }/*function_int_to_dint*/
 13003         
  2328     break;
 13004     }/*function_dt_to_dint*/
  2329 
 13005     break;
  2330 /****
 13006 
  2331  *INT_TO_LINT
 13007 /****
  2332  */
 13008  *DT_TO_LINT
  2333     case function_int_to_lint :
 13009  */
  2334     {
 13010     case function_dt_to_lint :
  2335         symbol_c *last_type_symbol = NULL;
 13011     {
  2336 
 13012         symbol_c *last_type_symbol = NULL;
  2337         {
 13013 
  2338             identifier_c param_name("IN");
 13014         {
  2339             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13015             identifier_c param_name("IN");
  2340             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13016             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2341             
 13017             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2342             /* Get the value from a foo(<param_value>) style call */
 13018             
  2343             if (IN_param_value == NULL)
 13019             /* Get the value from a foo(<param_value>) style call */
  2344               IN_param_value = function_call_param_iterator.next();
 13020             if (IN_param_value == NULL)
  2345             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13021               IN_param_value = function_call_param_iterator.next();
  2346             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13022             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2347             
 13023             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2348             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 13024             
       
 13025             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2349             {
 13026             {
  2350         
 13027         
  2351                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
 13028                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
  2352                 s4o.print("(");
 13029                 s4o.print("(");
  2353                 return_type_symbol->accept(*this);
 13030                 return_type_symbol->accept(*this);
  2354                 s4o.print(")");
 13031                 s4o.print(")__time_to_int(");
  2355                 IN_param_value->accept(*this);
 13032                 IN_param_value->accept(*this);
  2356                 return NULL;
 13033                 s4o.print(")");
  2357                 
 13034                 return NULL;
  2358             }
 13035                 
  2359             
 13036             }
  2360             ERROR;
 13037             
  2361         }
 13038             ERROR;
  2362         
 13039         }
  2363     }/*function_int_to_lint*/
 13040         
  2364     break;
 13041     }/*function_dt_to_lint*/
  2365 
 13042     break;
  2366 /****
 13043 
  2367  *INT_TO_USINT
 13044 /****
  2368  */
 13045  *DT_TO_USINT
  2369     case function_int_to_usint :
 13046  */
  2370     {
 13047     case function_dt_to_usint :
  2371         symbol_c *last_type_symbol = NULL;
 13048     {
  2372 
 13049         symbol_c *last_type_symbol = NULL;
  2373         {
 13050 
  2374             identifier_c param_name("IN");
 13051         {
  2375             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13052             identifier_c param_name("IN");
  2376             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13053             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2377             
 13054             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2378             /* Get the value from a foo(<param_value>) style call */
 13055             
  2379             if (IN_param_value == NULL)
 13056             /* Get the value from a foo(<param_value>) style call */
  2380               IN_param_value = function_call_param_iterator.next();
 13057             if (IN_param_value == NULL)
  2381             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13058               IN_param_value = function_call_param_iterator.next();
  2382             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13059             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2383             
 13060             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2384             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 13061             
       
 13062             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2385             {
 13063             {
  2386         
 13064         
  2387                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
 13065                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
  2388                 s4o.print("(");
 13066                 s4o.print("(");
  2389                 return_type_symbol->accept(*this);
 13067                 return_type_symbol->accept(*this);
  2390                 s4o.print(")");
 13068                 s4o.print(")__time_to_int(");
  2391                 IN_param_value->accept(*this);
 13069                 IN_param_value->accept(*this);
  2392                 return NULL;
 13070                 s4o.print(")");
  2393                 
 13071                 return NULL;
  2394             }
 13072                 
  2395             
 13073             }
  2396             ERROR;
 13074             
  2397         }
 13075             ERROR;
  2398         
 13076         }
  2399     }/*function_int_to_usint*/
 13077         
  2400     break;
 13078     }/*function_dt_to_usint*/
  2401 
 13079     break;
  2402 /****
 13080 
  2403  *INT_TO_UINT
 13081 /****
  2404  */
 13082  *DT_TO_UINT
  2405     case function_int_to_uint :
 13083  */
  2406     {
 13084     case function_dt_to_uint :
  2407         symbol_c *last_type_symbol = NULL;
 13085     {
  2408 
 13086         symbol_c *last_type_symbol = NULL;
  2409         {
 13087 
  2410             identifier_c param_name("IN");
 13088         {
  2411             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13089             identifier_c param_name("IN");
  2412             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13090             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2413             
 13091             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2414             /* Get the value from a foo(<param_value>) style call */
 13092             
  2415             if (IN_param_value == NULL)
 13093             /* Get the value from a foo(<param_value>) style call */
  2416               IN_param_value = function_call_param_iterator.next();
 13094             if (IN_param_value == NULL)
  2417             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13095               IN_param_value = function_call_param_iterator.next();
  2418             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13096             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2419             
 13097             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2420             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 13098             
       
 13099             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2421             {
 13100             {
  2422         
 13101         
  2423                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
 13102                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
  2424                 s4o.print("(");
 13103                 s4o.print("(");
  2425                 return_type_symbol->accept(*this);
 13104                 return_type_symbol->accept(*this);
  2426                 s4o.print(")");
 13105                 s4o.print(")__time_to_int(");
  2427                 IN_param_value->accept(*this);
 13106                 IN_param_value->accept(*this);
  2428                 return NULL;
 13107                 s4o.print(")");
  2429                 
 13108                 return NULL;
  2430             }
 13109                 
  2431             
 13110             }
  2432             ERROR;
 13111             
  2433         }
 13112             ERROR;
  2434         
 13113         }
  2435     }/*function_int_to_uint*/
 13114         
  2436     break;
 13115     }/*function_dt_to_uint*/
  2437 
 13116     break;
  2438 /****
 13117 
  2439  *INT_TO_UDINT
 13118 /****
  2440  */
 13119  *DT_TO_UDINT
  2441     case function_int_to_udint :
 13120  */
  2442     {
 13121     case function_dt_to_udint :
  2443         symbol_c *last_type_symbol = NULL;
 13122     {
  2444 
 13123         symbol_c *last_type_symbol = NULL;
  2445         {
 13124 
  2446             identifier_c param_name("IN");
 13125         {
  2447             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13126             identifier_c param_name("IN");
  2448             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13127             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2449             
 13128             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2450             /* Get the value from a foo(<param_value>) style call */
 13129             
  2451             if (IN_param_value == NULL)
 13130             /* Get the value from a foo(<param_value>) style call */
  2452               IN_param_value = function_call_param_iterator.next();
 13131             if (IN_param_value == NULL)
  2453             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13132               IN_param_value = function_call_param_iterator.next();
  2454             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13133             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2455             
 13134             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2456             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 13135             
       
 13136             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2457             {
 13137             {
  2458         
 13138         
  2459                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
 13139                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
  2460                 s4o.print("(");
 13140                 s4o.print("(");
  2461                 return_type_symbol->accept(*this);
 13141                 return_type_symbol->accept(*this);
  2462                 s4o.print(")");
 13142                 s4o.print(")__time_to_int(");
  2463                 IN_param_value->accept(*this);
 13143                 IN_param_value->accept(*this);
  2464                 return NULL;
 13144                 s4o.print(")");
  2465                 
 13145                 return NULL;
  2466             }
 13146                 
  2467             
 13147             }
  2468             ERROR;
 13148             
  2469         }
 13149             ERROR;
  2470         
 13150         }
  2471     }/*function_int_to_udint*/
 13151         
  2472     break;
 13152     }/*function_dt_to_udint*/
  2473 
 13153     break;
  2474 /****
 13154 
  2475  *INT_TO_ULINT
 13155 /****
  2476  */
 13156  *DT_TO_ULINT
  2477     case function_int_to_ulint :
 13157  */
  2478     {
 13158     case function_dt_to_ulint :
  2479         symbol_c *last_type_symbol = NULL;
 13159     {
  2480 
 13160         symbol_c *last_type_symbol = NULL;
  2481         {
 13161 
  2482             identifier_c param_name("IN");
 13162         {
  2483             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13163             identifier_c param_name("IN");
  2484             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13164             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2485             
 13165             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2486             /* Get the value from a foo(<param_value>) style call */
 13166             
  2487             if (IN_param_value == NULL)
 13167             /* Get the value from a foo(<param_value>) style call */
  2488               IN_param_value = function_call_param_iterator.next();
 13168             if (IN_param_value == NULL)
  2489             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13169               IN_param_value = function_call_param_iterator.next();
  2490             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13170             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2491             
 13171             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2492             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 13172             
       
 13173             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2493             {
 13174             {
  2494         
 13175         
  2495                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
 13176                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
  2496                 s4o.print("(");
 13177                 s4o.print("(");
  2497                 return_type_symbol->accept(*this);
 13178                 return_type_symbol->accept(*this);
  2498                 s4o.print(")");
 13179                 s4o.print(")__time_to_int(");
  2499                 IN_param_value->accept(*this);
 13180                 IN_param_value->accept(*this);
  2500                 return NULL;
 13181                 s4o.print(")");
  2501                 
 13182                 return NULL;
  2502             }
 13183                 
  2503             
 13184             }
  2504             ERROR;
 13185             
  2505         }
 13186             ERROR;
  2506         
 13187         }
  2507     }/*function_int_to_ulint*/
 13188         
  2508     break;
 13189     }/*function_dt_to_ulint*/
  2509 
 13190     break;
  2510 /****
 13191 
  2511  *INT_TO_TIME
 13192 /****
  2512  */
 13193  *DT_TO_BOOL
  2513     case function_int_to_time :
 13194  */
  2514     {
 13195     case function_dt_to_bool :
  2515         symbol_c *last_type_symbol = NULL;
 13196     {
  2516 
 13197         symbol_c *last_type_symbol = NULL;
  2517         {
 13198 
  2518             identifier_c param_name("IN");
 13199         {
  2519             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13200             identifier_c param_name("IN");
  2520             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13201             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2521             
 13202             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2522             /* Get the value from a foo(<param_value>) style call */
 13203             
  2523             if (IN_param_value == NULL)
 13204             /* Get the value from a foo(<param_value>) style call */
  2524               IN_param_value = function_call_param_iterator.next();
 13205             if (IN_param_value == NULL)
  2525             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13206               IN_param_value = function_call_param_iterator.next();
  2526             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13207             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2527             
 13208             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2528             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 13209             
  2529             {
 13210             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2530         
       
  2531                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  2532                 s4o.print("(");
       
  2533                 return_type_symbol->accept(*this);
       
  2534                 s4o.print(")real_to_time(");
       
  2535                 IN_param_value->accept(*this);
       
  2536                 s4o.print(")");
       
  2537                 return NULL;
       
  2538                 
       
  2539             }
       
  2540             
       
  2541             ERROR;
       
  2542         }
       
  2543         
       
  2544     }/*function_int_to_time*/
       
  2545     break;
       
  2546 
       
  2547 /****
       
  2548  *INT_TO_BOOL
       
  2549  */
       
  2550     case function_int_to_bool :
       
  2551     {
       
  2552         symbol_c *last_type_symbol = NULL;
       
  2553 
       
  2554         {
       
  2555             identifier_c param_name("IN");
       
  2556             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2557             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2558             
       
  2559             /* Get the value from a foo(<param_value>) style call */
       
  2560             if (IN_param_value == NULL)
       
  2561               IN_param_value = function_call_param_iterator.next();
       
  2562             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2563             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2564             
       
  2565             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2566             {
 13211             {
  2567         
 13212         
  2568                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
 13213                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
  2569                 s4o.print("(");
 13214                 s4o.print("(");
  2570                 return_type_symbol->accept(*this);
 13215                 return_type_symbol->accept(*this);
  2571                 s4o.print(")");
 13216                 s4o.print(")__time_to_int(");
  2572                 IN_param_value->accept(*this);
 13217                 IN_param_value->accept(*this);
  2573                 return NULL;
 13218                 s4o.print(")");
  2574                 
 13219                 return NULL;
  2575             }
 13220                 
  2576             
 13221             }
  2577             ERROR;
 13222             
  2578         }
 13223             ERROR;
  2579         
 13224         }
  2580     }/*function_int_to_bool*/
 13225         
  2581     break;
 13226     }/*function_dt_to_bool*/
  2582 
 13227     break;
  2583 /****
 13228 
  2584  *INT_TO_BYTE
 13229 /****
  2585  */
 13230  *DT_TO_BYTE
  2586     case function_int_to_byte :
 13231  */
  2587     {
 13232     case function_dt_to_byte :
  2588         symbol_c *last_type_symbol = NULL;
 13233     {
  2589 
 13234         symbol_c *last_type_symbol = NULL;
  2590         {
 13235 
  2591             identifier_c param_name("IN");
 13236         {
  2592             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13237             identifier_c param_name("IN");
  2593             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13238             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2594             
 13239             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2595             /* Get the value from a foo(<param_value>) style call */
 13240             
  2596             if (IN_param_value == NULL)
 13241             /* Get the value from a foo(<param_value>) style call */
  2597               IN_param_value = function_call_param_iterator.next();
 13242             if (IN_param_value == NULL)
  2598             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13243               IN_param_value = function_call_param_iterator.next();
  2599             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13244             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2600             
 13245             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2601             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 13246             
       
 13247             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2602             {
 13248             {
  2603         
 13249         
  2604                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
 13250                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
  2605                 s4o.print("(");
 13251                 s4o.print("(");
  2606                 return_type_symbol->accept(*this);
 13252                 return_type_symbol->accept(*this);
  2607                 s4o.print(")");
 13253                 s4o.print(")__time_to_int(");
  2608                 IN_param_value->accept(*this);
 13254                 IN_param_value->accept(*this);
  2609                 return NULL;
 13255                 s4o.print(")");
  2610                 
 13256                 return NULL;
  2611             }
 13257                 
  2612             
 13258             }
  2613             ERROR;
 13259             
  2614         }
 13260             ERROR;
  2615         
 13261         }
  2616     }/*function_int_to_byte*/
 13262         
  2617     break;
 13263     }/*function_dt_to_byte*/
  2618 
 13264     break;
  2619 /****
 13265 
  2620  *INT_TO_WORD
 13266 /****
  2621  */
 13267  *DT_TO_WORD
  2622     case function_int_to_word :
 13268  */
  2623     {
 13269     case function_dt_to_word :
  2624         symbol_c *last_type_symbol = NULL;
 13270     {
  2625 
 13271         symbol_c *last_type_symbol = NULL;
  2626         {
 13272 
  2627             identifier_c param_name("IN");
 13273         {
  2628             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13274             identifier_c param_name("IN");
  2629             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13275             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2630             
 13276             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2631             /* Get the value from a foo(<param_value>) style call */
 13277             
  2632             if (IN_param_value == NULL)
 13278             /* Get the value from a foo(<param_value>) style call */
  2633               IN_param_value = function_call_param_iterator.next();
 13279             if (IN_param_value == NULL)
  2634             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13280               IN_param_value = function_call_param_iterator.next();
  2635             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13281             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2636             
 13282             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2637             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 13283             
       
 13284             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2638             {
 13285             {
  2639         
 13286         
  2640                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
 13287                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
  2641                 s4o.print("(");
 13288                 s4o.print("(");
  2642                 return_type_symbol->accept(*this);
 13289                 return_type_symbol->accept(*this);
  2643                 s4o.print(")");
 13290                 s4o.print(")__time_to_int(");
  2644                 IN_param_value->accept(*this);
 13291                 IN_param_value->accept(*this);
  2645                 return NULL;
 13292                 s4o.print(")");
  2646                 
 13293                 return NULL;
  2647             }
 13294                 
  2648             
 13295             }
  2649             ERROR;
 13296             
  2650         }
 13297             ERROR;
  2651         
 13298         }
  2652     }/*function_int_to_word*/
 13299         
  2653     break;
 13300     }/*function_dt_to_word*/
  2654 
 13301     break;
  2655 /****
 13302 
  2656  *INT_TO_DWORD
 13303 /****
  2657  */
 13304  *DT_TO_DWORD
  2658     case function_int_to_dword :
 13305  */
  2659     {
 13306     case function_dt_to_dword :
  2660         symbol_c *last_type_symbol = NULL;
 13307     {
  2661 
 13308         symbol_c *last_type_symbol = NULL;
  2662         {
 13309 
  2663             identifier_c param_name("IN");
 13310         {
  2664             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13311             identifier_c param_name("IN");
  2665             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13312             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2666             
 13313             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2667             /* Get the value from a foo(<param_value>) style call */
 13314             
  2668             if (IN_param_value == NULL)
 13315             /* Get the value from a foo(<param_value>) style call */
  2669               IN_param_value = function_call_param_iterator.next();
 13316             if (IN_param_value == NULL)
  2670             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13317               IN_param_value = function_call_param_iterator.next();
  2671             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13318             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2672             
 13319             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2673             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 13320             
       
 13321             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2674             {
 13322             {
  2675         
 13323         
  2676                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
 13324                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
  2677                 s4o.print("(");
 13325                 s4o.print("(");
  2678                 return_type_symbol->accept(*this);
 13326                 return_type_symbol->accept(*this);
  2679                 s4o.print(")");
 13327                 s4o.print(")__time_to_int(");
  2680                 IN_param_value->accept(*this);
 13328                 IN_param_value->accept(*this);
  2681                 return NULL;
 13329                 s4o.print(")");
  2682                 
 13330                 return NULL;
  2683             }
 13331                 
  2684             
 13332             }
  2685             ERROR;
 13333             
  2686         }
 13334             ERROR;
  2687         
 13335         }
  2688     }/*function_int_to_dword*/
 13336         
  2689     break;
 13337     }/*function_dt_to_dword*/
  2690 
 13338     break;
  2691 /****
 13339 
  2692  *INT_TO_LWORD
 13340 /****
  2693  */
 13341  *DT_TO_LWORD
  2694     case function_int_to_lword :
 13342  */
  2695     {
 13343     case function_dt_to_lword :
  2696         symbol_c *last_type_symbol = NULL;
 13344     {
  2697 
 13345         symbol_c *last_type_symbol = NULL;
  2698         {
 13346 
  2699             identifier_c param_name("IN");
 13347         {
  2700             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13348             identifier_c param_name("IN");
  2701             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13349             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2702             
 13350             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2703             /* Get the value from a foo(<param_value>) style call */
 13351             
  2704             if (IN_param_value == NULL)
 13352             /* Get the value from a foo(<param_value>) style call */
  2705               IN_param_value = function_call_param_iterator.next();
 13353             if (IN_param_value == NULL)
  2706             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13354               IN_param_value = function_call_param_iterator.next();
  2707             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13355             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2708             
 13356             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2709             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 13357             
       
 13358             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2710             {
 13359             {
  2711         
 13360         
  2712                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
 13361                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
  2713                 s4o.print("(");
 13362                 s4o.print("(");
  2714                 return_type_symbol->accept(*this);
 13363                 return_type_symbol->accept(*this);
  2715                 s4o.print(")");
 13364                 s4o.print(")__time_to_int(");
  2716                 IN_param_value->accept(*this);
 13365                 IN_param_value->accept(*this);
  2717                 return NULL;
 13366                 s4o.print(")");
  2718                 
 13367                 return NULL;
  2719             }
 13368                 
  2720             
 13369             }
  2721             ERROR;
 13370             
  2722         }
 13371             ERROR;
  2723         
 13372         }
  2724     }/*function_int_to_lword*/
 13373         
  2725     break;
 13374     }/*function_dt_to_lword*/
  2726 
 13375     break;
  2727 /****
 13376 
  2728  *INT_TO_STRING
 13377 /****
  2729  */
 13378  *DT_TO_STRING
  2730     case function_int_to_string :
 13379  */
  2731     {
 13380     case function_dt_to_string :
  2732         symbol_c *last_type_symbol = NULL;
 13381     {
  2733 
 13382         symbol_c *last_type_symbol = NULL;
  2734         {
 13383 
  2735             identifier_c param_name("IN");
 13384         {
  2736             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13385             identifier_c param_name("IN");
  2737             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13386             /* Get the value from a foo(<param_name> = <param_value>) style call */
  2738             
 13387             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
  2739             /* Get the value from a foo(<param_value>) style call */
 13388             
  2740             if (IN_param_value == NULL)
 13389             /* Get the value from a foo(<param_value>) style call */
  2741               IN_param_value = function_call_param_iterator.next();
 13390             if (IN_param_value == NULL)
  2742             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13391               IN_param_value = function_call_param_iterator.next();
  2743             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13392             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
  2744             
 13393             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
  2745             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 13394             
       
 13395             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
  2746             {
 13396             {
  2747         
 13397         
  2748                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 13398                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
  2749                 s4o.print("(");
 13399                 s4o.print("(");
  2750                 return_type_symbol->accept(*this);
 13400                 return_type_symbol->accept(*this);
  2751                 s4o.print(")int_to_string(");
 13401                 s4o.print(")__dt_to_string(");
  2752                 IN_param_value->accept(*this);
       
  2753                 s4o.print(", 10)");
       
  2754                 return NULL;
       
  2755                 
       
  2756             }
       
  2757             
       
  2758             ERROR;
       
  2759         }
       
  2760         
       
  2761     }/*function_int_to_string*/
       
  2762     break;
       
  2763 
       
  2764 /****
       
  2765  *INT_TO_WSTRING
       
  2766  */
       
  2767     case function_int_to_wstring :
       
  2768     {
       
  2769         symbol_c *last_type_symbol = NULL;
       
  2770 
       
  2771         {
       
  2772             identifier_c param_name("IN");
       
  2773             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2774             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2775             
       
  2776             /* Get the value from a foo(<param_value>) style call */
       
  2777             if (IN_param_value == NULL)
       
  2778               IN_param_value = function_call_param_iterator.next();
       
  2779             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2780             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2781             
       
  2782             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2783             {
       
  2784         
       
  2785                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
  2786                 s4o.print("(");
       
  2787                 return_type_symbol->accept(*this);
       
  2788                 s4o.print(")int_to_string(");
       
  2789                 IN_param_value->accept(*this);
       
  2790                 s4o.print(", 10)");
       
  2791                 return NULL;
       
  2792                 
       
  2793             }
       
  2794             
       
  2795             ERROR;
       
  2796         }
       
  2797         
       
  2798     }/*function_int_to_wstring*/
       
  2799     break;
       
  2800 
       
  2801 /****
       
  2802  *INT_TO_DATE
       
  2803  */
       
  2804     case function_int_to_date :
       
  2805     {
       
  2806         symbol_c *last_type_symbol = NULL;
       
  2807 
       
  2808         {
       
  2809             identifier_c param_name("IN");
       
  2810             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2811             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2812             
       
  2813             /* Get the value from a foo(<param_value>) style call */
       
  2814             if (IN_param_value == NULL)
       
  2815               IN_param_value = function_call_param_iterator.next();
       
  2816             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2817             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2818             
       
  2819             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2820             {
       
  2821         
       
  2822                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  2823                 s4o.print("(");
       
  2824                 return_type_symbol->accept(*this);
       
  2825                 s4o.print(")real_to_time(");
       
  2826                 IN_param_value->accept(*this);
       
  2827                 s4o.print(")");
       
  2828                 return NULL;
       
  2829                 
       
  2830             }
       
  2831             
       
  2832             ERROR;
       
  2833         }
       
  2834         
       
  2835     }/*function_int_to_date*/
       
  2836     break;
       
  2837 
       
  2838 /****
       
  2839  *INT_TO_TOD
       
  2840  */
       
  2841     case function_int_to_tod :
       
  2842     {
       
  2843         symbol_c *last_type_symbol = NULL;
       
  2844 
       
  2845         {
       
  2846             identifier_c param_name("IN");
       
  2847             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2848             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2849             
       
  2850             /* Get the value from a foo(<param_value>) style call */
       
  2851             if (IN_param_value == NULL)
       
  2852               IN_param_value = function_call_param_iterator.next();
       
  2853             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2854             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2855             
       
  2856             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2857             {
       
  2858         
       
  2859                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  2860                 s4o.print("(");
       
  2861                 return_type_symbol->accept(*this);
       
  2862                 s4o.print(")real_to_time(");
       
  2863                 IN_param_value->accept(*this);
       
  2864                 s4o.print(")");
       
  2865                 return NULL;
       
  2866                 
       
  2867             }
       
  2868             
       
  2869             ERROR;
       
  2870         }
       
  2871         
       
  2872     }/*function_int_to_tod*/
       
  2873     break;
       
  2874 
       
  2875 /****
       
  2876  *INT_TO_DT
       
  2877  */
       
  2878     case function_int_to_dt :
       
  2879     {
       
  2880         symbol_c *last_type_symbol = NULL;
       
  2881 
       
  2882         {
       
  2883             identifier_c param_name("IN");
       
  2884             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2885             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2886             
       
  2887             /* Get the value from a foo(<param_value>) style call */
       
  2888             if (IN_param_value == NULL)
       
  2889               IN_param_value = function_call_param_iterator.next();
       
  2890             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2891             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2892             
       
  2893             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
       
  2894             {
       
  2895         
       
  2896                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  2897                 s4o.print("(");
       
  2898                 return_type_symbol->accept(*this);
       
  2899                 s4o.print(")real_to_time(");
       
  2900                 IN_param_value->accept(*this);
       
  2901                 s4o.print(")");
       
  2902                 return NULL;
       
  2903                 
       
  2904             }
       
  2905             
       
  2906             ERROR;
       
  2907         }
       
  2908         
       
  2909     }/*function_int_to_dt*/
       
  2910     break;
       
  2911 
       
  2912 /****
       
  2913  *DINT_TO_REAL
       
  2914  */
       
  2915     case function_dint_to_real :
       
  2916     {
       
  2917         symbol_c *last_type_symbol = NULL;
       
  2918 
       
  2919         {
       
  2920             identifier_c param_name("IN");
       
  2921             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2922             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2923             
       
  2924             /* Get the value from a foo(<param_value>) style call */
       
  2925             if (IN_param_value == NULL)
       
  2926               IN_param_value = function_call_param_iterator.next();
       
  2927             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2928             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2929             
       
  2930             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  2931             {
       
  2932         
       
  2933                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  2934                 s4o.print("(");
       
  2935                 return_type_symbol->accept(*this);
       
  2936                 s4o.print(")");
       
  2937                 IN_param_value->accept(*this);
       
  2938                 return NULL;
       
  2939                 
       
  2940             }
       
  2941             
       
  2942             ERROR;
       
  2943         }
       
  2944         
       
  2945     }/*function_dint_to_real*/
       
  2946     break;
       
  2947 
       
  2948 /****
       
  2949  *DINT_TO_LREAL
       
  2950  */
       
  2951     case function_dint_to_lreal :
       
  2952     {
       
  2953         symbol_c *last_type_symbol = NULL;
       
  2954 
       
  2955         {
       
  2956             identifier_c param_name("IN");
       
  2957             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2958             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2959             
       
  2960             /* Get the value from a foo(<param_value>) style call */
       
  2961             if (IN_param_value == NULL)
       
  2962               IN_param_value = function_call_param_iterator.next();
       
  2963             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  2964             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  2965             
       
  2966             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  2967             {
       
  2968         
       
  2969                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  2970                 s4o.print("(");
       
  2971                 return_type_symbol->accept(*this);
       
  2972                 s4o.print(")");
       
  2973                 IN_param_value->accept(*this);
       
  2974                 return NULL;
       
  2975                 
       
  2976             }
       
  2977             
       
  2978             ERROR;
       
  2979         }
       
  2980         
       
  2981     }/*function_dint_to_lreal*/
       
  2982     break;
       
  2983 
       
  2984 /****
       
  2985  *DINT_TO_SINT
       
  2986  */
       
  2987     case function_dint_to_sint :
       
  2988     {
       
  2989         symbol_c *last_type_symbol = NULL;
       
  2990 
       
  2991         {
       
  2992             identifier_c param_name("IN");
       
  2993             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  2994             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  2995             
       
  2996             /* Get the value from a foo(<param_value>) style call */
       
  2997             if (IN_param_value == NULL)
       
  2998               IN_param_value = function_call_param_iterator.next();
       
  2999             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3000             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3001             
       
  3002             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3003             {
       
  3004         
       
  3005                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  3006                 s4o.print("(");
       
  3007                 return_type_symbol->accept(*this);
       
  3008                 s4o.print(")");
       
  3009                 IN_param_value->accept(*this);
       
  3010                 return NULL;
       
  3011                 
       
  3012             }
       
  3013             
       
  3014             ERROR;
       
  3015         }
       
  3016         
       
  3017     }/*function_dint_to_sint*/
       
  3018     break;
       
  3019 
       
  3020 /****
       
  3021  *DINT_TO_INT
       
  3022  */
       
  3023     case function_dint_to_int :
       
  3024     {
       
  3025         symbol_c *last_type_symbol = NULL;
       
  3026 
       
  3027         {
       
  3028             identifier_c param_name("IN");
       
  3029             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3030             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3031             
       
  3032             /* Get the value from a foo(<param_value>) style call */
       
  3033             if (IN_param_value == NULL)
       
  3034               IN_param_value = function_call_param_iterator.next();
       
  3035             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3036             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3037             
       
  3038             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3039             {
       
  3040         
       
  3041                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  3042                 s4o.print("(");
       
  3043                 return_type_symbol->accept(*this);
       
  3044                 s4o.print(")");
       
  3045                 IN_param_value->accept(*this);
       
  3046                 return NULL;
       
  3047                 
       
  3048             }
       
  3049             
       
  3050             ERROR;
       
  3051         }
       
  3052         
       
  3053     }/*function_dint_to_int*/
       
  3054     break;
       
  3055 
       
  3056 /****
       
  3057  *DINT_TO_LINT
       
  3058  */
       
  3059     case function_dint_to_lint :
       
  3060     {
       
  3061         symbol_c *last_type_symbol = NULL;
       
  3062 
       
  3063         {
       
  3064             identifier_c param_name("IN");
       
  3065             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3066             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3067             
       
  3068             /* Get the value from a foo(<param_value>) style call */
       
  3069             if (IN_param_value == NULL)
       
  3070               IN_param_value = function_call_param_iterator.next();
       
  3071             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3072             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3073             
       
  3074             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3075             {
       
  3076         
       
  3077                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  3078                 s4o.print("(");
       
  3079                 return_type_symbol->accept(*this);
       
  3080                 s4o.print(")");
       
  3081                 IN_param_value->accept(*this);
       
  3082                 return NULL;
       
  3083                 
       
  3084             }
       
  3085             
       
  3086             ERROR;
       
  3087         }
       
  3088         
       
  3089     }/*function_dint_to_lint*/
       
  3090     break;
       
  3091 
       
  3092 /****
       
  3093  *DINT_TO_USINT
       
  3094  */
       
  3095     case function_dint_to_usint :
       
  3096     {
       
  3097         symbol_c *last_type_symbol = NULL;
       
  3098 
       
  3099         {
       
  3100             identifier_c param_name("IN");
       
  3101             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3102             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3103             
       
  3104             /* Get the value from a foo(<param_value>) style call */
       
  3105             if (IN_param_value == NULL)
       
  3106               IN_param_value = function_call_param_iterator.next();
       
  3107             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3108             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3109             
       
  3110             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3111             {
       
  3112         
       
  3113                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  3114                 s4o.print("(");
       
  3115                 return_type_symbol->accept(*this);
       
  3116                 s4o.print(")");
       
  3117                 IN_param_value->accept(*this);
       
  3118                 return NULL;
       
  3119                 
       
  3120             }
       
  3121             
       
  3122             ERROR;
       
  3123         }
       
  3124         
       
  3125     }/*function_dint_to_usint*/
       
  3126     break;
       
  3127 
       
  3128 /****
       
  3129  *DINT_TO_UINT
       
  3130  */
       
  3131     case function_dint_to_uint :
       
  3132     {
       
  3133         symbol_c *last_type_symbol = NULL;
       
  3134 
       
  3135         {
       
  3136             identifier_c param_name("IN");
       
  3137             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3138             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3139             
       
  3140             /* Get the value from a foo(<param_value>) style call */
       
  3141             if (IN_param_value == NULL)
       
  3142               IN_param_value = function_call_param_iterator.next();
       
  3143             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3144             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3145             
       
  3146             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3147             {
       
  3148         
       
  3149                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  3150                 s4o.print("(");
       
  3151                 return_type_symbol->accept(*this);
       
  3152                 s4o.print(")");
       
  3153                 IN_param_value->accept(*this);
       
  3154                 return NULL;
       
  3155                 
       
  3156             }
       
  3157             
       
  3158             ERROR;
       
  3159         }
       
  3160         
       
  3161     }/*function_dint_to_uint*/
       
  3162     break;
       
  3163 
       
  3164 /****
       
  3165  *DINT_TO_UDINT
       
  3166  */
       
  3167     case function_dint_to_udint :
       
  3168     {
       
  3169         symbol_c *last_type_symbol = NULL;
       
  3170 
       
  3171         {
       
  3172             identifier_c param_name("IN");
       
  3173             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3174             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3175             
       
  3176             /* Get the value from a foo(<param_value>) style call */
       
  3177             if (IN_param_value == NULL)
       
  3178               IN_param_value = function_call_param_iterator.next();
       
  3179             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3180             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3181             
       
  3182             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3183             {
       
  3184         
       
  3185                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  3186                 s4o.print("(");
       
  3187                 return_type_symbol->accept(*this);
       
  3188                 s4o.print(")");
       
  3189                 IN_param_value->accept(*this);
       
  3190                 return NULL;
       
  3191                 
       
  3192             }
       
  3193             
       
  3194             ERROR;
       
  3195         }
       
  3196         
       
  3197     }/*function_dint_to_udint*/
       
  3198     break;
       
  3199 
       
  3200 /****
       
  3201  *DINT_TO_ULINT
       
  3202  */
       
  3203     case function_dint_to_ulint :
       
  3204     {
       
  3205         symbol_c *last_type_symbol = NULL;
       
  3206 
       
  3207         {
       
  3208             identifier_c param_name("IN");
       
  3209             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3210             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3211             
       
  3212             /* Get the value from a foo(<param_value>) style call */
       
  3213             if (IN_param_value == NULL)
       
  3214               IN_param_value = function_call_param_iterator.next();
       
  3215             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3216             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3217             
       
  3218             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3219             {
       
  3220         
       
  3221                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  3222                 s4o.print("(");
       
  3223                 return_type_symbol->accept(*this);
       
  3224                 s4o.print(")");
       
  3225                 IN_param_value->accept(*this);
       
  3226                 return NULL;
       
  3227                 
       
  3228             }
       
  3229             
       
  3230             ERROR;
       
  3231         }
       
  3232         
       
  3233     }/*function_dint_to_ulint*/
       
  3234     break;
       
  3235 
       
  3236 /****
       
  3237  *DINT_TO_TIME
       
  3238  */
       
  3239     case function_dint_to_time :
       
  3240     {
       
  3241         symbol_c *last_type_symbol = NULL;
       
  3242 
       
  3243         {
       
  3244             identifier_c param_name("IN");
       
  3245             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3246             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3247             
       
  3248             /* Get the value from a foo(<param_value>) style call */
       
  3249             if (IN_param_value == NULL)
       
  3250               IN_param_value = function_call_param_iterator.next();
       
  3251             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3252             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3253             
       
  3254             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3255             {
       
  3256         
       
  3257                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  3258                 s4o.print("(");
       
  3259                 return_type_symbol->accept(*this);
       
  3260                 s4o.print(")real_to_time(");
       
  3261                 IN_param_value->accept(*this);
       
  3262                 s4o.print(")");
       
  3263                 return NULL;
       
  3264                 
       
  3265             }
       
  3266             
       
  3267             ERROR;
       
  3268         }
       
  3269         
       
  3270     }/*function_dint_to_time*/
       
  3271     break;
       
  3272 
       
  3273 /****
       
  3274  *DINT_TO_BOOL
       
  3275  */
       
  3276     case function_dint_to_bool :
       
  3277     {
       
  3278         symbol_c *last_type_symbol = NULL;
       
  3279 
       
  3280         {
       
  3281             identifier_c param_name("IN");
       
  3282             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3283             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3284             
       
  3285             /* Get the value from a foo(<param_value>) style call */
       
  3286             if (IN_param_value == NULL)
       
  3287               IN_param_value = function_call_param_iterator.next();
       
  3288             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3289             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3290             
       
  3291             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3292             {
       
  3293         
       
  3294                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  3295                 s4o.print("(");
       
  3296                 return_type_symbol->accept(*this);
       
  3297                 s4o.print(")");
       
  3298                 IN_param_value->accept(*this);
       
  3299                 return NULL;
       
  3300                 
       
  3301             }
       
  3302             
       
  3303             ERROR;
       
  3304         }
       
  3305         
       
  3306     }/*function_dint_to_bool*/
       
  3307     break;
       
  3308 
       
  3309 /****
       
  3310  *DINT_TO_BYTE
       
  3311  */
       
  3312     case function_dint_to_byte :
       
  3313     {
       
  3314         symbol_c *last_type_symbol = NULL;
       
  3315 
       
  3316         {
       
  3317             identifier_c param_name("IN");
       
  3318             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3319             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3320             
       
  3321             /* Get the value from a foo(<param_value>) style call */
       
  3322             if (IN_param_value == NULL)
       
  3323               IN_param_value = function_call_param_iterator.next();
       
  3324             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3325             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3326             
       
  3327             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3328             {
       
  3329         
       
  3330                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  3331                 s4o.print("(");
       
  3332                 return_type_symbol->accept(*this);
       
  3333                 s4o.print(")");
       
  3334                 IN_param_value->accept(*this);
       
  3335                 return NULL;
       
  3336                 
       
  3337             }
       
  3338             
       
  3339             ERROR;
       
  3340         }
       
  3341         
       
  3342     }/*function_dint_to_byte*/
       
  3343     break;
       
  3344 
       
  3345 /****
       
  3346  *DINT_TO_WORD
       
  3347  */
       
  3348     case function_dint_to_word :
       
  3349     {
       
  3350         symbol_c *last_type_symbol = NULL;
       
  3351 
       
  3352         {
       
  3353             identifier_c param_name("IN");
       
  3354             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3355             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3356             
       
  3357             /* Get the value from a foo(<param_value>) style call */
       
  3358             if (IN_param_value == NULL)
       
  3359               IN_param_value = function_call_param_iterator.next();
       
  3360             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3361             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3362             
       
  3363             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3364             {
       
  3365         
       
  3366                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  3367                 s4o.print("(");
       
  3368                 return_type_symbol->accept(*this);
       
  3369                 s4o.print(")");
       
  3370                 IN_param_value->accept(*this);
       
  3371                 return NULL;
       
  3372                 
       
  3373             }
       
  3374             
       
  3375             ERROR;
       
  3376         }
       
  3377         
       
  3378     }/*function_dint_to_word*/
       
  3379     break;
       
  3380 
       
  3381 /****
       
  3382  *DINT_TO_DWORD
       
  3383  */
       
  3384     case function_dint_to_dword :
       
  3385     {
       
  3386         symbol_c *last_type_symbol = NULL;
       
  3387 
       
  3388         {
       
  3389             identifier_c param_name("IN");
       
  3390             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3391             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3392             
       
  3393             /* Get the value from a foo(<param_value>) style call */
       
  3394             if (IN_param_value == NULL)
       
  3395               IN_param_value = function_call_param_iterator.next();
       
  3396             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3397             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3398             
       
  3399             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3400             {
       
  3401         
       
  3402                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  3403                 s4o.print("(");
       
  3404                 return_type_symbol->accept(*this);
       
  3405                 s4o.print(")");
       
  3406                 IN_param_value->accept(*this);
       
  3407                 return NULL;
       
  3408                 
       
  3409             }
       
  3410             
       
  3411             ERROR;
       
  3412         }
       
  3413         
       
  3414     }/*function_dint_to_dword*/
       
  3415     break;
       
  3416 
       
  3417 /****
       
  3418  *DINT_TO_LWORD
       
  3419  */
       
  3420     case function_dint_to_lword :
       
  3421     {
       
  3422         symbol_c *last_type_symbol = NULL;
       
  3423 
       
  3424         {
       
  3425             identifier_c param_name("IN");
       
  3426             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3427             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3428             
       
  3429             /* Get the value from a foo(<param_value>) style call */
       
  3430             if (IN_param_value == NULL)
       
  3431               IN_param_value = function_call_param_iterator.next();
       
  3432             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3433             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3434             
       
  3435             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3436             {
       
  3437         
       
  3438                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  3439                 s4o.print("(");
       
  3440                 return_type_symbol->accept(*this);
       
  3441                 s4o.print(")");
       
  3442                 IN_param_value->accept(*this);
       
  3443                 return NULL;
       
  3444                 
       
  3445             }
       
  3446             
       
  3447             ERROR;
       
  3448         }
       
  3449         
       
  3450     }/*function_dint_to_lword*/
       
  3451     break;
       
  3452 
       
  3453 /****
       
  3454  *DINT_TO_STRING
       
  3455  */
       
  3456     case function_dint_to_string :
       
  3457     {
       
  3458         symbol_c *last_type_symbol = NULL;
       
  3459 
       
  3460         {
       
  3461             identifier_c param_name("IN");
       
  3462             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3463             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3464             
       
  3465             /* Get the value from a foo(<param_value>) style call */
       
  3466             if (IN_param_value == NULL)
       
  3467               IN_param_value = function_call_param_iterator.next();
       
  3468             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3469             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3470             
       
  3471             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3472             {
       
  3473         
       
  3474                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  3475                 s4o.print("(");
       
  3476                 return_type_symbol->accept(*this);
       
  3477                 s4o.print(")int_to_string(");
       
  3478                 IN_param_value->accept(*this);
       
  3479                 s4o.print(", 10)");
       
  3480                 return NULL;
       
  3481                 
       
  3482             }
       
  3483             
       
  3484             ERROR;
       
  3485         }
       
  3486         
       
  3487     }/*function_dint_to_string*/
       
  3488     break;
       
  3489 
       
  3490 /****
       
  3491  *DINT_TO_WSTRING
       
  3492  */
       
  3493     case function_dint_to_wstring :
       
  3494     {
       
  3495         symbol_c *last_type_symbol = NULL;
       
  3496 
       
  3497         {
       
  3498             identifier_c param_name("IN");
       
  3499             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3500             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3501             
       
  3502             /* Get the value from a foo(<param_value>) style call */
       
  3503             if (IN_param_value == NULL)
       
  3504               IN_param_value = function_call_param_iterator.next();
       
  3505             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3506             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3507             
       
  3508             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3509             {
       
  3510         
       
  3511                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
  3512                 s4o.print("(");
       
  3513                 return_type_symbol->accept(*this);
       
  3514                 s4o.print(")int_to_string(");
       
  3515                 IN_param_value->accept(*this);
       
  3516                 s4o.print(", 10)");
       
  3517                 return NULL;
       
  3518                 
       
  3519             }
       
  3520             
       
  3521             ERROR;
       
  3522         }
       
  3523         
       
  3524     }/*function_dint_to_wstring*/
       
  3525     break;
       
  3526 
       
  3527 /****
       
  3528  *DINT_TO_DATE
       
  3529  */
       
  3530     case function_dint_to_date :
       
  3531     {
       
  3532         symbol_c *last_type_symbol = NULL;
       
  3533 
       
  3534         {
       
  3535             identifier_c param_name("IN");
       
  3536             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3537             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3538             
       
  3539             /* Get the value from a foo(<param_value>) style call */
       
  3540             if (IN_param_value == NULL)
       
  3541               IN_param_value = function_call_param_iterator.next();
       
  3542             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3543             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3544             
       
  3545             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3546             {
       
  3547         
       
  3548                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  3549                 s4o.print("(");
       
  3550                 return_type_symbol->accept(*this);
       
  3551                 s4o.print(")real_to_time(");
       
  3552                 IN_param_value->accept(*this);
       
  3553                 s4o.print(")");
       
  3554                 return NULL;
       
  3555                 
       
  3556             }
       
  3557             
       
  3558             ERROR;
       
  3559         }
       
  3560         
       
  3561     }/*function_dint_to_date*/
       
  3562     break;
       
  3563 
       
  3564 /****
       
  3565  *DINT_TO_TOD
       
  3566  */
       
  3567     case function_dint_to_tod :
       
  3568     {
       
  3569         symbol_c *last_type_symbol = NULL;
       
  3570 
       
  3571         {
       
  3572             identifier_c param_name("IN");
       
  3573             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3574             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3575             
       
  3576             /* Get the value from a foo(<param_value>) style call */
       
  3577             if (IN_param_value == NULL)
       
  3578               IN_param_value = function_call_param_iterator.next();
       
  3579             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3580             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3581             
       
  3582             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3583             {
       
  3584         
       
  3585                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  3586                 s4o.print("(");
       
  3587                 return_type_symbol->accept(*this);
       
  3588                 s4o.print(")real_to_time(");
       
  3589                 IN_param_value->accept(*this);
       
  3590                 s4o.print(")");
       
  3591                 return NULL;
       
  3592                 
       
  3593             }
       
  3594             
       
  3595             ERROR;
       
  3596         }
       
  3597         
       
  3598     }/*function_dint_to_tod*/
       
  3599     break;
       
  3600 
       
  3601 /****
       
  3602  *DINT_TO_DT
       
  3603  */
       
  3604     case function_dint_to_dt :
       
  3605     {
       
  3606         symbol_c *last_type_symbol = NULL;
       
  3607 
       
  3608         {
       
  3609             identifier_c param_name("IN");
       
  3610             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3611             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3612             
       
  3613             /* Get the value from a foo(<param_value>) style call */
       
  3614             if (IN_param_value == NULL)
       
  3615               IN_param_value = function_call_param_iterator.next();
       
  3616             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3617             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3618             
       
  3619             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
       
  3620             {
       
  3621         
       
  3622                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  3623                 s4o.print("(");
       
  3624                 return_type_symbol->accept(*this);
       
  3625                 s4o.print(")real_to_time(");
       
  3626                 IN_param_value->accept(*this);
       
  3627                 s4o.print(")");
       
  3628                 return NULL;
       
  3629                 
       
  3630             }
       
  3631             
       
  3632             ERROR;
       
  3633         }
       
  3634         
       
  3635     }/*function_dint_to_dt*/
       
  3636     break;
       
  3637 
       
  3638 /****
       
  3639  *LINT_TO_REAL
       
  3640  */
       
  3641     case function_lint_to_real :
       
  3642     {
       
  3643         symbol_c *last_type_symbol = NULL;
       
  3644 
       
  3645         {
       
  3646             identifier_c param_name("IN");
       
  3647             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3648             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3649             
       
  3650             /* Get the value from a foo(<param_value>) style call */
       
  3651             if (IN_param_value == NULL)
       
  3652               IN_param_value = function_call_param_iterator.next();
       
  3653             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3654             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3655             
       
  3656             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3657             {
       
  3658         
       
  3659                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  3660                 s4o.print("(");
       
  3661                 return_type_symbol->accept(*this);
       
  3662                 s4o.print(")");
       
  3663                 IN_param_value->accept(*this);
       
  3664                 return NULL;
       
  3665                 
       
  3666             }
       
  3667             
       
  3668             ERROR;
       
  3669         }
       
  3670         
       
  3671     }/*function_lint_to_real*/
       
  3672     break;
       
  3673 
       
  3674 /****
       
  3675  *LINT_TO_LREAL
       
  3676  */
       
  3677     case function_lint_to_lreal :
       
  3678     {
       
  3679         symbol_c *last_type_symbol = NULL;
       
  3680 
       
  3681         {
       
  3682             identifier_c param_name("IN");
       
  3683             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3684             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3685             
       
  3686             /* Get the value from a foo(<param_value>) style call */
       
  3687             if (IN_param_value == NULL)
       
  3688               IN_param_value = function_call_param_iterator.next();
       
  3689             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3690             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3691             
       
  3692             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3693             {
       
  3694         
       
  3695                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  3696                 s4o.print("(");
       
  3697                 return_type_symbol->accept(*this);
       
  3698                 s4o.print(")");
       
  3699                 IN_param_value->accept(*this);
       
  3700                 return NULL;
       
  3701                 
       
  3702             }
       
  3703             
       
  3704             ERROR;
       
  3705         }
       
  3706         
       
  3707     }/*function_lint_to_lreal*/
       
  3708     break;
       
  3709 
       
  3710 /****
       
  3711  *LINT_TO_SINT
       
  3712  */
       
  3713     case function_lint_to_sint :
       
  3714     {
       
  3715         symbol_c *last_type_symbol = NULL;
       
  3716 
       
  3717         {
       
  3718             identifier_c param_name("IN");
       
  3719             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3720             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3721             
       
  3722             /* Get the value from a foo(<param_value>) style call */
       
  3723             if (IN_param_value == NULL)
       
  3724               IN_param_value = function_call_param_iterator.next();
       
  3725             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3726             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3727             
       
  3728             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3729             {
       
  3730         
       
  3731                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  3732                 s4o.print("(");
       
  3733                 return_type_symbol->accept(*this);
       
  3734                 s4o.print(")");
       
  3735                 IN_param_value->accept(*this);
       
  3736                 return NULL;
       
  3737                 
       
  3738             }
       
  3739             
       
  3740             ERROR;
       
  3741         }
       
  3742         
       
  3743     }/*function_lint_to_sint*/
       
  3744     break;
       
  3745 
       
  3746 /****
       
  3747  *LINT_TO_INT
       
  3748  */
       
  3749     case function_lint_to_int :
       
  3750     {
       
  3751         symbol_c *last_type_symbol = NULL;
       
  3752 
       
  3753         {
       
  3754             identifier_c param_name("IN");
       
  3755             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3756             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3757             
       
  3758             /* Get the value from a foo(<param_value>) style call */
       
  3759             if (IN_param_value == NULL)
       
  3760               IN_param_value = function_call_param_iterator.next();
       
  3761             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3762             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3763             
       
  3764             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3765             {
       
  3766         
       
  3767                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  3768                 s4o.print("(");
       
  3769                 return_type_symbol->accept(*this);
       
  3770                 s4o.print(")");
       
  3771                 IN_param_value->accept(*this);
       
  3772                 return NULL;
       
  3773                 
       
  3774             }
       
  3775             
       
  3776             ERROR;
       
  3777         }
       
  3778         
       
  3779     }/*function_lint_to_int*/
       
  3780     break;
       
  3781 
       
  3782 /****
       
  3783  *LINT_TO_DINT
       
  3784  */
       
  3785     case function_lint_to_dint :
       
  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 (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3801             {
       
  3802         
       
  3803                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  3804                 s4o.print("(");
       
  3805                 return_type_symbol->accept(*this);
       
  3806                 s4o.print(")");
       
  3807                 IN_param_value->accept(*this);
       
  3808                 return NULL;
       
  3809                 
       
  3810             }
       
  3811             
       
  3812             ERROR;
       
  3813         }
       
  3814         
       
  3815     }/*function_lint_to_dint*/
       
  3816     break;
       
  3817 
       
  3818 /****
       
  3819  *LINT_TO_USINT
       
  3820  */
       
  3821     case function_lint_to_usint :
       
  3822     {
       
  3823         symbol_c *last_type_symbol = NULL;
       
  3824 
       
  3825         {
       
  3826             identifier_c param_name("IN");
       
  3827             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3828             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3829             
       
  3830             /* Get the value from a foo(<param_value>) style call */
       
  3831             if (IN_param_value == NULL)
       
  3832               IN_param_value = function_call_param_iterator.next();
       
  3833             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3834             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3835             
       
  3836             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3837             {
       
  3838         
       
  3839                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  3840                 s4o.print("(");
       
  3841                 return_type_symbol->accept(*this);
       
  3842                 s4o.print(")");
       
  3843                 IN_param_value->accept(*this);
       
  3844                 return NULL;
       
  3845                 
       
  3846             }
       
  3847             
       
  3848             ERROR;
       
  3849         }
       
  3850         
       
  3851     }/*function_lint_to_usint*/
       
  3852     break;
       
  3853 
       
  3854 /****
       
  3855  *LINT_TO_UINT
       
  3856  */
       
  3857     case function_lint_to_uint :
       
  3858     {
       
  3859         symbol_c *last_type_symbol = NULL;
       
  3860 
       
  3861         {
       
  3862             identifier_c param_name("IN");
       
  3863             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3864             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3865             
       
  3866             /* Get the value from a foo(<param_value>) style call */
       
  3867             if (IN_param_value == NULL)
       
  3868               IN_param_value = function_call_param_iterator.next();
       
  3869             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3870             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3871             
       
  3872             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3873             {
       
  3874         
       
  3875                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  3876                 s4o.print("(");
       
  3877                 return_type_symbol->accept(*this);
       
  3878                 s4o.print(")");
       
  3879                 IN_param_value->accept(*this);
       
  3880                 return NULL;
       
  3881                 
       
  3882             }
       
  3883             
       
  3884             ERROR;
       
  3885         }
       
  3886         
       
  3887     }/*function_lint_to_uint*/
       
  3888     break;
       
  3889 
       
  3890 /****
       
  3891  *LINT_TO_UDINT
       
  3892  */
       
  3893     case function_lint_to_udint :
       
  3894     {
       
  3895         symbol_c *last_type_symbol = NULL;
       
  3896 
       
  3897         {
       
  3898             identifier_c param_name("IN");
       
  3899             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3900             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3901             
       
  3902             /* Get the value from a foo(<param_value>) style call */
       
  3903             if (IN_param_value == NULL)
       
  3904               IN_param_value = function_call_param_iterator.next();
       
  3905             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3906             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3907             
       
  3908             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3909             {
       
  3910         
       
  3911                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  3912                 s4o.print("(");
       
  3913                 return_type_symbol->accept(*this);
       
  3914                 s4o.print(")");
       
  3915                 IN_param_value->accept(*this);
       
  3916                 return NULL;
       
  3917                 
       
  3918             }
       
  3919             
       
  3920             ERROR;
       
  3921         }
       
  3922         
       
  3923     }/*function_lint_to_udint*/
       
  3924     break;
       
  3925 
       
  3926 /****
       
  3927  *LINT_TO_ULINT
       
  3928  */
       
  3929     case function_lint_to_ulint :
       
  3930     {
       
  3931         symbol_c *last_type_symbol = NULL;
       
  3932 
       
  3933         {
       
  3934             identifier_c param_name("IN");
       
  3935             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3936             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3937             
       
  3938             /* Get the value from a foo(<param_value>) style call */
       
  3939             if (IN_param_value == NULL)
       
  3940               IN_param_value = function_call_param_iterator.next();
       
  3941             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3942             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3943             
       
  3944             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3945             {
       
  3946         
       
  3947                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  3948                 s4o.print("(");
       
  3949                 return_type_symbol->accept(*this);
       
  3950                 s4o.print(")");
       
  3951                 IN_param_value->accept(*this);
       
  3952                 return NULL;
       
  3953                 
       
  3954             }
       
  3955             
       
  3956             ERROR;
       
  3957         }
       
  3958         
       
  3959     }/*function_lint_to_ulint*/
       
  3960     break;
       
  3961 
       
  3962 /****
       
  3963  *LINT_TO_TIME
       
  3964  */
       
  3965     case function_lint_to_time :
       
  3966     {
       
  3967         symbol_c *last_type_symbol = NULL;
       
  3968 
       
  3969         {
       
  3970             identifier_c param_name("IN");
       
  3971             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  3972             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  3973             
       
  3974             /* Get the value from a foo(<param_value>) style call */
       
  3975             if (IN_param_value == NULL)
       
  3976               IN_param_value = function_call_param_iterator.next();
       
  3977             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  3978             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  3979             
       
  3980             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  3981             {
       
  3982         
       
  3983                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  3984                 s4o.print("(");
       
  3985                 return_type_symbol->accept(*this);
       
  3986                 s4o.print(")real_to_time(");
       
  3987                 IN_param_value->accept(*this);
       
  3988                 s4o.print(")");
       
  3989                 return NULL;
       
  3990                 
       
  3991             }
       
  3992             
       
  3993             ERROR;
       
  3994         }
       
  3995         
       
  3996     }/*function_lint_to_time*/
       
  3997     break;
       
  3998 
       
  3999 /****
       
  4000  *LINT_TO_BOOL
       
  4001  */
       
  4002     case function_lint_to_bool :
       
  4003     {
       
  4004         symbol_c *last_type_symbol = NULL;
       
  4005 
       
  4006         {
       
  4007             identifier_c param_name("IN");
       
  4008             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4009             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4010             
       
  4011             /* Get the value from a foo(<param_value>) style call */
       
  4012             if (IN_param_value == NULL)
       
  4013               IN_param_value = function_call_param_iterator.next();
       
  4014             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4015             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4016             
       
  4017             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  4018             {
       
  4019         
       
  4020                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  4021                 s4o.print("(");
       
  4022                 return_type_symbol->accept(*this);
       
  4023                 s4o.print(")");
       
  4024                 IN_param_value->accept(*this);
       
  4025                 return NULL;
       
  4026                 
       
  4027             }
       
  4028             
       
  4029             ERROR;
       
  4030         }
       
  4031         
       
  4032     }/*function_lint_to_bool*/
       
  4033     break;
       
  4034 
       
  4035 /****
       
  4036  *LINT_TO_BYTE
       
  4037  */
       
  4038     case function_lint_to_byte :
       
  4039     {
       
  4040         symbol_c *last_type_symbol = NULL;
       
  4041 
       
  4042         {
       
  4043             identifier_c param_name("IN");
       
  4044             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4045             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4046             
       
  4047             /* Get the value from a foo(<param_value>) style call */
       
  4048             if (IN_param_value == NULL)
       
  4049               IN_param_value = function_call_param_iterator.next();
       
  4050             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4051             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4052             
       
  4053             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  4054             {
       
  4055         
       
  4056                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  4057                 s4o.print("(");
       
  4058                 return_type_symbol->accept(*this);
       
  4059                 s4o.print(")");
       
  4060                 IN_param_value->accept(*this);
       
  4061                 return NULL;
       
  4062                 
       
  4063             }
       
  4064             
       
  4065             ERROR;
       
  4066         }
       
  4067         
       
  4068     }/*function_lint_to_byte*/
       
  4069     break;
       
  4070 
       
  4071 /****
       
  4072  *LINT_TO_WORD
       
  4073  */
       
  4074     case function_lint_to_word :
       
  4075     {
       
  4076         symbol_c *last_type_symbol = NULL;
       
  4077 
       
  4078         {
       
  4079             identifier_c param_name("IN");
       
  4080             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4081             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4082             
       
  4083             /* Get the value from a foo(<param_value>) style call */
       
  4084             if (IN_param_value == NULL)
       
  4085               IN_param_value = function_call_param_iterator.next();
       
  4086             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4087             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4088             
       
  4089             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  4090             {
       
  4091         
       
  4092                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  4093                 s4o.print("(");
       
  4094                 return_type_symbol->accept(*this);
       
  4095                 s4o.print(")");
       
  4096                 IN_param_value->accept(*this);
       
  4097                 return NULL;
       
  4098                 
       
  4099             }
       
  4100             
       
  4101             ERROR;
       
  4102         }
       
  4103         
       
  4104     }/*function_lint_to_word*/
       
  4105     break;
       
  4106 
       
  4107 /****
       
  4108  *LINT_TO_DWORD
       
  4109  */
       
  4110     case function_lint_to_dword :
       
  4111     {
       
  4112         symbol_c *last_type_symbol = NULL;
       
  4113 
       
  4114         {
       
  4115             identifier_c param_name("IN");
       
  4116             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4117             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4118             
       
  4119             /* Get the value from a foo(<param_value>) style call */
       
  4120             if (IN_param_value == NULL)
       
  4121               IN_param_value = function_call_param_iterator.next();
       
  4122             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4123             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4124             
       
  4125             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  4126             {
       
  4127         
       
  4128                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  4129                 s4o.print("(");
       
  4130                 return_type_symbol->accept(*this);
       
  4131                 s4o.print(")");
       
  4132                 IN_param_value->accept(*this);
       
  4133                 return NULL;
       
  4134                 
       
  4135             }
       
  4136             
       
  4137             ERROR;
       
  4138         }
       
  4139         
       
  4140     }/*function_lint_to_dword*/
       
  4141     break;
       
  4142 
       
  4143 /****
       
  4144  *LINT_TO_LWORD
       
  4145  */
       
  4146     case function_lint_to_lword :
       
  4147     {
       
  4148         symbol_c *last_type_symbol = NULL;
       
  4149 
       
  4150         {
       
  4151             identifier_c param_name("IN");
       
  4152             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4153             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4154             
       
  4155             /* Get the value from a foo(<param_value>) style call */
       
  4156             if (IN_param_value == NULL)
       
  4157               IN_param_value = function_call_param_iterator.next();
       
  4158             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4159             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4160             
       
  4161             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  4162             {
       
  4163         
       
  4164                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  4165                 s4o.print("(");
       
  4166                 return_type_symbol->accept(*this);
       
  4167                 s4o.print(")");
       
  4168                 IN_param_value->accept(*this);
       
  4169                 return NULL;
       
  4170                 
       
  4171             }
       
  4172             
       
  4173             ERROR;
       
  4174         }
       
  4175         
       
  4176     }/*function_lint_to_lword*/
       
  4177     break;
       
  4178 
       
  4179 /****
       
  4180  *LINT_TO_STRING
       
  4181  */
       
  4182     case function_lint_to_string :
       
  4183     {
       
  4184         symbol_c *last_type_symbol = NULL;
       
  4185 
       
  4186         {
       
  4187             identifier_c param_name("IN");
       
  4188             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4189             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4190             
       
  4191             /* Get the value from a foo(<param_value>) style call */
       
  4192             if (IN_param_value == NULL)
       
  4193               IN_param_value = function_call_param_iterator.next();
       
  4194             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4195             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4196             
       
  4197             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  4198             {
       
  4199         
       
  4200                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  4201                 s4o.print("(");
       
  4202                 return_type_symbol->accept(*this);
       
  4203                 s4o.print(")int_to_string(");
       
  4204                 IN_param_value->accept(*this);
       
  4205                 s4o.print(", 10)");
       
  4206                 return NULL;
       
  4207                 
       
  4208             }
       
  4209             
       
  4210             ERROR;
       
  4211         }
       
  4212         
       
  4213     }/*function_lint_to_string*/
       
  4214     break;
       
  4215 
       
  4216 /****
       
  4217  *LINT_TO_WSTRING
       
  4218  */
       
  4219     case function_lint_to_wstring :
       
  4220     {
       
  4221         symbol_c *last_type_symbol = NULL;
       
  4222 
       
  4223         {
       
  4224             identifier_c param_name("IN");
       
  4225             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4226             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4227             
       
  4228             /* Get the value from a foo(<param_value>) style call */
       
  4229             if (IN_param_value == NULL)
       
  4230               IN_param_value = function_call_param_iterator.next();
       
  4231             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4232             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4233             
       
  4234             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  4235             {
       
  4236         
       
  4237                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
  4238                 s4o.print("(");
       
  4239                 return_type_symbol->accept(*this);
       
  4240                 s4o.print(")int_to_string(");
       
  4241                 IN_param_value->accept(*this);
       
  4242                 s4o.print(", 10)");
       
  4243                 return NULL;
       
  4244                 
       
  4245             }
       
  4246             
       
  4247             ERROR;
       
  4248         }
       
  4249         
       
  4250     }/*function_lint_to_wstring*/
       
  4251     break;
       
  4252 
       
  4253 /****
       
  4254  *LINT_TO_DATE
       
  4255  */
       
  4256     case function_lint_to_date :
       
  4257     {
       
  4258         symbol_c *last_type_symbol = NULL;
       
  4259 
       
  4260         {
       
  4261             identifier_c param_name("IN");
       
  4262             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4263             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4264             
       
  4265             /* Get the value from a foo(<param_value>) style call */
       
  4266             if (IN_param_value == NULL)
       
  4267               IN_param_value = function_call_param_iterator.next();
       
  4268             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4269             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4270             
       
  4271             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  4272             {
       
  4273         
       
  4274                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  4275                 s4o.print("(");
       
  4276                 return_type_symbol->accept(*this);
       
  4277                 s4o.print(")real_to_time(");
       
  4278                 IN_param_value->accept(*this);
       
  4279                 s4o.print(")");
       
  4280                 return NULL;
       
  4281                 
       
  4282             }
       
  4283             
       
  4284             ERROR;
       
  4285         }
       
  4286         
       
  4287     }/*function_lint_to_date*/
       
  4288     break;
       
  4289 
       
  4290 /****
       
  4291  *LINT_TO_TOD
       
  4292  */
       
  4293     case function_lint_to_tod :
       
  4294     {
       
  4295         symbol_c *last_type_symbol = NULL;
       
  4296 
       
  4297         {
       
  4298             identifier_c param_name("IN");
       
  4299             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4300             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4301             
       
  4302             /* Get the value from a foo(<param_value>) style call */
       
  4303             if (IN_param_value == NULL)
       
  4304               IN_param_value = function_call_param_iterator.next();
       
  4305             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4306             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4307             
       
  4308             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  4309             {
       
  4310         
       
  4311                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  4312                 s4o.print("(");
       
  4313                 return_type_symbol->accept(*this);
       
  4314                 s4o.print(")real_to_time(");
       
  4315                 IN_param_value->accept(*this);
       
  4316                 s4o.print(")");
       
  4317                 return NULL;
       
  4318                 
       
  4319             }
       
  4320             
       
  4321             ERROR;
       
  4322         }
       
  4323         
       
  4324     }/*function_lint_to_tod*/
       
  4325     break;
       
  4326 
       
  4327 /****
       
  4328  *LINT_TO_DT
       
  4329  */
       
  4330     case function_lint_to_dt :
       
  4331     {
       
  4332         symbol_c *last_type_symbol = NULL;
       
  4333 
       
  4334         {
       
  4335             identifier_c param_name("IN");
       
  4336             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4337             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4338             
       
  4339             /* Get the value from a foo(<param_value>) style call */
       
  4340             if (IN_param_value == NULL)
       
  4341               IN_param_value = function_call_param_iterator.next();
       
  4342             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4343             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4344             
       
  4345             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
       
  4346             {
       
  4347         
       
  4348                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  4349                 s4o.print("(");
       
  4350                 return_type_symbol->accept(*this);
       
  4351                 s4o.print(")real_to_time(");
       
  4352                 IN_param_value->accept(*this);
       
  4353                 s4o.print(")");
       
  4354                 return NULL;
       
  4355                 
       
  4356             }
       
  4357             
       
  4358             ERROR;
       
  4359         }
       
  4360         
       
  4361     }/*function_lint_to_dt*/
       
  4362     break;
       
  4363 
       
  4364 /****
       
  4365  *USINT_TO_REAL
       
  4366  */
       
  4367     case function_usint_to_real :
       
  4368     {
       
  4369         symbol_c *last_type_symbol = NULL;
       
  4370 
       
  4371         {
       
  4372             identifier_c param_name("IN");
       
  4373             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4374             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4375             
       
  4376             /* Get the value from a foo(<param_value>) style call */
       
  4377             if (IN_param_value == NULL)
       
  4378               IN_param_value = function_call_param_iterator.next();
       
  4379             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4380             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4381             
       
  4382             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4383             {
       
  4384         
       
  4385                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  4386                 s4o.print("(");
       
  4387                 return_type_symbol->accept(*this);
       
  4388                 s4o.print(")");
       
  4389                 IN_param_value->accept(*this);
       
  4390                 return NULL;
       
  4391                 
       
  4392             }
       
  4393             
       
  4394             ERROR;
       
  4395         }
       
  4396         
       
  4397     }/*function_usint_to_real*/
       
  4398     break;
       
  4399 
       
  4400 /****
       
  4401  *USINT_TO_LREAL
       
  4402  */
       
  4403     case function_usint_to_lreal :
       
  4404     {
       
  4405         symbol_c *last_type_symbol = NULL;
       
  4406 
       
  4407         {
       
  4408             identifier_c param_name("IN");
       
  4409             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4410             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4411             
       
  4412             /* Get the value from a foo(<param_value>) style call */
       
  4413             if (IN_param_value == NULL)
       
  4414               IN_param_value = function_call_param_iterator.next();
       
  4415             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4416             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4417             
       
  4418             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4419             {
       
  4420         
       
  4421                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  4422                 s4o.print("(");
       
  4423                 return_type_symbol->accept(*this);
       
  4424                 s4o.print(")");
       
  4425                 IN_param_value->accept(*this);
       
  4426                 return NULL;
       
  4427                 
       
  4428             }
       
  4429             
       
  4430             ERROR;
       
  4431         }
       
  4432         
       
  4433     }/*function_usint_to_lreal*/
       
  4434     break;
       
  4435 
       
  4436 /****
       
  4437  *USINT_TO_SINT
       
  4438  */
       
  4439     case function_usint_to_sint :
       
  4440     {
       
  4441         symbol_c *last_type_symbol = NULL;
       
  4442 
       
  4443         {
       
  4444             identifier_c param_name("IN");
       
  4445             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4446             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4447             
       
  4448             /* Get the value from a foo(<param_value>) style call */
       
  4449             if (IN_param_value == NULL)
       
  4450               IN_param_value = function_call_param_iterator.next();
       
  4451             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4452             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4453             
       
  4454             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4455             {
       
  4456         
       
  4457                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  4458                 s4o.print("(");
       
  4459                 return_type_symbol->accept(*this);
       
  4460                 s4o.print(")");
       
  4461                 IN_param_value->accept(*this);
       
  4462                 return NULL;
       
  4463                 
       
  4464             }
       
  4465             
       
  4466             ERROR;
       
  4467         }
       
  4468         
       
  4469     }/*function_usint_to_sint*/
       
  4470     break;
       
  4471 
       
  4472 /****
       
  4473  *USINT_TO_INT
       
  4474  */
       
  4475     case function_usint_to_int :
       
  4476     {
       
  4477         symbol_c *last_type_symbol = NULL;
       
  4478 
       
  4479         {
       
  4480             identifier_c param_name("IN");
       
  4481             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4482             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4483             
       
  4484             /* Get the value from a foo(<param_value>) style call */
       
  4485             if (IN_param_value == NULL)
       
  4486               IN_param_value = function_call_param_iterator.next();
       
  4487             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4488             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4489             
       
  4490             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4491             {
       
  4492         
       
  4493                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  4494                 s4o.print("(");
       
  4495                 return_type_symbol->accept(*this);
       
  4496                 s4o.print(")");
       
  4497                 IN_param_value->accept(*this);
       
  4498                 return NULL;
       
  4499                 
       
  4500             }
       
  4501             
       
  4502             ERROR;
       
  4503         }
       
  4504         
       
  4505     }/*function_usint_to_int*/
       
  4506     break;
       
  4507 
       
  4508 /****
       
  4509  *USINT_TO_DINT
       
  4510  */
       
  4511     case function_usint_to_dint :
       
  4512     {
       
  4513         symbol_c *last_type_symbol = NULL;
       
  4514 
       
  4515         {
       
  4516             identifier_c param_name("IN");
       
  4517             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4518             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4519             
       
  4520             /* Get the value from a foo(<param_value>) style call */
       
  4521             if (IN_param_value == NULL)
       
  4522               IN_param_value = function_call_param_iterator.next();
       
  4523             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4524             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4525             
       
  4526             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4527             {
       
  4528         
       
  4529                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  4530                 s4o.print("(");
       
  4531                 return_type_symbol->accept(*this);
       
  4532                 s4o.print(")");
       
  4533                 IN_param_value->accept(*this);
       
  4534                 return NULL;
       
  4535                 
       
  4536             }
       
  4537             
       
  4538             ERROR;
       
  4539         }
       
  4540         
       
  4541     }/*function_usint_to_dint*/
       
  4542     break;
       
  4543 
       
  4544 /****
       
  4545  *USINT_TO_LINT
       
  4546  */
       
  4547     case function_usint_to_lint :
       
  4548     {
       
  4549         symbol_c *last_type_symbol = NULL;
       
  4550 
       
  4551         {
       
  4552             identifier_c param_name("IN");
       
  4553             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4554             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4555             
       
  4556             /* Get the value from a foo(<param_value>) style call */
       
  4557             if (IN_param_value == NULL)
       
  4558               IN_param_value = function_call_param_iterator.next();
       
  4559             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4560             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4561             
       
  4562             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4563             {
       
  4564         
       
  4565                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  4566                 s4o.print("(");
       
  4567                 return_type_symbol->accept(*this);
       
  4568                 s4o.print(")");
       
  4569                 IN_param_value->accept(*this);
       
  4570                 return NULL;
       
  4571                 
       
  4572             }
       
  4573             
       
  4574             ERROR;
       
  4575         }
       
  4576         
       
  4577     }/*function_usint_to_lint*/
       
  4578     break;
       
  4579 
       
  4580 /****
       
  4581  *USINT_TO_UINT
       
  4582  */
       
  4583     case function_usint_to_uint :
       
  4584     {
       
  4585         symbol_c *last_type_symbol = NULL;
       
  4586 
       
  4587         {
       
  4588             identifier_c param_name("IN");
       
  4589             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4590             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4591             
       
  4592             /* Get the value from a foo(<param_value>) style call */
       
  4593             if (IN_param_value == NULL)
       
  4594               IN_param_value = function_call_param_iterator.next();
       
  4595             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4596             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4597             
       
  4598             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4599             {
       
  4600         
       
  4601                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  4602                 s4o.print("(");
       
  4603                 return_type_symbol->accept(*this);
       
  4604                 s4o.print(")");
       
  4605                 IN_param_value->accept(*this);
       
  4606                 return NULL;
       
  4607                 
       
  4608             }
       
  4609             
       
  4610             ERROR;
       
  4611         }
       
  4612         
       
  4613     }/*function_usint_to_uint*/
       
  4614     break;
       
  4615 
       
  4616 /****
       
  4617  *USINT_TO_UDINT
       
  4618  */
       
  4619     case function_usint_to_udint :
       
  4620     {
       
  4621         symbol_c *last_type_symbol = NULL;
       
  4622 
       
  4623         {
       
  4624             identifier_c param_name("IN");
       
  4625             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4626             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4627             
       
  4628             /* Get the value from a foo(<param_value>) style call */
       
  4629             if (IN_param_value == NULL)
       
  4630               IN_param_value = function_call_param_iterator.next();
       
  4631             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4632             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4633             
       
  4634             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4635             {
       
  4636         
       
  4637                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  4638                 s4o.print("(");
       
  4639                 return_type_symbol->accept(*this);
       
  4640                 s4o.print(")");
       
  4641                 IN_param_value->accept(*this);
       
  4642                 return NULL;
       
  4643                 
       
  4644             }
       
  4645             
       
  4646             ERROR;
       
  4647         }
       
  4648         
       
  4649     }/*function_usint_to_udint*/
       
  4650     break;
       
  4651 
       
  4652 /****
       
  4653  *USINT_TO_ULINT
       
  4654  */
       
  4655     case function_usint_to_ulint :
       
  4656     {
       
  4657         symbol_c *last_type_symbol = NULL;
       
  4658 
       
  4659         {
       
  4660             identifier_c param_name("IN");
       
  4661             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4662             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4663             
       
  4664             /* Get the value from a foo(<param_value>) style call */
       
  4665             if (IN_param_value == NULL)
       
  4666               IN_param_value = function_call_param_iterator.next();
       
  4667             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4668             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4669             
       
  4670             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4671             {
       
  4672         
       
  4673                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  4674                 s4o.print("(");
       
  4675                 return_type_symbol->accept(*this);
       
  4676                 s4o.print(")");
       
  4677                 IN_param_value->accept(*this);
       
  4678                 return NULL;
       
  4679                 
       
  4680             }
       
  4681             
       
  4682             ERROR;
       
  4683         }
       
  4684         
       
  4685     }/*function_usint_to_ulint*/
       
  4686     break;
       
  4687 
       
  4688 /****
       
  4689  *USINT_TO_TIME
       
  4690  */
       
  4691     case function_usint_to_time :
       
  4692     {
       
  4693         symbol_c *last_type_symbol = NULL;
       
  4694 
       
  4695         {
       
  4696             identifier_c param_name("IN");
       
  4697             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4698             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4699             
       
  4700             /* Get the value from a foo(<param_value>) style call */
       
  4701             if (IN_param_value == NULL)
       
  4702               IN_param_value = function_call_param_iterator.next();
       
  4703             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4704             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4705             
       
  4706             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4707             {
       
  4708         
       
  4709                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  4710                 s4o.print("(");
       
  4711                 return_type_symbol->accept(*this);
       
  4712                 s4o.print(")real_to_time(");
       
  4713                 IN_param_value->accept(*this);
       
  4714                 s4o.print(")");
       
  4715                 return NULL;
       
  4716                 
       
  4717             }
       
  4718             
       
  4719             ERROR;
       
  4720         }
       
  4721         
       
  4722     }/*function_usint_to_time*/
       
  4723     break;
       
  4724 
       
  4725 /****
       
  4726  *USINT_TO_BOOL
       
  4727  */
       
  4728     case function_usint_to_bool :
       
  4729     {
       
  4730         symbol_c *last_type_symbol = NULL;
       
  4731 
       
  4732         {
       
  4733             identifier_c param_name("IN");
       
  4734             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4735             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4736             
       
  4737             /* Get the value from a foo(<param_value>) style call */
       
  4738             if (IN_param_value == NULL)
       
  4739               IN_param_value = function_call_param_iterator.next();
       
  4740             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4741             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4742             
       
  4743             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4744             {
       
  4745         
       
  4746                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  4747                 s4o.print("(");
       
  4748                 return_type_symbol->accept(*this);
       
  4749                 s4o.print(")");
       
  4750                 IN_param_value->accept(*this);
       
  4751                 return NULL;
       
  4752                 
       
  4753             }
       
  4754             
       
  4755             ERROR;
       
  4756         }
       
  4757         
       
  4758     }/*function_usint_to_bool*/
       
  4759     break;
       
  4760 
       
  4761 /****
       
  4762  *USINT_TO_BYTE
       
  4763  */
       
  4764     case function_usint_to_byte :
       
  4765     {
       
  4766         symbol_c *last_type_symbol = NULL;
       
  4767 
       
  4768         {
       
  4769             identifier_c param_name("IN");
       
  4770             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4771             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4772             
       
  4773             /* Get the value from a foo(<param_value>) style call */
       
  4774             if (IN_param_value == NULL)
       
  4775               IN_param_value = function_call_param_iterator.next();
       
  4776             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4777             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4778             
       
  4779             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4780             {
       
  4781         
       
  4782                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  4783                 s4o.print("(");
       
  4784                 return_type_symbol->accept(*this);
       
  4785                 s4o.print(")");
       
  4786                 IN_param_value->accept(*this);
       
  4787                 return NULL;
       
  4788                 
       
  4789             }
       
  4790             
       
  4791             ERROR;
       
  4792         }
       
  4793         
       
  4794     }/*function_usint_to_byte*/
       
  4795     break;
       
  4796 
       
  4797 /****
       
  4798  *USINT_TO_WORD
       
  4799  */
       
  4800     case function_usint_to_word :
       
  4801     {
       
  4802         symbol_c *last_type_symbol = NULL;
       
  4803 
       
  4804         {
       
  4805             identifier_c param_name("IN");
       
  4806             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4807             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4808             
       
  4809             /* Get the value from a foo(<param_value>) style call */
       
  4810             if (IN_param_value == NULL)
       
  4811               IN_param_value = function_call_param_iterator.next();
       
  4812             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4813             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4814             
       
  4815             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4816             {
       
  4817         
       
  4818                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  4819                 s4o.print("(");
       
  4820                 return_type_symbol->accept(*this);
       
  4821                 s4o.print(")");
       
  4822                 IN_param_value->accept(*this);
       
  4823                 return NULL;
       
  4824                 
       
  4825             }
       
  4826             
       
  4827             ERROR;
       
  4828         }
       
  4829         
       
  4830     }/*function_usint_to_word*/
       
  4831     break;
       
  4832 
       
  4833 /****
       
  4834  *USINT_TO_DWORD
       
  4835  */
       
  4836     case function_usint_to_dword :
       
  4837     {
       
  4838         symbol_c *last_type_symbol = NULL;
       
  4839 
       
  4840         {
       
  4841             identifier_c param_name("IN");
       
  4842             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4843             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4844             
       
  4845             /* Get the value from a foo(<param_value>) style call */
       
  4846             if (IN_param_value == NULL)
       
  4847               IN_param_value = function_call_param_iterator.next();
       
  4848             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4849             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4850             
       
  4851             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4852             {
       
  4853         
       
  4854                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  4855                 s4o.print("(");
       
  4856                 return_type_symbol->accept(*this);
       
  4857                 s4o.print(")");
       
  4858                 IN_param_value->accept(*this);
       
  4859                 return NULL;
       
  4860                 
       
  4861             }
       
  4862             
       
  4863             ERROR;
       
  4864         }
       
  4865         
       
  4866     }/*function_usint_to_dword*/
       
  4867     break;
       
  4868 
       
  4869 /****
       
  4870  *USINT_TO_LWORD
       
  4871  */
       
  4872     case function_usint_to_lword :
       
  4873     {
       
  4874         symbol_c *last_type_symbol = NULL;
       
  4875 
       
  4876         {
       
  4877             identifier_c param_name("IN");
       
  4878             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4879             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4880             
       
  4881             /* Get the value from a foo(<param_value>) style call */
       
  4882             if (IN_param_value == NULL)
       
  4883               IN_param_value = function_call_param_iterator.next();
       
  4884             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4885             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4886             
       
  4887             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4888             {
       
  4889         
       
  4890                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  4891                 s4o.print("(");
       
  4892                 return_type_symbol->accept(*this);
       
  4893                 s4o.print(")");
       
  4894                 IN_param_value->accept(*this);
       
  4895                 return NULL;
       
  4896                 
       
  4897             }
       
  4898             
       
  4899             ERROR;
       
  4900         }
       
  4901         
       
  4902     }/*function_usint_to_lword*/
       
  4903     break;
       
  4904 
       
  4905 /****
       
  4906  *USINT_TO_STRING
       
  4907  */
       
  4908     case function_usint_to_string :
       
  4909     {
       
  4910         symbol_c *last_type_symbol = NULL;
       
  4911 
       
  4912         {
       
  4913             identifier_c param_name("IN");
       
  4914             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4915             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4916             
       
  4917             /* Get the value from a foo(<param_value>) style call */
       
  4918             if (IN_param_value == NULL)
       
  4919               IN_param_value = function_call_param_iterator.next();
       
  4920             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4921             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4922             
       
  4923             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4924             {
       
  4925         
       
  4926                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  4927                 s4o.print("(");
       
  4928                 return_type_symbol->accept(*this);
       
  4929                 s4o.print(")int_to_string(");
       
  4930                 IN_param_value->accept(*this);
       
  4931                 s4o.print(", 10)");
       
  4932                 return NULL;
       
  4933                 
       
  4934             }
       
  4935             
       
  4936             ERROR;
       
  4937         }
       
  4938         
       
  4939     }/*function_usint_to_string*/
       
  4940     break;
       
  4941 
       
  4942 /****
       
  4943  *USINT_TO_WSTRING
       
  4944  */
       
  4945     case function_usint_to_wstring :
       
  4946     {
       
  4947         symbol_c *last_type_symbol = NULL;
       
  4948 
       
  4949         {
       
  4950             identifier_c param_name("IN");
       
  4951             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4952             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4953             
       
  4954             /* Get the value from a foo(<param_value>) style call */
       
  4955             if (IN_param_value == NULL)
       
  4956               IN_param_value = function_call_param_iterator.next();
       
  4957             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4958             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4959             
       
  4960             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4961             {
       
  4962         
       
  4963                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
  4964                 s4o.print("(");
       
  4965                 return_type_symbol->accept(*this);
       
  4966                 s4o.print(")int_to_string(");
       
  4967                 IN_param_value->accept(*this);
       
  4968                 s4o.print(", 10)");
       
  4969                 return NULL;
       
  4970                 
       
  4971             }
       
  4972             
       
  4973             ERROR;
       
  4974         }
       
  4975         
       
  4976     }/*function_usint_to_wstring*/
       
  4977     break;
       
  4978 
       
  4979 /****
       
  4980  *USINT_TO_DATE
       
  4981  */
       
  4982     case function_usint_to_date :
       
  4983     {
       
  4984         symbol_c *last_type_symbol = NULL;
       
  4985 
       
  4986         {
       
  4987             identifier_c param_name("IN");
       
  4988             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  4989             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  4990             
       
  4991             /* Get the value from a foo(<param_value>) style call */
       
  4992             if (IN_param_value == NULL)
       
  4993               IN_param_value = function_call_param_iterator.next();
       
  4994             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  4995             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  4996             
       
  4997             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  4998             {
       
  4999         
       
  5000                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  5001                 s4o.print("(");
       
  5002                 return_type_symbol->accept(*this);
       
  5003                 s4o.print(")real_to_time(");
       
  5004                 IN_param_value->accept(*this);
       
  5005                 s4o.print(")");
       
  5006                 return NULL;
       
  5007                 
       
  5008             }
       
  5009             
       
  5010             ERROR;
       
  5011         }
       
  5012         
       
  5013     }/*function_usint_to_date*/
       
  5014     break;
       
  5015 
       
  5016 /****
       
  5017  *USINT_TO_TOD
       
  5018  */
       
  5019     case function_usint_to_tod :
       
  5020     {
       
  5021         symbol_c *last_type_symbol = NULL;
       
  5022 
       
  5023         {
       
  5024             identifier_c param_name("IN");
       
  5025             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5026             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5027             
       
  5028             /* Get the value from a foo(<param_value>) style call */
       
  5029             if (IN_param_value == NULL)
       
  5030               IN_param_value = function_call_param_iterator.next();
       
  5031             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5032             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5033             
       
  5034             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  5035             {
       
  5036         
       
  5037                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  5038                 s4o.print("(");
       
  5039                 return_type_symbol->accept(*this);
       
  5040                 s4o.print(")real_to_time(");
       
  5041                 IN_param_value->accept(*this);
       
  5042                 s4o.print(")");
       
  5043                 return NULL;
       
  5044                 
       
  5045             }
       
  5046             
       
  5047             ERROR;
       
  5048         }
       
  5049         
       
  5050     }/*function_usint_to_tod*/
       
  5051     break;
       
  5052 
       
  5053 /****
       
  5054  *USINT_TO_DT
       
  5055  */
       
  5056     case function_usint_to_dt :
       
  5057     {
       
  5058         symbol_c *last_type_symbol = NULL;
       
  5059 
       
  5060         {
       
  5061             identifier_c param_name("IN");
       
  5062             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5063             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5064             
       
  5065             /* Get the value from a foo(<param_value>) style call */
       
  5066             if (IN_param_value == NULL)
       
  5067               IN_param_value = function_call_param_iterator.next();
       
  5068             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5069             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5070             
       
  5071             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
  5072             {
       
  5073         
       
  5074                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  5075                 s4o.print("(");
       
  5076                 return_type_symbol->accept(*this);
       
  5077                 s4o.print(")real_to_time(");
       
  5078                 IN_param_value->accept(*this);
       
  5079                 s4o.print(")");
       
  5080                 return NULL;
       
  5081                 
       
  5082             }
       
  5083             
       
  5084             ERROR;
       
  5085         }
       
  5086         
       
  5087     }/*function_usint_to_dt*/
       
  5088     break;
       
  5089 
       
  5090 /****
       
  5091  *UINT_TO_REAL
       
  5092  */
       
  5093     case function_uint_to_real :
       
  5094     {
       
  5095         symbol_c *last_type_symbol = NULL;
       
  5096 
       
  5097         {
       
  5098             identifier_c param_name("IN");
       
  5099             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5100             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5101             
       
  5102             /* Get the value from a foo(<param_value>) style call */
       
  5103             if (IN_param_value == NULL)
       
  5104               IN_param_value = function_call_param_iterator.next();
       
  5105             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5106             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5107             
       
  5108             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5109             {
       
  5110         
       
  5111                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  5112                 s4o.print("(");
       
  5113                 return_type_symbol->accept(*this);
       
  5114                 s4o.print(")");
       
  5115                 IN_param_value->accept(*this);
       
  5116                 return NULL;
       
  5117                 
       
  5118             }
       
  5119             
       
  5120             ERROR;
       
  5121         }
       
  5122         
       
  5123     }/*function_uint_to_real*/
       
  5124     break;
       
  5125 
       
  5126 /****
       
  5127  *UINT_TO_LREAL
       
  5128  */
       
  5129     case function_uint_to_lreal :
       
  5130     {
       
  5131         symbol_c *last_type_symbol = NULL;
       
  5132 
       
  5133         {
       
  5134             identifier_c param_name("IN");
       
  5135             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5136             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5137             
       
  5138             /* Get the value from a foo(<param_value>) style call */
       
  5139             if (IN_param_value == NULL)
       
  5140               IN_param_value = function_call_param_iterator.next();
       
  5141             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5142             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5143             
       
  5144             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5145             {
       
  5146         
       
  5147                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  5148                 s4o.print("(");
       
  5149                 return_type_symbol->accept(*this);
       
  5150                 s4o.print(")");
       
  5151                 IN_param_value->accept(*this);
       
  5152                 return NULL;
       
  5153                 
       
  5154             }
       
  5155             
       
  5156             ERROR;
       
  5157         }
       
  5158         
       
  5159     }/*function_uint_to_lreal*/
       
  5160     break;
       
  5161 
       
  5162 /****
       
  5163  *UINT_TO_SINT
       
  5164  */
       
  5165     case function_uint_to_sint :
       
  5166     {
       
  5167         symbol_c *last_type_symbol = NULL;
       
  5168 
       
  5169         {
       
  5170             identifier_c param_name("IN");
       
  5171             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5172             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5173             
       
  5174             /* Get the value from a foo(<param_value>) style call */
       
  5175             if (IN_param_value == NULL)
       
  5176               IN_param_value = function_call_param_iterator.next();
       
  5177             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5178             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5179             
       
  5180             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5181             {
       
  5182         
       
  5183                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  5184                 s4o.print("(");
       
  5185                 return_type_symbol->accept(*this);
       
  5186                 s4o.print(")");
       
  5187                 IN_param_value->accept(*this);
       
  5188                 return NULL;
       
  5189                 
       
  5190             }
       
  5191             
       
  5192             ERROR;
       
  5193         }
       
  5194         
       
  5195     }/*function_uint_to_sint*/
       
  5196     break;
       
  5197 
       
  5198 /****
       
  5199  *UINT_TO_INT
       
  5200  */
       
  5201     case function_uint_to_int :
       
  5202     {
       
  5203         symbol_c *last_type_symbol = NULL;
       
  5204 
       
  5205         {
       
  5206             identifier_c param_name("IN");
       
  5207             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5208             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5209             
       
  5210             /* Get the value from a foo(<param_value>) style call */
       
  5211             if (IN_param_value == NULL)
       
  5212               IN_param_value = function_call_param_iterator.next();
       
  5213             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5214             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5215             
       
  5216             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5217             {
       
  5218         
       
  5219                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  5220                 s4o.print("(");
       
  5221                 return_type_symbol->accept(*this);
       
  5222                 s4o.print(")");
       
  5223                 IN_param_value->accept(*this);
       
  5224                 return NULL;
       
  5225                 
       
  5226             }
       
  5227             
       
  5228             ERROR;
       
  5229         }
       
  5230         
       
  5231     }/*function_uint_to_int*/
       
  5232     break;
       
  5233 
       
  5234 /****
       
  5235  *UINT_TO_DINT
       
  5236  */
       
  5237     case function_uint_to_dint :
       
  5238     {
       
  5239         symbol_c *last_type_symbol = NULL;
       
  5240 
       
  5241         {
       
  5242             identifier_c param_name("IN");
       
  5243             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5244             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5245             
       
  5246             /* Get the value from a foo(<param_value>) style call */
       
  5247             if (IN_param_value == NULL)
       
  5248               IN_param_value = function_call_param_iterator.next();
       
  5249             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5250             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5251             
       
  5252             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5253             {
       
  5254         
       
  5255                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  5256                 s4o.print("(");
       
  5257                 return_type_symbol->accept(*this);
       
  5258                 s4o.print(")");
       
  5259                 IN_param_value->accept(*this);
       
  5260                 return NULL;
       
  5261                 
       
  5262             }
       
  5263             
       
  5264             ERROR;
       
  5265         }
       
  5266         
       
  5267     }/*function_uint_to_dint*/
       
  5268     break;
       
  5269 
       
  5270 /****
       
  5271  *UINT_TO_LINT
       
  5272  */
       
  5273     case function_uint_to_lint :
       
  5274     {
       
  5275         symbol_c *last_type_symbol = NULL;
       
  5276 
       
  5277         {
       
  5278             identifier_c param_name("IN");
       
  5279             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5280             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5281             
       
  5282             /* Get the value from a foo(<param_value>) style call */
       
  5283             if (IN_param_value == NULL)
       
  5284               IN_param_value = function_call_param_iterator.next();
       
  5285             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5286             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5287             
       
  5288             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5289             {
       
  5290         
       
  5291                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  5292                 s4o.print("(");
       
  5293                 return_type_symbol->accept(*this);
       
  5294                 s4o.print(")");
       
  5295                 IN_param_value->accept(*this);
       
  5296                 return NULL;
       
  5297                 
       
  5298             }
       
  5299             
       
  5300             ERROR;
       
  5301         }
       
  5302         
       
  5303     }/*function_uint_to_lint*/
       
  5304     break;
       
  5305 
       
  5306 /****
       
  5307  *UINT_TO_USINT
       
  5308  */
       
  5309     case function_uint_to_usint :
       
  5310     {
       
  5311         symbol_c *last_type_symbol = NULL;
       
  5312 
       
  5313         {
       
  5314             identifier_c param_name("IN");
       
  5315             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5316             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5317             
       
  5318             /* Get the value from a foo(<param_value>) style call */
       
  5319             if (IN_param_value == NULL)
       
  5320               IN_param_value = function_call_param_iterator.next();
       
  5321             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5322             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5323             
       
  5324             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5325             {
       
  5326         
       
  5327                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  5328                 s4o.print("(");
       
  5329                 return_type_symbol->accept(*this);
       
  5330                 s4o.print(")");
       
  5331                 IN_param_value->accept(*this);
       
  5332                 return NULL;
       
  5333                 
       
  5334             }
       
  5335             
       
  5336             ERROR;
       
  5337         }
       
  5338         
       
  5339     }/*function_uint_to_usint*/
       
  5340     break;
       
  5341 
       
  5342 /****
       
  5343  *UINT_TO_UDINT
       
  5344  */
       
  5345     case function_uint_to_udint :
       
  5346     {
       
  5347         symbol_c *last_type_symbol = NULL;
       
  5348 
       
  5349         {
       
  5350             identifier_c param_name("IN");
       
  5351             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5352             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5353             
       
  5354             /* Get the value from a foo(<param_value>) style call */
       
  5355             if (IN_param_value == NULL)
       
  5356               IN_param_value = function_call_param_iterator.next();
       
  5357             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5358             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5359             
       
  5360             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5361             {
       
  5362         
       
  5363                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  5364                 s4o.print("(");
       
  5365                 return_type_symbol->accept(*this);
       
  5366                 s4o.print(")");
       
  5367                 IN_param_value->accept(*this);
       
  5368                 return NULL;
       
  5369                 
       
  5370             }
       
  5371             
       
  5372             ERROR;
       
  5373         }
       
  5374         
       
  5375     }/*function_uint_to_udint*/
       
  5376     break;
       
  5377 
       
  5378 /****
       
  5379  *UINT_TO_ULINT
       
  5380  */
       
  5381     case function_uint_to_ulint :
       
  5382     {
       
  5383         symbol_c *last_type_symbol = NULL;
       
  5384 
       
  5385         {
       
  5386             identifier_c param_name("IN");
       
  5387             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5388             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5389             
       
  5390             /* Get the value from a foo(<param_value>) style call */
       
  5391             if (IN_param_value == NULL)
       
  5392               IN_param_value = function_call_param_iterator.next();
       
  5393             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5394             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5395             
       
  5396             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5397             {
       
  5398         
       
  5399                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  5400                 s4o.print("(");
       
  5401                 return_type_symbol->accept(*this);
       
  5402                 s4o.print(")");
       
  5403                 IN_param_value->accept(*this);
       
  5404                 return NULL;
       
  5405                 
       
  5406             }
       
  5407             
       
  5408             ERROR;
       
  5409         }
       
  5410         
       
  5411     }/*function_uint_to_ulint*/
       
  5412     break;
       
  5413 
       
  5414 /****
       
  5415  *UINT_TO_TIME
       
  5416  */
       
  5417     case function_uint_to_time :
       
  5418     {
       
  5419         symbol_c *last_type_symbol = NULL;
       
  5420 
       
  5421         {
       
  5422             identifier_c param_name("IN");
       
  5423             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5424             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5425             
       
  5426             /* Get the value from a foo(<param_value>) style call */
       
  5427             if (IN_param_value == NULL)
       
  5428               IN_param_value = function_call_param_iterator.next();
       
  5429             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5430             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5431             
       
  5432             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5433             {
       
  5434         
       
  5435                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  5436                 s4o.print("(");
       
  5437                 return_type_symbol->accept(*this);
       
  5438                 s4o.print(")real_to_time(");
       
  5439                 IN_param_value->accept(*this);
       
  5440                 s4o.print(")");
       
  5441                 return NULL;
       
  5442                 
       
  5443             }
       
  5444             
       
  5445             ERROR;
       
  5446         }
       
  5447         
       
  5448     }/*function_uint_to_time*/
       
  5449     break;
       
  5450 
       
  5451 /****
       
  5452  *UINT_TO_BOOL
       
  5453  */
       
  5454     case function_uint_to_bool :
       
  5455     {
       
  5456         symbol_c *last_type_symbol = NULL;
       
  5457 
       
  5458         {
       
  5459             identifier_c param_name("IN");
       
  5460             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5461             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5462             
       
  5463             /* Get the value from a foo(<param_value>) style call */
       
  5464             if (IN_param_value == NULL)
       
  5465               IN_param_value = function_call_param_iterator.next();
       
  5466             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5467             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5468             
       
  5469             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5470             {
       
  5471         
       
  5472                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  5473                 s4o.print("(");
       
  5474                 return_type_symbol->accept(*this);
       
  5475                 s4o.print(")");
       
  5476                 IN_param_value->accept(*this);
       
  5477                 return NULL;
       
  5478                 
       
  5479             }
       
  5480             
       
  5481             ERROR;
       
  5482         }
       
  5483         
       
  5484     }/*function_uint_to_bool*/
       
  5485     break;
       
  5486 
       
  5487 /****
       
  5488  *UINT_TO_BYTE
       
  5489  */
       
  5490     case function_uint_to_byte :
       
  5491     {
       
  5492         symbol_c *last_type_symbol = NULL;
       
  5493 
       
  5494         {
       
  5495             identifier_c param_name("IN");
       
  5496             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5497             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5498             
       
  5499             /* Get the value from a foo(<param_value>) style call */
       
  5500             if (IN_param_value == NULL)
       
  5501               IN_param_value = function_call_param_iterator.next();
       
  5502             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5503             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5504             
       
  5505             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5506             {
       
  5507         
       
  5508                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  5509                 s4o.print("(");
       
  5510                 return_type_symbol->accept(*this);
       
  5511                 s4o.print(")");
       
  5512                 IN_param_value->accept(*this);
       
  5513                 return NULL;
       
  5514                 
       
  5515             }
       
  5516             
       
  5517             ERROR;
       
  5518         }
       
  5519         
       
  5520     }/*function_uint_to_byte*/
       
  5521     break;
       
  5522 
       
  5523 /****
       
  5524  *UINT_TO_WORD
       
  5525  */
       
  5526     case function_uint_to_word :
       
  5527     {
       
  5528         symbol_c *last_type_symbol = NULL;
       
  5529 
       
  5530         {
       
  5531             identifier_c param_name("IN");
       
  5532             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5533             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5534             
       
  5535             /* Get the value from a foo(<param_value>) style call */
       
  5536             if (IN_param_value == NULL)
       
  5537               IN_param_value = function_call_param_iterator.next();
       
  5538             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5539             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5540             
       
  5541             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5542             {
       
  5543         
       
  5544                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  5545                 s4o.print("(");
       
  5546                 return_type_symbol->accept(*this);
       
  5547                 s4o.print(")");
       
  5548                 IN_param_value->accept(*this);
       
  5549                 return NULL;
       
  5550                 
       
  5551             }
       
  5552             
       
  5553             ERROR;
       
  5554         }
       
  5555         
       
  5556     }/*function_uint_to_word*/
       
  5557     break;
       
  5558 
       
  5559 /****
       
  5560  *UINT_TO_DWORD
       
  5561  */
       
  5562     case function_uint_to_dword :
       
  5563     {
       
  5564         symbol_c *last_type_symbol = NULL;
       
  5565 
       
  5566         {
       
  5567             identifier_c param_name("IN");
       
  5568             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5569             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5570             
       
  5571             /* Get the value from a foo(<param_value>) style call */
       
  5572             if (IN_param_value == NULL)
       
  5573               IN_param_value = function_call_param_iterator.next();
       
  5574             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5575             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5576             
       
  5577             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5578             {
       
  5579         
       
  5580                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  5581                 s4o.print("(");
       
  5582                 return_type_symbol->accept(*this);
       
  5583                 s4o.print(")");
       
  5584                 IN_param_value->accept(*this);
       
  5585                 return NULL;
       
  5586                 
       
  5587             }
       
  5588             
       
  5589             ERROR;
       
  5590         }
       
  5591         
       
  5592     }/*function_uint_to_dword*/
       
  5593     break;
       
  5594 
       
  5595 /****
       
  5596  *UINT_TO_LWORD
       
  5597  */
       
  5598     case function_uint_to_lword :
       
  5599     {
       
  5600         symbol_c *last_type_symbol = NULL;
       
  5601 
       
  5602         {
       
  5603             identifier_c param_name("IN");
       
  5604             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5605             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5606             
       
  5607             /* Get the value from a foo(<param_value>) style call */
       
  5608             if (IN_param_value == NULL)
       
  5609               IN_param_value = function_call_param_iterator.next();
       
  5610             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5611             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5612             
       
  5613             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5614             {
       
  5615         
       
  5616                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  5617                 s4o.print("(");
       
  5618                 return_type_symbol->accept(*this);
       
  5619                 s4o.print(")");
       
  5620                 IN_param_value->accept(*this);
       
  5621                 return NULL;
       
  5622                 
       
  5623             }
       
  5624             
       
  5625             ERROR;
       
  5626         }
       
  5627         
       
  5628     }/*function_uint_to_lword*/
       
  5629     break;
       
  5630 
       
  5631 /****
       
  5632  *UINT_TO_STRING
       
  5633  */
       
  5634     case function_uint_to_string :
       
  5635     {
       
  5636         symbol_c *last_type_symbol = NULL;
       
  5637 
       
  5638         {
       
  5639             identifier_c param_name("IN");
       
  5640             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5641             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5642             
       
  5643             /* Get the value from a foo(<param_value>) style call */
       
  5644             if (IN_param_value == NULL)
       
  5645               IN_param_value = function_call_param_iterator.next();
       
  5646             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5647             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5648             
       
  5649             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5650             {
       
  5651         
       
  5652                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  5653                 s4o.print("(");
       
  5654                 return_type_symbol->accept(*this);
       
  5655                 s4o.print(")int_to_string(");
       
  5656                 IN_param_value->accept(*this);
       
  5657                 s4o.print(", 10)");
       
  5658                 return NULL;
       
  5659                 
       
  5660             }
       
  5661             
       
  5662             ERROR;
       
  5663         }
       
  5664         
       
  5665     }/*function_uint_to_string*/
       
  5666     break;
       
  5667 
       
  5668 /****
       
  5669  *UINT_TO_WSTRING
       
  5670  */
       
  5671     case function_uint_to_wstring :
       
  5672     {
       
  5673         symbol_c *last_type_symbol = NULL;
       
  5674 
       
  5675         {
       
  5676             identifier_c param_name("IN");
       
  5677             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5678             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5679             
       
  5680             /* Get the value from a foo(<param_value>) style call */
       
  5681             if (IN_param_value == NULL)
       
  5682               IN_param_value = function_call_param_iterator.next();
       
  5683             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5684             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5685             
       
  5686             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5687             {
       
  5688         
       
  5689                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
  5690                 s4o.print("(");
       
  5691                 return_type_symbol->accept(*this);
       
  5692                 s4o.print(")int_to_string(");
       
  5693                 IN_param_value->accept(*this);
       
  5694                 s4o.print(", 10)");
       
  5695                 return NULL;
       
  5696                 
       
  5697             }
       
  5698             
       
  5699             ERROR;
       
  5700         }
       
  5701         
       
  5702     }/*function_uint_to_wstring*/
       
  5703     break;
       
  5704 
       
  5705 /****
       
  5706  *UINT_TO_DATE
       
  5707  */
       
  5708     case function_uint_to_date :
       
  5709     {
       
  5710         symbol_c *last_type_symbol = NULL;
       
  5711 
       
  5712         {
       
  5713             identifier_c param_name("IN");
       
  5714             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5715             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5716             
       
  5717             /* Get the value from a foo(<param_value>) style call */
       
  5718             if (IN_param_value == NULL)
       
  5719               IN_param_value = function_call_param_iterator.next();
       
  5720             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5721             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5722             
       
  5723             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5724             {
       
  5725         
       
  5726                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  5727                 s4o.print("(");
       
  5728                 return_type_symbol->accept(*this);
       
  5729                 s4o.print(")real_to_time(");
       
  5730                 IN_param_value->accept(*this);
       
  5731                 s4o.print(")");
       
  5732                 return NULL;
       
  5733                 
       
  5734             }
       
  5735             
       
  5736             ERROR;
       
  5737         }
       
  5738         
       
  5739     }/*function_uint_to_date*/
       
  5740     break;
       
  5741 
       
  5742 /****
       
  5743  *UINT_TO_TOD
       
  5744  */
       
  5745     case function_uint_to_tod :
       
  5746     {
       
  5747         symbol_c *last_type_symbol = NULL;
       
  5748 
       
  5749         {
       
  5750             identifier_c param_name("IN");
       
  5751             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5752             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5753             
       
  5754             /* Get the value from a foo(<param_value>) style call */
       
  5755             if (IN_param_value == NULL)
       
  5756               IN_param_value = function_call_param_iterator.next();
       
  5757             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5758             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5759             
       
  5760             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5761             {
       
  5762         
       
  5763                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  5764                 s4o.print("(");
       
  5765                 return_type_symbol->accept(*this);
       
  5766                 s4o.print(")real_to_time(");
       
  5767                 IN_param_value->accept(*this);
       
  5768                 s4o.print(")");
       
  5769                 return NULL;
       
  5770                 
       
  5771             }
       
  5772             
       
  5773             ERROR;
       
  5774         }
       
  5775         
       
  5776     }/*function_uint_to_tod*/
       
  5777     break;
       
  5778 
       
  5779 /****
       
  5780  *UINT_TO_DT
       
  5781  */
       
  5782     case function_uint_to_dt :
       
  5783     {
       
  5784         symbol_c *last_type_symbol = NULL;
       
  5785 
       
  5786         {
       
  5787             identifier_c param_name("IN");
       
  5788             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5789             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5790             
       
  5791             /* Get the value from a foo(<param_value>) style call */
       
  5792             if (IN_param_value == NULL)
       
  5793               IN_param_value = function_call_param_iterator.next();
       
  5794             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5795             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5796             
       
  5797             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
  5798             {
       
  5799         
       
  5800                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  5801                 s4o.print("(");
       
  5802                 return_type_symbol->accept(*this);
       
  5803                 s4o.print(")real_to_time(");
       
  5804                 IN_param_value->accept(*this);
       
  5805                 s4o.print(")");
       
  5806                 return NULL;
       
  5807                 
       
  5808             }
       
  5809             
       
  5810             ERROR;
       
  5811         }
       
  5812         
       
  5813     }/*function_uint_to_dt*/
       
  5814     break;
       
  5815 
       
  5816 /****
       
  5817  *UDINT_TO_REAL
       
  5818  */
       
  5819     case function_udint_to_real :
       
  5820     {
       
  5821         symbol_c *last_type_symbol = NULL;
       
  5822 
       
  5823         {
       
  5824             identifier_c param_name("IN");
       
  5825             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5826             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5827             
       
  5828             /* Get the value from a foo(<param_value>) style call */
       
  5829             if (IN_param_value == NULL)
       
  5830               IN_param_value = function_call_param_iterator.next();
       
  5831             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5832             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5833             
       
  5834             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5835             {
       
  5836         
       
  5837                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  5838                 s4o.print("(");
       
  5839                 return_type_symbol->accept(*this);
       
  5840                 s4o.print(")");
       
  5841                 IN_param_value->accept(*this);
       
  5842                 return NULL;
       
  5843                 
       
  5844             }
       
  5845             
       
  5846             ERROR;
       
  5847         }
       
  5848         
       
  5849     }/*function_udint_to_real*/
       
  5850     break;
       
  5851 
       
  5852 /****
       
  5853  *UDINT_TO_LREAL
       
  5854  */
       
  5855     case function_udint_to_lreal :
       
  5856     {
       
  5857         symbol_c *last_type_symbol = NULL;
       
  5858 
       
  5859         {
       
  5860             identifier_c param_name("IN");
       
  5861             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5862             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5863             
       
  5864             /* Get the value from a foo(<param_value>) style call */
       
  5865             if (IN_param_value == NULL)
       
  5866               IN_param_value = function_call_param_iterator.next();
       
  5867             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5868             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5869             
       
  5870             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5871             {
       
  5872         
       
  5873                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  5874                 s4o.print("(");
       
  5875                 return_type_symbol->accept(*this);
       
  5876                 s4o.print(")");
       
  5877                 IN_param_value->accept(*this);
       
  5878                 return NULL;
       
  5879                 
       
  5880             }
       
  5881             
       
  5882             ERROR;
       
  5883         }
       
  5884         
       
  5885     }/*function_udint_to_lreal*/
       
  5886     break;
       
  5887 
       
  5888 /****
       
  5889  *UDINT_TO_SINT
       
  5890  */
       
  5891     case function_udint_to_sint :
       
  5892     {
       
  5893         symbol_c *last_type_symbol = NULL;
       
  5894 
       
  5895         {
       
  5896             identifier_c param_name("IN");
       
  5897             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5898             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5899             
       
  5900             /* Get the value from a foo(<param_value>) style call */
       
  5901             if (IN_param_value == NULL)
       
  5902               IN_param_value = function_call_param_iterator.next();
       
  5903             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5904             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5905             
       
  5906             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5907             {
       
  5908         
       
  5909                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  5910                 s4o.print("(");
       
  5911                 return_type_symbol->accept(*this);
       
  5912                 s4o.print(")");
       
  5913                 IN_param_value->accept(*this);
       
  5914                 return NULL;
       
  5915                 
       
  5916             }
       
  5917             
       
  5918             ERROR;
       
  5919         }
       
  5920         
       
  5921     }/*function_udint_to_sint*/
       
  5922     break;
       
  5923 
       
  5924 /****
       
  5925  *UDINT_TO_INT
       
  5926  */
       
  5927     case function_udint_to_int :
       
  5928     {
       
  5929         symbol_c *last_type_symbol = NULL;
       
  5930 
       
  5931         {
       
  5932             identifier_c param_name("IN");
       
  5933             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5934             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5935             
       
  5936             /* Get the value from a foo(<param_value>) style call */
       
  5937             if (IN_param_value == NULL)
       
  5938               IN_param_value = function_call_param_iterator.next();
       
  5939             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5940             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5941             
       
  5942             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5943             {
       
  5944         
       
  5945                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  5946                 s4o.print("(");
       
  5947                 return_type_symbol->accept(*this);
       
  5948                 s4o.print(")");
       
  5949                 IN_param_value->accept(*this);
       
  5950                 return NULL;
       
  5951                 
       
  5952             }
       
  5953             
       
  5954             ERROR;
       
  5955         }
       
  5956         
       
  5957     }/*function_udint_to_int*/
       
  5958     break;
       
  5959 
       
  5960 /****
       
  5961  *UDINT_TO_DINT
       
  5962  */
       
  5963     case function_udint_to_dint :
       
  5964     {
       
  5965         symbol_c *last_type_symbol = NULL;
       
  5966 
       
  5967         {
       
  5968             identifier_c param_name("IN");
       
  5969             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  5970             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  5971             
       
  5972             /* Get the value from a foo(<param_value>) style call */
       
  5973             if (IN_param_value == NULL)
       
  5974               IN_param_value = function_call_param_iterator.next();
       
  5975             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  5976             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  5977             
       
  5978             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  5979             {
       
  5980         
       
  5981                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  5982                 s4o.print("(");
       
  5983                 return_type_symbol->accept(*this);
       
  5984                 s4o.print(")");
       
  5985                 IN_param_value->accept(*this);
       
  5986                 return NULL;
       
  5987                 
       
  5988             }
       
  5989             
       
  5990             ERROR;
       
  5991         }
       
  5992         
       
  5993     }/*function_udint_to_dint*/
       
  5994     break;
       
  5995 
       
  5996 /****
       
  5997  *UDINT_TO_LINT
       
  5998  */
       
  5999     case function_udint_to_lint :
       
  6000     {
       
  6001         symbol_c *last_type_symbol = NULL;
       
  6002 
       
  6003         {
       
  6004             identifier_c param_name("IN");
       
  6005             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6006             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6007             
       
  6008             /* Get the value from a foo(<param_value>) style call */
       
  6009             if (IN_param_value == NULL)
       
  6010               IN_param_value = function_call_param_iterator.next();
       
  6011             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6012             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6013             
       
  6014             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6015             {
       
  6016         
       
  6017                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  6018                 s4o.print("(");
       
  6019                 return_type_symbol->accept(*this);
       
  6020                 s4o.print(")");
       
  6021                 IN_param_value->accept(*this);
       
  6022                 return NULL;
       
  6023                 
       
  6024             }
       
  6025             
       
  6026             ERROR;
       
  6027         }
       
  6028         
       
  6029     }/*function_udint_to_lint*/
       
  6030     break;
       
  6031 
       
  6032 /****
       
  6033  *UDINT_TO_USINT
       
  6034  */
       
  6035     case function_udint_to_usint :
       
  6036     {
       
  6037         symbol_c *last_type_symbol = NULL;
       
  6038 
       
  6039         {
       
  6040             identifier_c param_name("IN");
       
  6041             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6042             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6043             
       
  6044             /* Get the value from a foo(<param_value>) style call */
       
  6045             if (IN_param_value == NULL)
       
  6046               IN_param_value = function_call_param_iterator.next();
       
  6047             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6048             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6049             
       
  6050             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6051             {
       
  6052         
       
  6053                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  6054                 s4o.print("(");
       
  6055                 return_type_symbol->accept(*this);
       
  6056                 s4o.print(")");
       
  6057                 IN_param_value->accept(*this);
       
  6058                 return NULL;
       
  6059                 
       
  6060             }
       
  6061             
       
  6062             ERROR;
       
  6063         }
       
  6064         
       
  6065     }/*function_udint_to_usint*/
       
  6066     break;
       
  6067 
       
  6068 /****
       
  6069  *UDINT_TO_UINT
       
  6070  */
       
  6071     case function_udint_to_uint :
       
  6072     {
       
  6073         symbol_c *last_type_symbol = NULL;
       
  6074 
       
  6075         {
       
  6076             identifier_c param_name("IN");
       
  6077             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6078             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6079             
       
  6080             /* Get the value from a foo(<param_value>) style call */
       
  6081             if (IN_param_value == NULL)
       
  6082               IN_param_value = function_call_param_iterator.next();
       
  6083             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6084             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6085             
       
  6086             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6087             {
       
  6088         
       
  6089                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  6090                 s4o.print("(");
       
  6091                 return_type_symbol->accept(*this);
       
  6092                 s4o.print(")");
       
  6093                 IN_param_value->accept(*this);
       
  6094                 return NULL;
       
  6095                 
       
  6096             }
       
  6097             
       
  6098             ERROR;
       
  6099         }
       
  6100         
       
  6101     }/*function_udint_to_uint*/
       
  6102     break;
       
  6103 
       
  6104 /****
       
  6105  *UDINT_TO_ULINT
       
  6106  */
       
  6107     case function_udint_to_ulint :
       
  6108     {
       
  6109         symbol_c *last_type_symbol = NULL;
       
  6110 
       
  6111         {
       
  6112             identifier_c param_name("IN");
       
  6113             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6114             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6115             
       
  6116             /* Get the value from a foo(<param_value>) style call */
       
  6117             if (IN_param_value == NULL)
       
  6118               IN_param_value = function_call_param_iterator.next();
       
  6119             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6120             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6121             
       
  6122             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6123             {
       
  6124         
       
  6125                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  6126                 s4o.print("(");
       
  6127                 return_type_symbol->accept(*this);
       
  6128                 s4o.print(")");
       
  6129                 IN_param_value->accept(*this);
       
  6130                 return NULL;
       
  6131                 
       
  6132             }
       
  6133             
       
  6134             ERROR;
       
  6135         }
       
  6136         
       
  6137     }/*function_udint_to_ulint*/
       
  6138     break;
       
  6139 
       
  6140 /****
       
  6141  *UDINT_TO_TIME
       
  6142  */
       
  6143     case function_udint_to_time :
       
  6144     {
       
  6145         symbol_c *last_type_symbol = NULL;
       
  6146 
       
  6147         {
       
  6148             identifier_c param_name("IN");
       
  6149             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6150             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6151             
       
  6152             /* Get the value from a foo(<param_value>) style call */
       
  6153             if (IN_param_value == NULL)
       
  6154               IN_param_value = function_call_param_iterator.next();
       
  6155             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6156             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6157             
       
  6158             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6159             {
       
  6160         
       
  6161                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  6162                 s4o.print("(");
       
  6163                 return_type_symbol->accept(*this);
       
  6164                 s4o.print(")real_to_time(");
       
  6165                 IN_param_value->accept(*this);
       
  6166                 s4o.print(")");
       
  6167                 return NULL;
       
  6168                 
       
  6169             }
       
  6170             
       
  6171             ERROR;
       
  6172         }
       
  6173         
       
  6174     }/*function_udint_to_time*/
       
  6175     break;
       
  6176 
       
  6177 /****
       
  6178  *UDINT_TO_BOOL
       
  6179  */
       
  6180     case function_udint_to_bool :
       
  6181     {
       
  6182         symbol_c *last_type_symbol = NULL;
       
  6183 
       
  6184         {
       
  6185             identifier_c param_name("IN");
       
  6186             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6187             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6188             
       
  6189             /* Get the value from a foo(<param_value>) style call */
       
  6190             if (IN_param_value == NULL)
       
  6191               IN_param_value = function_call_param_iterator.next();
       
  6192             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6193             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6194             
       
  6195             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6196             {
       
  6197         
       
  6198                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  6199                 s4o.print("(");
       
  6200                 return_type_symbol->accept(*this);
       
  6201                 s4o.print(")");
       
  6202                 IN_param_value->accept(*this);
       
  6203                 return NULL;
       
  6204                 
       
  6205             }
       
  6206             
       
  6207             ERROR;
       
  6208         }
       
  6209         
       
  6210     }/*function_udint_to_bool*/
       
  6211     break;
       
  6212 
       
  6213 /****
       
  6214  *UDINT_TO_BYTE
       
  6215  */
       
  6216     case function_udint_to_byte :
       
  6217     {
       
  6218         symbol_c *last_type_symbol = NULL;
       
  6219 
       
  6220         {
       
  6221             identifier_c param_name("IN");
       
  6222             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6223             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6224             
       
  6225             /* Get the value from a foo(<param_value>) style call */
       
  6226             if (IN_param_value == NULL)
       
  6227               IN_param_value = function_call_param_iterator.next();
       
  6228             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6229             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6230             
       
  6231             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6232             {
       
  6233         
       
  6234                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  6235                 s4o.print("(");
       
  6236                 return_type_symbol->accept(*this);
       
  6237                 s4o.print(")");
       
  6238                 IN_param_value->accept(*this);
       
  6239                 return NULL;
       
  6240                 
       
  6241             }
       
  6242             
       
  6243             ERROR;
       
  6244         }
       
  6245         
       
  6246     }/*function_udint_to_byte*/
       
  6247     break;
       
  6248 
       
  6249 /****
       
  6250  *UDINT_TO_WORD
       
  6251  */
       
  6252     case function_udint_to_word :
       
  6253     {
       
  6254         symbol_c *last_type_symbol = NULL;
       
  6255 
       
  6256         {
       
  6257             identifier_c param_name("IN");
       
  6258             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6259             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6260             
       
  6261             /* Get the value from a foo(<param_value>) style call */
       
  6262             if (IN_param_value == NULL)
       
  6263               IN_param_value = function_call_param_iterator.next();
       
  6264             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6265             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6266             
       
  6267             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6268             {
       
  6269         
       
  6270                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  6271                 s4o.print("(");
       
  6272                 return_type_symbol->accept(*this);
       
  6273                 s4o.print(")");
       
  6274                 IN_param_value->accept(*this);
       
  6275                 return NULL;
       
  6276                 
       
  6277             }
       
  6278             
       
  6279             ERROR;
       
  6280         }
       
  6281         
       
  6282     }/*function_udint_to_word*/
       
  6283     break;
       
  6284 
       
  6285 /****
       
  6286  *UDINT_TO_DWORD
       
  6287  */
       
  6288     case function_udint_to_dword :
       
  6289     {
       
  6290         symbol_c *last_type_symbol = NULL;
       
  6291 
       
  6292         {
       
  6293             identifier_c param_name("IN");
       
  6294             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6295             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6296             
       
  6297             /* Get the value from a foo(<param_value>) style call */
       
  6298             if (IN_param_value == NULL)
       
  6299               IN_param_value = function_call_param_iterator.next();
       
  6300             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6301             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6302             
       
  6303             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6304             {
       
  6305         
       
  6306                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  6307                 s4o.print("(");
       
  6308                 return_type_symbol->accept(*this);
       
  6309                 s4o.print(")");
       
  6310                 IN_param_value->accept(*this);
       
  6311                 return NULL;
       
  6312                 
       
  6313             }
       
  6314             
       
  6315             ERROR;
       
  6316         }
       
  6317         
       
  6318     }/*function_udint_to_dword*/
       
  6319     break;
       
  6320 
       
  6321 /****
       
  6322  *UDINT_TO_LWORD
       
  6323  */
       
  6324     case function_udint_to_lword :
       
  6325     {
       
  6326         symbol_c *last_type_symbol = NULL;
       
  6327 
       
  6328         {
       
  6329             identifier_c param_name("IN");
       
  6330             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6331             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6332             
       
  6333             /* Get the value from a foo(<param_value>) style call */
       
  6334             if (IN_param_value == NULL)
       
  6335               IN_param_value = function_call_param_iterator.next();
       
  6336             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6337             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6338             
       
  6339             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6340             {
       
  6341         
       
  6342                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  6343                 s4o.print("(");
       
  6344                 return_type_symbol->accept(*this);
       
  6345                 s4o.print(")");
       
  6346                 IN_param_value->accept(*this);
       
  6347                 return NULL;
       
  6348                 
       
  6349             }
       
  6350             
       
  6351             ERROR;
       
  6352         }
       
  6353         
       
  6354     }/*function_udint_to_lword*/
       
  6355     break;
       
  6356 
       
  6357 /****
       
  6358  *UDINT_TO_STRING
       
  6359  */
       
  6360     case function_udint_to_string :
       
  6361     {
       
  6362         symbol_c *last_type_symbol = NULL;
       
  6363 
       
  6364         {
       
  6365             identifier_c param_name("IN");
       
  6366             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6367             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6368             
       
  6369             /* Get the value from a foo(<param_value>) style call */
       
  6370             if (IN_param_value == NULL)
       
  6371               IN_param_value = function_call_param_iterator.next();
       
  6372             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6373             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6374             
       
  6375             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6376             {
       
  6377         
       
  6378                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  6379                 s4o.print("(");
       
  6380                 return_type_symbol->accept(*this);
       
  6381                 s4o.print(")int_to_string(");
       
  6382                 IN_param_value->accept(*this);
       
  6383                 s4o.print(", 10)");
       
  6384                 return NULL;
       
  6385                 
       
  6386             }
       
  6387             
       
  6388             ERROR;
       
  6389         }
       
  6390         
       
  6391     }/*function_udint_to_string*/
       
  6392     break;
       
  6393 
       
  6394 /****
       
  6395  *UDINT_TO_WSTRING
       
  6396  */
       
  6397     case function_udint_to_wstring :
       
  6398     {
       
  6399         symbol_c *last_type_symbol = NULL;
       
  6400 
       
  6401         {
       
  6402             identifier_c param_name("IN");
       
  6403             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6404             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6405             
       
  6406             /* Get the value from a foo(<param_value>) style call */
       
  6407             if (IN_param_value == NULL)
       
  6408               IN_param_value = function_call_param_iterator.next();
       
  6409             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6410             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6411             
       
  6412             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6413             {
       
  6414         
       
  6415                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
  6416                 s4o.print("(");
       
  6417                 return_type_symbol->accept(*this);
       
  6418                 s4o.print(")int_to_string(");
       
  6419                 IN_param_value->accept(*this);
       
  6420                 s4o.print(", 10)");
       
  6421                 return NULL;
       
  6422                 
       
  6423             }
       
  6424             
       
  6425             ERROR;
       
  6426         }
       
  6427         
       
  6428     }/*function_udint_to_wstring*/
       
  6429     break;
       
  6430 
       
  6431 /****
       
  6432  *UDINT_TO_DATE
       
  6433  */
       
  6434     case function_udint_to_date :
       
  6435     {
       
  6436         symbol_c *last_type_symbol = NULL;
       
  6437 
       
  6438         {
       
  6439             identifier_c param_name("IN");
       
  6440             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6441             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6442             
       
  6443             /* Get the value from a foo(<param_value>) style call */
       
  6444             if (IN_param_value == NULL)
       
  6445               IN_param_value = function_call_param_iterator.next();
       
  6446             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6447             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6448             
       
  6449             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6450             {
       
  6451         
       
  6452                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  6453                 s4o.print("(");
       
  6454                 return_type_symbol->accept(*this);
       
  6455                 s4o.print(")real_to_time(");
       
  6456                 IN_param_value->accept(*this);
       
  6457                 s4o.print(")");
       
  6458                 return NULL;
       
  6459                 
       
  6460             }
       
  6461             
       
  6462             ERROR;
       
  6463         }
       
  6464         
       
  6465     }/*function_udint_to_date*/
       
  6466     break;
       
  6467 
       
  6468 /****
       
  6469  *UDINT_TO_TOD
       
  6470  */
       
  6471     case function_udint_to_tod :
       
  6472     {
       
  6473         symbol_c *last_type_symbol = NULL;
       
  6474 
       
  6475         {
       
  6476             identifier_c param_name("IN");
       
  6477             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6478             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6479             
       
  6480             /* Get the value from a foo(<param_value>) style call */
       
  6481             if (IN_param_value == NULL)
       
  6482               IN_param_value = function_call_param_iterator.next();
       
  6483             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6484             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6485             
       
  6486             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6487             {
       
  6488         
       
  6489                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  6490                 s4o.print("(");
       
  6491                 return_type_symbol->accept(*this);
       
  6492                 s4o.print(")real_to_time(");
       
  6493                 IN_param_value->accept(*this);
       
  6494                 s4o.print(")");
       
  6495                 return NULL;
       
  6496                 
       
  6497             }
       
  6498             
       
  6499             ERROR;
       
  6500         }
       
  6501         
       
  6502     }/*function_udint_to_tod*/
       
  6503     break;
       
  6504 
       
  6505 /****
       
  6506  *UDINT_TO_DT
       
  6507  */
       
  6508     case function_udint_to_dt :
       
  6509     {
       
  6510         symbol_c *last_type_symbol = NULL;
       
  6511 
       
  6512         {
       
  6513             identifier_c param_name("IN");
       
  6514             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6515             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6516             
       
  6517             /* Get the value from a foo(<param_value>) style call */
       
  6518             if (IN_param_value == NULL)
       
  6519               IN_param_value = function_call_param_iterator.next();
       
  6520             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6521             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6522             
       
  6523             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
  6524             {
       
  6525         
       
  6526                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  6527                 s4o.print("(");
       
  6528                 return_type_symbol->accept(*this);
       
  6529                 s4o.print(")real_to_time(");
       
  6530                 IN_param_value->accept(*this);
       
  6531                 s4o.print(")");
       
  6532                 return NULL;
       
  6533                 
       
  6534             }
       
  6535             
       
  6536             ERROR;
       
  6537         }
       
  6538         
       
  6539     }/*function_udint_to_dt*/
       
  6540     break;
       
  6541 
       
  6542 /****
       
  6543  *ULINT_TO_REAL
       
  6544  */
       
  6545     case function_ulint_to_real :
       
  6546     {
       
  6547         symbol_c *last_type_symbol = NULL;
       
  6548 
       
  6549         {
       
  6550             identifier_c param_name("IN");
       
  6551             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6552             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6553             
       
  6554             /* Get the value from a foo(<param_value>) style call */
       
  6555             if (IN_param_value == NULL)
       
  6556               IN_param_value = function_call_param_iterator.next();
       
  6557             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6558             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6559             
       
  6560             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6561             {
       
  6562         
       
  6563                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  6564                 s4o.print("(");
       
  6565                 return_type_symbol->accept(*this);
       
  6566                 s4o.print(")");
       
  6567                 IN_param_value->accept(*this);
       
  6568                 return NULL;
       
  6569                 
       
  6570             }
       
  6571             
       
  6572             ERROR;
       
  6573         }
       
  6574         
       
  6575     }/*function_ulint_to_real*/
       
  6576     break;
       
  6577 
       
  6578 /****
       
  6579  *ULINT_TO_LREAL
       
  6580  */
       
  6581     case function_ulint_to_lreal :
       
  6582     {
       
  6583         symbol_c *last_type_symbol = NULL;
       
  6584 
       
  6585         {
       
  6586             identifier_c param_name("IN");
       
  6587             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6588             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6589             
       
  6590             /* Get the value from a foo(<param_value>) style call */
       
  6591             if (IN_param_value == NULL)
       
  6592               IN_param_value = function_call_param_iterator.next();
       
  6593             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6594             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6595             
       
  6596             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6597             {
       
  6598         
       
  6599                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  6600                 s4o.print("(");
       
  6601                 return_type_symbol->accept(*this);
       
  6602                 s4o.print(")");
       
  6603                 IN_param_value->accept(*this);
       
  6604                 return NULL;
       
  6605                 
       
  6606             }
       
  6607             
       
  6608             ERROR;
       
  6609         }
       
  6610         
       
  6611     }/*function_ulint_to_lreal*/
       
  6612     break;
       
  6613 
       
  6614 /****
       
  6615  *ULINT_TO_SINT
       
  6616  */
       
  6617     case function_ulint_to_sint :
       
  6618     {
       
  6619         symbol_c *last_type_symbol = NULL;
       
  6620 
       
  6621         {
       
  6622             identifier_c param_name("IN");
       
  6623             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6624             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6625             
       
  6626             /* Get the value from a foo(<param_value>) style call */
       
  6627             if (IN_param_value == NULL)
       
  6628               IN_param_value = function_call_param_iterator.next();
       
  6629             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6630             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6631             
       
  6632             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6633             {
       
  6634         
       
  6635                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  6636                 s4o.print("(");
       
  6637                 return_type_symbol->accept(*this);
       
  6638                 s4o.print(")");
       
  6639                 IN_param_value->accept(*this);
       
  6640                 return NULL;
       
  6641                 
       
  6642             }
       
  6643             
       
  6644             ERROR;
       
  6645         }
       
  6646         
       
  6647     }/*function_ulint_to_sint*/
       
  6648     break;
       
  6649 
       
  6650 /****
       
  6651  *ULINT_TO_INT
       
  6652  */
       
  6653     case function_ulint_to_int :
       
  6654     {
       
  6655         symbol_c *last_type_symbol = NULL;
       
  6656 
       
  6657         {
       
  6658             identifier_c param_name("IN");
       
  6659             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6660             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6661             
       
  6662             /* Get the value from a foo(<param_value>) style call */
       
  6663             if (IN_param_value == NULL)
       
  6664               IN_param_value = function_call_param_iterator.next();
       
  6665             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6666             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6667             
       
  6668             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6669             {
       
  6670         
       
  6671                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  6672                 s4o.print("(");
       
  6673                 return_type_symbol->accept(*this);
       
  6674                 s4o.print(")");
       
  6675                 IN_param_value->accept(*this);
       
  6676                 return NULL;
       
  6677                 
       
  6678             }
       
  6679             
       
  6680             ERROR;
       
  6681         }
       
  6682         
       
  6683     }/*function_ulint_to_int*/
       
  6684     break;
       
  6685 
       
  6686 /****
       
  6687  *ULINT_TO_DINT
       
  6688  */
       
  6689     case function_ulint_to_dint :
       
  6690     {
       
  6691         symbol_c *last_type_symbol = NULL;
       
  6692 
       
  6693         {
       
  6694             identifier_c param_name("IN");
       
  6695             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6696             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6697             
       
  6698             /* Get the value from a foo(<param_value>) style call */
       
  6699             if (IN_param_value == NULL)
       
  6700               IN_param_value = function_call_param_iterator.next();
       
  6701             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6702             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6703             
       
  6704             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6705             {
       
  6706         
       
  6707                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  6708                 s4o.print("(");
       
  6709                 return_type_symbol->accept(*this);
       
  6710                 s4o.print(")");
       
  6711                 IN_param_value->accept(*this);
       
  6712                 return NULL;
       
  6713                 
       
  6714             }
       
  6715             
       
  6716             ERROR;
       
  6717         }
       
  6718         
       
  6719     }/*function_ulint_to_dint*/
       
  6720     break;
       
  6721 
       
  6722 /****
       
  6723  *ULINT_TO_LINT
       
  6724  */
       
  6725     case function_ulint_to_lint :
       
  6726     {
       
  6727         symbol_c *last_type_symbol = NULL;
       
  6728 
       
  6729         {
       
  6730             identifier_c param_name("IN");
       
  6731             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6732             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6733             
       
  6734             /* Get the value from a foo(<param_value>) style call */
       
  6735             if (IN_param_value == NULL)
       
  6736               IN_param_value = function_call_param_iterator.next();
       
  6737             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6738             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6739             
       
  6740             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6741             {
       
  6742         
       
  6743                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  6744                 s4o.print("(");
       
  6745                 return_type_symbol->accept(*this);
       
  6746                 s4o.print(")");
       
  6747                 IN_param_value->accept(*this);
       
  6748                 return NULL;
       
  6749                 
       
  6750             }
       
  6751             
       
  6752             ERROR;
       
  6753         }
       
  6754         
       
  6755     }/*function_ulint_to_lint*/
       
  6756     break;
       
  6757 
       
  6758 /****
       
  6759  *ULINT_TO_USINT
       
  6760  */
       
  6761     case function_ulint_to_usint :
       
  6762     {
       
  6763         symbol_c *last_type_symbol = NULL;
       
  6764 
       
  6765         {
       
  6766             identifier_c param_name("IN");
       
  6767             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6768             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6769             
       
  6770             /* Get the value from a foo(<param_value>) style call */
       
  6771             if (IN_param_value == NULL)
       
  6772               IN_param_value = function_call_param_iterator.next();
       
  6773             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6774             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6775             
       
  6776             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6777             {
       
  6778         
       
  6779                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  6780                 s4o.print("(");
       
  6781                 return_type_symbol->accept(*this);
       
  6782                 s4o.print(")");
       
  6783                 IN_param_value->accept(*this);
       
  6784                 return NULL;
       
  6785                 
       
  6786             }
       
  6787             
       
  6788             ERROR;
       
  6789         }
       
  6790         
       
  6791     }/*function_ulint_to_usint*/
       
  6792     break;
       
  6793 
       
  6794 /****
       
  6795  *ULINT_TO_UINT
       
  6796  */
       
  6797     case function_ulint_to_uint :
       
  6798     {
       
  6799         symbol_c *last_type_symbol = NULL;
       
  6800 
       
  6801         {
       
  6802             identifier_c param_name("IN");
       
  6803             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6804             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6805             
       
  6806             /* Get the value from a foo(<param_value>) style call */
       
  6807             if (IN_param_value == NULL)
       
  6808               IN_param_value = function_call_param_iterator.next();
       
  6809             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6810             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6811             
       
  6812             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6813             {
       
  6814         
       
  6815                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  6816                 s4o.print("(");
       
  6817                 return_type_symbol->accept(*this);
       
  6818                 s4o.print(")");
       
  6819                 IN_param_value->accept(*this);
       
  6820                 return NULL;
       
  6821                 
       
  6822             }
       
  6823             
       
  6824             ERROR;
       
  6825         }
       
  6826         
       
  6827     }/*function_ulint_to_uint*/
       
  6828     break;
       
  6829 
       
  6830 /****
       
  6831  *ULINT_TO_UDINT
       
  6832  */
       
  6833     case function_ulint_to_udint :
       
  6834     {
       
  6835         symbol_c *last_type_symbol = NULL;
       
  6836 
       
  6837         {
       
  6838             identifier_c param_name("IN");
       
  6839             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6840             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6841             
       
  6842             /* Get the value from a foo(<param_value>) style call */
       
  6843             if (IN_param_value == NULL)
       
  6844               IN_param_value = function_call_param_iterator.next();
       
  6845             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6846             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6847             
       
  6848             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6849             {
       
  6850         
       
  6851                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  6852                 s4o.print("(");
       
  6853                 return_type_symbol->accept(*this);
       
  6854                 s4o.print(")");
       
  6855                 IN_param_value->accept(*this);
       
  6856                 return NULL;
       
  6857                 
       
  6858             }
       
  6859             
       
  6860             ERROR;
       
  6861         }
       
  6862         
       
  6863     }/*function_ulint_to_udint*/
       
  6864     break;
       
  6865 
       
  6866 /****
       
  6867  *ULINT_TO_TIME
       
  6868  */
       
  6869     case function_ulint_to_time :
       
  6870     {
       
  6871         symbol_c *last_type_symbol = NULL;
       
  6872 
       
  6873         {
       
  6874             identifier_c param_name("IN");
       
  6875             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6876             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6877             
       
  6878             /* Get the value from a foo(<param_value>) style call */
       
  6879             if (IN_param_value == NULL)
       
  6880               IN_param_value = function_call_param_iterator.next();
       
  6881             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6882             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6883             
       
  6884             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6885             {
       
  6886         
       
  6887                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  6888                 s4o.print("(");
       
  6889                 return_type_symbol->accept(*this);
       
  6890                 s4o.print(")real_to_time(");
       
  6891                 IN_param_value->accept(*this);
       
  6892                 s4o.print(")");
       
  6893                 return NULL;
       
  6894                 
       
  6895             }
       
  6896             
       
  6897             ERROR;
       
  6898         }
       
  6899         
       
  6900     }/*function_ulint_to_time*/
       
  6901     break;
       
  6902 
       
  6903 /****
       
  6904  *ULINT_TO_BOOL
       
  6905  */
       
  6906     case function_ulint_to_bool :
       
  6907     {
       
  6908         symbol_c *last_type_symbol = NULL;
       
  6909 
       
  6910         {
       
  6911             identifier_c param_name("IN");
       
  6912             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6913             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6914             
       
  6915             /* Get the value from a foo(<param_value>) style call */
       
  6916             if (IN_param_value == NULL)
       
  6917               IN_param_value = function_call_param_iterator.next();
       
  6918             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6919             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6920             
       
  6921             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6922             {
       
  6923         
       
  6924                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  6925                 s4o.print("(");
       
  6926                 return_type_symbol->accept(*this);
       
  6927                 s4o.print(")");
       
  6928                 IN_param_value->accept(*this);
       
  6929                 return NULL;
       
  6930                 
       
  6931             }
       
  6932             
       
  6933             ERROR;
       
  6934         }
       
  6935         
       
  6936     }/*function_ulint_to_bool*/
       
  6937     break;
       
  6938 
       
  6939 /****
       
  6940  *ULINT_TO_BYTE
       
  6941  */
       
  6942     case function_ulint_to_byte :
       
  6943     {
       
  6944         symbol_c *last_type_symbol = NULL;
       
  6945 
       
  6946         {
       
  6947             identifier_c param_name("IN");
       
  6948             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6949             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6950             
       
  6951             /* Get the value from a foo(<param_value>) style call */
       
  6952             if (IN_param_value == NULL)
       
  6953               IN_param_value = function_call_param_iterator.next();
       
  6954             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6955             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6956             
       
  6957             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6958             {
       
  6959         
       
  6960                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  6961                 s4o.print("(");
       
  6962                 return_type_symbol->accept(*this);
       
  6963                 s4o.print(")");
       
  6964                 IN_param_value->accept(*this);
       
  6965                 return NULL;
       
  6966                 
       
  6967             }
       
  6968             
       
  6969             ERROR;
       
  6970         }
       
  6971         
       
  6972     }/*function_ulint_to_byte*/
       
  6973     break;
       
  6974 
       
  6975 /****
       
  6976  *ULINT_TO_WORD
       
  6977  */
       
  6978     case function_ulint_to_word :
       
  6979     {
       
  6980         symbol_c *last_type_symbol = NULL;
       
  6981 
       
  6982         {
       
  6983             identifier_c param_name("IN");
       
  6984             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  6985             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  6986             
       
  6987             /* Get the value from a foo(<param_value>) style call */
       
  6988             if (IN_param_value == NULL)
       
  6989               IN_param_value = function_call_param_iterator.next();
       
  6990             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  6991             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  6992             
       
  6993             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  6994             {
       
  6995         
       
  6996                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  6997                 s4o.print("(");
       
  6998                 return_type_symbol->accept(*this);
       
  6999                 s4o.print(")");
       
  7000                 IN_param_value->accept(*this);
       
  7001                 return NULL;
       
  7002                 
       
  7003             }
       
  7004             
       
  7005             ERROR;
       
  7006         }
       
  7007         
       
  7008     }/*function_ulint_to_word*/
       
  7009     break;
       
  7010 
       
  7011 /****
       
  7012  *ULINT_TO_DWORD
       
  7013  */
       
  7014     case function_ulint_to_dword :
       
  7015     {
       
  7016         symbol_c *last_type_symbol = NULL;
       
  7017 
       
  7018         {
       
  7019             identifier_c param_name("IN");
       
  7020             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7021             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7022             
       
  7023             /* Get the value from a foo(<param_value>) style call */
       
  7024             if (IN_param_value == NULL)
       
  7025               IN_param_value = function_call_param_iterator.next();
       
  7026             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7027             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7028             
       
  7029             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  7030             {
       
  7031         
       
  7032                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  7033                 s4o.print("(");
       
  7034                 return_type_symbol->accept(*this);
       
  7035                 s4o.print(")");
       
  7036                 IN_param_value->accept(*this);
       
  7037                 return NULL;
       
  7038                 
       
  7039             }
       
  7040             
       
  7041             ERROR;
       
  7042         }
       
  7043         
       
  7044     }/*function_ulint_to_dword*/
       
  7045     break;
       
  7046 
       
  7047 /****
       
  7048  *ULINT_TO_LWORD
       
  7049  */
       
  7050     case function_ulint_to_lword :
       
  7051     {
       
  7052         symbol_c *last_type_symbol = NULL;
       
  7053 
       
  7054         {
       
  7055             identifier_c param_name("IN");
       
  7056             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7057             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7058             
       
  7059             /* Get the value from a foo(<param_value>) style call */
       
  7060             if (IN_param_value == NULL)
       
  7061               IN_param_value = function_call_param_iterator.next();
       
  7062             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7063             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7064             
       
  7065             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  7066             {
       
  7067         
       
  7068                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  7069                 s4o.print("(");
       
  7070                 return_type_symbol->accept(*this);
       
  7071                 s4o.print(")");
       
  7072                 IN_param_value->accept(*this);
       
  7073                 return NULL;
       
  7074                 
       
  7075             }
       
  7076             
       
  7077             ERROR;
       
  7078         }
       
  7079         
       
  7080     }/*function_ulint_to_lword*/
       
  7081     break;
       
  7082 
       
  7083 /****
       
  7084  *ULINT_TO_STRING
       
  7085  */
       
  7086     case function_ulint_to_string :
       
  7087     {
       
  7088         symbol_c *last_type_symbol = NULL;
       
  7089 
       
  7090         {
       
  7091             identifier_c param_name("IN");
       
  7092             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7093             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7094             
       
  7095             /* Get the value from a foo(<param_value>) style call */
       
  7096             if (IN_param_value == NULL)
       
  7097               IN_param_value = function_call_param_iterator.next();
       
  7098             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7099             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7100             
       
  7101             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  7102             {
       
  7103         
       
  7104                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  7105                 s4o.print("(");
       
  7106                 return_type_symbol->accept(*this);
       
  7107                 s4o.print(")int_to_string(");
       
  7108                 IN_param_value->accept(*this);
       
  7109                 s4o.print(", 10)");
       
  7110                 return NULL;
       
  7111                 
       
  7112             }
       
  7113             
       
  7114             ERROR;
       
  7115         }
       
  7116         
       
  7117     }/*function_ulint_to_string*/
       
  7118     break;
       
  7119 
       
  7120 /****
       
  7121  *ULINT_TO_WSTRING
       
  7122  */
       
  7123     case function_ulint_to_wstring :
       
  7124     {
       
  7125         symbol_c *last_type_symbol = NULL;
       
  7126 
       
  7127         {
       
  7128             identifier_c param_name("IN");
       
  7129             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7130             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7131             
       
  7132             /* Get the value from a foo(<param_value>) style call */
       
  7133             if (IN_param_value == NULL)
       
  7134               IN_param_value = function_call_param_iterator.next();
       
  7135             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7136             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7137             
       
  7138             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  7139             {
       
  7140         
       
  7141                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
  7142                 s4o.print("(");
       
  7143                 return_type_symbol->accept(*this);
       
  7144                 s4o.print(")int_to_string(");
       
  7145                 IN_param_value->accept(*this);
       
  7146                 s4o.print(", 10)");
       
  7147                 return NULL;
       
  7148                 
       
  7149             }
       
  7150             
       
  7151             ERROR;
       
  7152         }
       
  7153         
       
  7154     }/*function_ulint_to_wstring*/
       
  7155     break;
       
  7156 
       
  7157 /****
       
  7158  *ULINT_TO_DATE
       
  7159  */
       
  7160     case function_ulint_to_date :
       
  7161     {
       
  7162         symbol_c *last_type_symbol = NULL;
       
  7163 
       
  7164         {
       
  7165             identifier_c param_name("IN");
       
  7166             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7167             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7168             
       
  7169             /* Get the value from a foo(<param_value>) style call */
       
  7170             if (IN_param_value == NULL)
       
  7171               IN_param_value = function_call_param_iterator.next();
       
  7172             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7173             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7174             
       
  7175             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  7176             {
       
  7177         
       
  7178                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  7179                 s4o.print("(");
       
  7180                 return_type_symbol->accept(*this);
       
  7181                 s4o.print(")real_to_time(");
       
  7182                 IN_param_value->accept(*this);
       
  7183                 s4o.print(")");
       
  7184                 return NULL;
       
  7185                 
       
  7186             }
       
  7187             
       
  7188             ERROR;
       
  7189         }
       
  7190         
       
  7191     }/*function_ulint_to_date*/
       
  7192     break;
       
  7193 
       
  7194 /****
       
  7195  *ULINT_TO_TOD
       
  7196  */
       
  7197     case function_ulint_to_tod :
       
  7198     {
       
  7199         symbol_c *last_type_symbol = NULL;
       
  7200 
       
  7201         {
       
  7202             identifier_c param_name("IN");
       
  7203             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7204             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7205             
       
  7206             /* Get the value from a foo(<param_value>) style call */
       
  7207             if (IN_param_value == NULL)
       
  7208               IN_param_value = function_call_param_iterator.next();
       
  7209             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7210             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7211             
       
  7212             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  7213             {
       
  7214         
       
  7215                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  7216                 s4o.print("(");
       
  7217                 return_type_symbol->accept(*this);
       
  7218                 s4o.print(")real_to_time(");
       
  7219                 IN_param_value->accept(*this);
       
  7220                 s4o.print(")");
       
  7221                 return NULL;
       
  7222                 
       
  7223             }
       
  7224             
       
  7225             ERROR;
       
  7226         }
       
  7227         
       
  7228     }/*function_ulint_to_tod*/
       
  7229     break;
       
  7230 
       
  7231 /****
       
  7232  *ULINT_TO_DT
       
  7233  */
       
  7234     case function_ulint_to_dt :
       
  7235     {
       
  7236         symbol_c *last_type_symbol = NULL;
       
  7237 
       
  7238         {
       
  7239             identifier_c param_name("IN");
       
  7240             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7241             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7242             
       
  7243             /* Get the value from a foo(<param_value>) style call */
       
  7244             if (IN_param_value == NULL)
       
  7245               IN_param_value = function_call_param_iterator.next();
       
  7246             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7247             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7248             
       
  7249             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
  7250             {
       
  7251         
       
  7252                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  7253                 s4o.print("(");
       
  7254                 return_type_symbol->accept(*this);
       
  7255                 s4o.print(")real_to_time(");
       
  7256                 IN_param_value->accept(*this);
       
  7257                 s4o.print(")");
       
  7258                 return NULL;
       
  7259                 
       
  7260             }
       
  7261             
       
  7262             ERROR;
       
  7263         }
       
  7264         
       
  7265     }/*function_ulint_to_dt*/
       
  7266     break;
       
  7267 
       
  7268 /****
       
  7269  *TIME_TO_REAL
       
  7270  */
       
  7271     case function_time_to_real :
       
  7272     {
       
  7273         symbol_c *last_type_symbol = NULL;
       
  7274 
       
  7275         {
       
  7276             identifier_c param_name("IN");
       
  7277             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7278             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7279             
       
  7280             /* Get the value from a foo(<param_value>) style call */
       
  7281             if (IN_param_value == NULL)
       
  7282               IN_param_value = function_call_param_iterator.next();
       
  7283             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7284             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7285             
       
  7286             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7287             {
       
  7288         
       
  7289                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  7290                 s4o.print("(");
       
  7291                 return_type_symbol->accept(*this);
       
  7292                 s4o.print(")time_to_real(");
       
  7293                 IN_param_value->accept(*this);
       
  7294                 s4o.print(")");
       
  7295                 return NULL;
       
  7296                 
       
  7297             }
       
  7298             
       
  7299             ERROR;
       
  7300         }
       
  7301         
       
  7302     }/*function_time_to_real*/
       
  7303     break;
       
  7304 
       
  7305 /****
       
  7306  *TIME_TO_LREAL
       
  7307  */
       
  7308     case function_time_to_lreal :
       
  7309     {
       
  7310         symbol_c *last_type_symbol = NULL;
       
  7311 
       
  7312         {
       
  7313             identifier_c param_name("IN");
       
  7314             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7315             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7316             
       
  7317             /* Get the value from a foo(<param_value>) style call */
       
  7318             if (IN_param_value == NULL)
       
  7319               IN_param_value = function_call_param_iterator.next();
       
  7320             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7321             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7322             
       
  7323             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7324             {
       
  7325         
       
  7326                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  7327                 s4o.print("(");
       
  7328                 return_type_symbol->accept(*this);
       
  7329                 s4o.print(")time_to_real(");
       
  7330                 IN_param_value->accept(*this);
       
  7331                 s4o.print(")");
       
  7332                 return NULL;
       
  7333                 
       
  7334             }
       
  7335             
       
  7336             ERROR;
       
  7337         }
       
  7338         
       
  7339     }/*function_time_to_lreal*/
       
  7340     break;
       
  7341 
       
  7342 /****
       
  7343  *TIME_TO_SINT
       
  7344  */
       
  7345     case function_time_to_sint :
       
  7346     {
       
  7347         symbol_c *last_type_symbol = NULL;
       
  7348 
       
  7349         {
       
  7350             identifier_c param_name("IN");
       
  7351             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7352             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7353             
       
  7354             /* Get the value from a foo(<param_value>) style call */
       
  7355             if (IN_param_value == NULL)
       
  7356               IN_param_value = function_call_param_iterator.next();
       
  7357             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7358             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7359             
       
  7360             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7361             {
       
  7362         
       
  7363                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  7364                 s4o.print("(");
       
  7365                 return_type_symbol->accept(*this);
       
  7366                 s4o.print(")time_to_real(");
       
  7367                 IN_param_value->accept(*this);
       
  7368                 s4o.print(")");
       
  7369                 return NULL;
       
  7370                 
       
  7371             }
       
  7372             
       
  7373             ERROR;
       
  7374         }
       
  7375         
       
  7376     }/*function_time_to_sint*/
       
  7377     break;
       
  7378 
       
  7379 /****
       
  7380  *TIME_TO_INT
       
  7381  */
       
  7382     case function_time_to_int :
       
  7383     {
       
  7384         symbol_c *last_type_symbol = NULL;
       
  7385 
       
  7386         {
       
  7387             identifier_c param_name("IN");
       
  7388             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7389             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7390             
       
  7391             /* Get the value from a foo(<param_value>) style call */
       
  7392             if (IN_param_value == NULL)
       
  7393               IN_param_value = function_call_param_iterator.next();
       
  7394             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7395             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7396             
       
  7397             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7398             {
       
  7399         
       
  7400                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  7401                 s4o.print("(");
       
  7402                 return_type_symbol->accept(*this);
       
  7403                 s4o.print(")time_to_real(");
       
  7404                 IN_param_value->accept(*this);
       
  7405                 s4o.print(")");
       
  7406                 return NULL;
       
  7407                 
       
  7408             }
       
  7409             
       
  7410             ERROR;
       
  7411         }
       
  7412         
       
  7413     }/*function_time_to_int*/
       
  7414     break;
       
  7415 
       
  7416 /****
       
  7417  *TIME_TO_DINT
       
  7418  */
       
  7419     case function_time_to_dint :
       
  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 (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7435             {
       
  7436         
       
  7437                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  7438                 s4o.print("(");
       
  7439                 return_type_symbol->accept(*this);
       
  7440                 s4o.print(")time_to_real(");
       
  7441                 IN_param_value->accept(*this);
       
  7442                 s4o.print(")");
       
  7443                 return NULL;
       
  7444                 
       
  7445             }
       
  7446             
       
  7447             ERROR;
       
  7448         }
       
  7449         
       
  7450     }/*function_time_to_dint*/
       
  7451     break;
       
  7452 
       
  7453 /****
       
  7454  *TIME_TO_LINT
       
  7455  */
       
  7456     case function_time_to_lint :
       
  7457     {
       
  7458         symbol_c *last_type_symbol = NULL;
       
  7459 
       
  7460         {
       
  7461             identifier_c param_name("IN");
       
  7462             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7463             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7464             
       
  7465             /* Get the value from a foo(<param_value>) style call */
       
  7466             if (IN_param_value == NULL)
       
  7467               IN_param_value = function_call_param_iterator.next();
       
  7468             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7469             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7470             
       
  7471             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7472             {
       
  7473         
       
  7474                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  7475                 s4o.print("(");
       
  7476                 return_type_symbol->accept(*this);
       
  7477                 s4o.print(")time_to_real(");
       
  7478                 IN_param_value->accept(*this);
       
  7479                 s4o.print(")");
       
  7480                 return NULL;
       
  7481                 
       
  7482             }
       
  7483             
       
  7484             ERROR;
       
  7485         }
       
  7486         
       
  7487     }/*function_time_to_lint*/
       
  7488     break;
       
  7489 
       
  7490 /****
       
  7491  *TIME_TO_USINT
       
  7492  */
       
  7493     case function_time_to_usint :
       
  7494     {
       
  7495         symbol_c *last_type_symbol = NULL;
       
  7496 
       
  7497         {
       
  7498             identifier_c param_name("IN");
       
  7499             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7500             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7501             
       
  7502             /* Get the value from a foo(<param_value>) style call */
       
  7503             if (IN_param_value == NULL)
       
  7504               IN_param_value = function_call_param_iterator.next();
       
  7505             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7506             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7507             
       
  7508             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7509             {
       
  7510         
       
  7511                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  7512                 s4o.print("(");
       
  7513                 return_type_symbol->accept(*this);
       
  7514                 s4o.print(")time_to_real(");
       
  7515                 IN_param_value->accept(*this);
       
  7516                 s4o.print(")");
       
  7517                 return NULL;
       
  7518                 
       
  7519             }
       
  7520             
       
  7521             ERROR;
       
  7522         }
       
  7523         
       
  7524     }/*function_time_to_usint*/
       
  7525     break;
       
  7526 
       
  7527 /****
       
  7528  *TIME_TO_UINT
       
  7529  */
       
  7530     case function_time_to_uint :
       
  7531     {
       
  7532         symbol_c *last_type_symbol = NULL;
       
  7533 
       
  7534         {
       
  7535             identifier_c param_name("IN");
       
  7536             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7537             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7538             
       
  7539             /* Get the value from a foo(<param_value>) style call */
       
  7540             if (IN_param_value == NULL)
       
  7541               IN_param_value = function_call_param_iterator.next();
       
  7542             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7543             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7544             
       
  7545             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7546             {
       
  7547         
       
  7548                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  7549                 s4o.print("(");
       
  7550                 return_type_symbol->accept(*this);
       
  7551                 s4o.print(")time_to_real(");
       
  7552                 IN_param_value->accept(*this);
       
  7553                 s4o.print(")");
       
  7554                 return NULL;
       
  7555                 
       
  7556             }
       
  7557             
       
  7558             ERROR;
       
  7559         }
       
  7560         
       
  7561     }/*function_time_to_uint*/
       
  7562     break;
       
  7563 
       
  7564 /****
       
  7565  *TIME_TO_UDINT
       
  7566  */
       
  7567     case function_time_to_udint :
       
  7568     {
       
  7569         symbol_c *last_type_symbol = NULL;
       
  7570 
       
  7571         {
       
  7572             identifier_c param_name("IN");
       
  7573             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7574             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7575             
       
  7576             /* Get the value from a foo(<param_value>) style call */
       
  7577             if (IN_param_value == NULL)
       
  7578               IN_param_value = function_call_param_iterator.next();
       
  7579             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7580             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7581             
       
  7582             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7583             {
       
  7584         
       
  7585                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  7586                 s4o.print("(");
       
  7587                 return_type_symbol->accept(*this);
       
  7588                 s4o.print(")time_to_real(");
       
  7589                 IN_param_value->accept(*this);
       
  7590                 s4o.print(")");
       
  7591                 return NULL;
       
  7592                 
       
  7593             }
       
  7594             
       
  7595             ERROR;
       
  7596         }
       
  7597         
       
  7598     }/*function_time_to_udint*/
       
  7599     break;
       
  7600 
       
  7601 /****
       
  7602  *TIME_TO_ULINT
       
  7603  */
       
  7604     case function_time_to_ulint :
       
  7605     {
       
  7606         symbol_c *last_type_symbol = NULL;
       
  7607 
       
  7608         {
       
  7609             identifier_c param_name("IN");
       
  7610             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7611             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7612             
       
  7613             /* Get the value from a foo(<param_value>) style call */
       
  7614             if (IN_param_value == NULL)
       
  7615               IN_param_value = function_call_param_iterator.next();
       
  7616             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7617             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7618             
       
  7619             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7620             {
       
  7621         
       
  7622                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  7623                 s4o.print("(");
       
  7624                 return_type_symbol->accept(*this);
       
  7625                 s4o.print(")time_to_real(");
       
  7626                 IN_param_value->accept(*this);
       
  7627                 s4o.print(")");
       
  7628                 return NULL;
       
  7629                 
       
  7630             }
       
  7631             
       
  7632             ERROR;
       
  7633         }
       
  7634         
       
  7635     }/*function_time_to_ulint*/
       
  7636     break;
       
  7637 
       
  7638 /****
       
  7639  *TIME_TO_BOOL
       
  7640  */
       
  7641     case function_time_to_bool :
       
  7642     {
       
  7643         symbol_c *last_type_symbol = NULL;
       
  7644 
       
  7645         {
       
  7646             identifier_c param_name("IN");
       
  7647             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7648             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7649             
       
  7650             /* Get the value from a foo(<param_value>) style call */
       
  7651             if (IN_param_value == NULL)
       
  7652               IN_param_value = function_call_param_iterator.next();
       
  7653             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7654             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7655             
       
  7656             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7657             {
       
  7658         
       
  7659                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  7660                 s4o.print("(");
       
  7661                 return_type_symbol->accept(*this);
       
  7662                 s4o.print(")time_to_real(");
       
  7663                 IN_param_value->accept(*this);
       
  7664                 s4o.print(")");
       
  7665                 return NULL;
       
  7666                 
       
  7667             }
       
  7668             
       
  7669             ERROR;
       
  7670         }
       
  7671         
       
  7672     }/*function_time_to_bool*/
       
  7673     break;
       
  7674 
       
  7675 /****
       
  7676  *TIME_TO_BYTE
       
  7677  */
       
  7678     case function_time_to_byte :
       
  7679     {
       
  7680         symbol_c *last_type_symbol = NULL;
       
  7681 
       
  7682         {
       
  7683             identifier_c param_name("IN");
       
  7684             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7685             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7686             
       
  7687             /* Get the value from a foo(<param_value>) style call */
       
  7688             if (IN_param_value == NULL)
       
  7689               IN_param_value = function_call_param_iterator.next();
       
  7690             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7691             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7692             
       
  7693             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7694             {
       
  7695         
       
  7696                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  7697                 s4o.print("(");
       
  7698                 return_type_symbol->accept(*this);
       
  7699                 s4o.print(")time_to_real(");
       
  7700                 IN_param_value->accept(*this);
       
  7701                 s4o.print(")");
       
  7702                 return NULL;
       
  7703                 
       
  7704             }
       
  7705             
       
  7706             ERROR;
       
  7707         }
       
  7708         
       
  7709     }/*function_time_to_byte*/
       
  7710     break;
       
  7711 
       
  7712 /****
       
  7713  *TIME_TO_WORD
       
  7714  */
       
  7715     case function_time_to_word :
       
  7716     {
       
  7717         symbol_c *last_type_symbol = NULL;
       
  7718 
       
  7719         {
       
  7720             identifier_c param_name("IN");
       
  7721             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7722             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7723             
       
  7724             /* Get the value from a foo(<param_value>) style call */
       
  7725             if (IN_param_value == NULL)
       
  7726               IN_param_value = function_call_param_iterator.next();
       
  7727             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7728             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7729             
       
  7730             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7731             {
       
  7732         
       
  7733                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  7734                 s4o.print("(");
       
  7735                 return_type_symbol->accept(*this);
       
  7736                 s4o.print(")time_to_real(");
       
  7737                 IN_param_value->accept(*this);
       
  7738                 s4o.print(")");
       
  7739                 return NULL;
       
  7740                 
       
  7741             }
       
  7742             
       
  7743             ERROR;
       
  7744         }
       
  7745         
       
  7746     }/*function_time_to_word*/
       
  7747     break;
       
  7748 
       
  7749 /****
       
  7750  *TIME_TO_DWORD
       
  7751  */
       
  7752     case function_time_to_dword :
       
  7753     {
       
  7754         symbol_c *last_type_symbol = NULL;
       
  7755 
       
  7756         {
       
  7757             identifier_c param_name("IN");
       
  7758             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7759             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7760             
       
  7761             /* Get the value from a foo(<param_value>) style call */
       
  7762             if (IN_param_value == NULL)
       
  7763               IN_param_value = function_call_param_iterator.next();
       
  7764             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7765             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7766             
       
  7767             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7768             {
       
  7769         
       
  7770                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  7771                 s4o.print("(");
       
  7772                 return_type_symbol->accept(*this);
       
  7773                 s4o.print(")time_to_real(");
       
  7774                 IN_param_value->accept(*this);
       
  7775                 s4o.print(")");
       
  7776                 return NULL;
       
  7777                 
       
  7778             }
       
  7779             
       
  7780             ERROR;
       
  7781         }
       
  7782         
       
  7783     }/*function_time_to_dword*/
       
  7784     break;
       
  7785 
       
  7786 /****
       
  7787  *TIME_TO_LWORD
       
  7788  */
       
  7789     case function_time_to_lword :
       
  7790     {
       
  7791         symbol_c *last_type_symbol = NULL;
       
  7792 
       
  7793         {
       
  7794             identifier_c param_name("IN");
       
  7795             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7796             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7797             
       
  7798             /* Get the value from a foo(<param_value>) style call */
       
  7799             if (IN_param_value == NULL)
       
  7800               IN_param_value = function_call_param_iterator.next();
       
  7801             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7802             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7803             
       
  7804             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7805             {
       
  7806         
       
  7807                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  7808                 s4o.print("(");
       
  7809                 return_type_symbol->accept(*this);
       
  7810                 s4o.print(")time_to_real(");
       
  7811                 IN_param_value->accept(*this);
       
  7812                 s4o.print(")");
       
  7813                 return NULL;
       
  7814                 
       
  7815             }
       
  7816             
       
  7817             ERROR;
       
  7818         }
       
  7819         
       
  7820     }/*function_time_to_lword*/
       
  7821     break;
       
  7822 
       
  7823 /****
       
  7824  *TIME_TO_STRING
       
  7825  */
       
  7826     case function_time_to_string :
       
  7827     {
       
  7828         symbol_c *last_type_symbol = NULL;
       
  7829 
       
  7830         {
       
  7831             identifier_c param_name("IN");
       
  7832             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7833             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7834             
       
  7835             /* Get the value from a foo(<param_value>) style call */
       
  7836             if (IN_param_value == NULL)
       
  7837               IN_param_value = function_call_param_iterator.next();
       
  7838             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7839             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7840             
       
  7841             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7842             {
       
  7843         
       
  7844                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  7845                 s4o.print("(");
       
  7846                 return_type_symbol->accept(*this);
       
  7847                 s4o.print(")time_to_string(");
       
  7848                 IN_param_value->accept(*this);
       
  7849                 s4o.print(")");
       
  7850                 return NULL;
       
  7851                 
       
  7852             }
       
  7853             
       
  7854             ERROR;
       
  7855         }
       
  7856         
       
  7857     }/*function_time_to_string*/
       
  7858     break;
       
  7859 
       
  7860 /****
       
  7861  *TIME_TO_WSTRING
       
  7862  */
       
  7863     case function_time_to_wstring :
       
  7864     {
       
  7865         symbol_c *last_type_symbol = NULL;
       
  7866 
       
  7867         {
       
  7868             identifier_c param_name("IN");
       
  7869             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7870             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7871             
       
  7872             /* Get the value from a foo(<param_value>) style call */
       
  7873             if (IN_param_value == NULL)
       
  7874               IN_param_value = function_call_param_iterator.next();
       
  7875             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7876             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7877             
       
  7878             if (typeid(*last_type_symbol) == typeid(time_type_name_c))
       
  7879             {
       
  7880         
       
  7881                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
  7882                 s4o.print("(");
       
  7883                 return_type_symbol->accept(*this);
       
  7884                 s4o.print(")time_to_string(");
       
  7885                 IN_param_value->accept(*this);
       
  7886                 s4o.print(")");
       
  7887                 return NULL;
       
  7888                 
       
  7889             }
       
  7890             
       
  7891             ERROR;
       
  7892         }
       
  7893         
       
  7894     }/*function_time_to_wstring*/
       
  7895     break;
       
  7896 
       
  7897 /****
       
  7898  *BOOL_TO_REAL
       
  7899  */
       
  7900     case function_bool_to_real :
       
  7901     {
       
  7902         symbol_c *last_type_symbol = NULL;
       
  7903 
       
  7904         {
       
  7905             identifier_c param_name("IN");
       
  7906             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7907             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7908             
       
  7909             /* Get the value from a foo(<param_value>) style call */
       
  7910             if (IN_param_value == NULL)
       
  7911               IN_param_value = function_call_param_iterator.next();
       
  7912             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7913             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7914             
       
  7915             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7916             {
       
  7917         
       
  7918                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  7919                 s4o.print("(");
       
  7920                 return_type_symbol->accept(*this);
       
  7921                 s4o.print(")");
       
  7922                 IN_param_value->accept(*this);
       
  7923                 return NULL;
       
  7924                 
       
  7925             }
       
  7926             
       
  7927             ERROR;
       
  7928         }
       
  7929         
       
  7930     }/*function_bool_to_real*/
       
  7931     break;
       
  7932 
       
  7933 /****
       
  7934  *BOOL_TO_LREAL
       
  7935  */
       
  7936     case function_bool_to_lreal :
       
  7937     {
       
  7938         symbol_c *last_type_symbol = NULL;
       
  7939 
       
  7940         {
       
  7941             identifier_c param_name("IN");
       
  7942             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7943             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7944             
       
  7945             /* Get the value from a foo(<param_value>) style call */
       
  7946             if (IN_param_value == NULL)
       
  7947               IN_param_value = function_call_param_iterator.next();
       
  7948             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7949             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7950             
       
  7951             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7952             {
       
  7953         
       
  7954                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  7955                 s4o.print("(");
       
  7956                 return_type_symbol->accept(*this);
       
  7957                 s4o.print(")");
       
  7958                 IN_param_value->accept(*this);
       
  7959                 return NULL;
       
  7960                 
       
  7961             }
       
  7962             
       
  7963             ERROR;
       
  7964         }
       
  7965         
       
  7966     }/*function_bool_to_lreal*/
       
  7967     break;
       
  7968 
       
  7969 /****
       
  7970  *BOOL_TO_SINT
       
  7971  */
       
  7972     case function_bool_to_sint :
       
  7973     {
       
  7974         symbol_c *last_type_symbol = NULL;
       
  7975 
       
  7976         {
       
  7977             identifier_c param_name("IN");
       
  7978             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  7979             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  7980             
       
  7981             /* Get the value from a foo(<param_value>) style call */
       
  7982             if (IN_param_value == NULL)
       
  7983               IN_param_value = function_call_param_iterator.next();
       
  7984             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  7985             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  7986             
       
  7987             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  7988             {
       
  7989         
       
  7990                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  7991                 s4o.print("(");
       
  7992                 return_type_symbol->accept(*this);
       
  7993                 s4o.print(")");
       
  7994                 IN_param_value->accept(*this);
       
  7995                 return NULL;
       
  7996                 
       
  7997             }
       
  7998             
       
  7999             ERROR;
       
  8000         }
       
  8001         
       
  8002     }/*function_bool_to_sint*/
       
  8003     break;
       
  8004 
       
  8005 /****
       
  8006  *BOOL_TO_INT
       
  8007  */
       
  8008     case function_bool_to_int :
       
  8009     {
       
  8010         symbol_c *last_type_symbol = NULL;
       
  8011 
       
  8012         {
       
  8013             identifier_c param_name("IN");
       
  8014             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8015             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8016             
       
  8017             /* Get the value from a foo(<param_value>) style call */
       
  8018             if (IN_param_value == NULL)
       
  8019               IN_param_value = function_call_param_iterator.next();
       
  8020             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8021             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8022             
       
  8023             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8024             {
       
  8025         
       
  8026                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  8027                 s4o.print("(");
       
  8028                 return_type_symbol->accept(*this);
       
  8029                 s4o.print(")");
       
  8030                 IN_param_value->accept(*this);
       
  8031                 return NULL;
       
  8032                 
       
  8033             }
       
  8034             
       
  8035             ERROR;
       
  8036         }
       
  8037         
       
  8038     }/*function_bool_to_int*/
       
  8039     break;
       
  8040 
       
  8041 /****
       
  8042  *BOOL_TO_DINT
       
  8043  */
       
  8044     case function_bool_to_dint :
       
  8045     {
       
  8046         symbol_c *last_type_symbol = NULL;
       
  8047 
       
  8048         {
       
  8049             identifier_c param_name("IN");
       
  8050             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8051             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8052             
       
  8053             /* Get the value from a foo(<param_value>) style call */
       
  8054             if (IN_param_value == NULL)
       
  8055               IN_param_value = function_call_param_iterator.next();
       
  8056             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8057             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8058             
       
  8059             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8060             {
       
  8061         
       
  8062                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  8063                 s4o.print("(");
       
  8064                 return_type_symbol->accept(*this);
       
  8065                 s4o.print(")");
       
  8066                 IN_param_value->accept(*this);
       
  8067                 return NULL;
       
  8068                 
       
  8069             }
       
  8070             
       
  8071             ERROR;
       
  8072         }
       
  8073         
       
  8074     }/*function_bool_to_dint*/
       
  8075     break;
       
  8076 
       
  8077 /****
       
  8078  *BOOL_TO_LINT
       
  8079  */
       
  8080     case function_bool_to_lint :
       
  8081     {
       
  8082         symbol_c *last_type_symbol = NULL;
       
  8083 
       
  8084         {
       
  8085             identifier_c param_name("IN");
       
  8086             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8087             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8088             
       
  8089             /* Get the value from a foo(<param_value>) style call */
       
  8090             if (IN_param_value == NULL)
       
  8091               IN_param_value = function_call_param_iterator.next();
       
  8092             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8093             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8094             
       
  8095             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8096             {
       
  8097         
       
  8098                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  8099                 s4o.print("(");
       
  8100                 return_type_symbol->accept(*this);
       
  8101                 s4o.print(")");
       
  8102                 IN_param_value->accept(*this);
       
  8103                 return NULL;
       
  8104                 
       
  8105             }
       
  8106             
       
  8107             ERROR;
       
  8108         }
       
  8109         
       
  8110     }/*function_bool_to_lint*/
       
  8111     break;
       
  8112 
       
  8113 /****
       
  8114  *BOOL_TO_USINT
       
  8115  */
       
  8116     case function_bool_to_usint :
       
  8117     {
       
  8118         symbol_c *last_type_symbol = NULL;
       
  8119 
       
  8120         {
       
  8121             identifier_c param_name("IN");
       
  8122             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8123             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8124             
       
  8125             /* Get the value from a foo(<param_value>) style call */
       
  8126             if (IN_param_value == NULL)
       
  8127               IN_param_value = function_call_param_iterator.next();
       
  8128             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8129             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8130             
       
  8131             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8132             {
       
  8133         
       
  8134                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  8135                 s4o.print("(");
       
  8136                 return_type_symbol->accept(*this);
       
  8137                 s4o.print(")");
       
  8138                 IN_param_value->accept(*this);
       
  8139                 return NULL;
       
  8140                 
       
  8141             }
       
  8142             
       
  8143             ERROR;
       
  8144         }
       
  8145         
       
  8146     }/*function_bool_to_usint*/
       
  8147     break;
       
  8148 
       
  8149 /****
       
  8150  *BOOL_TO_UINT
       
  8151  */
       
  8152     case function_bool_to_uint :
       
  8153     {
       
  8154         symbol_c *last_type_symbol = NULL;
       
  8155 
       
  8156         {
       
  8157             identifier_c param_name("IN");
       
  8158             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8159             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8160             
       
  8161             /* Get the value from a foo(<param_value>) style call */
       
  8162             if (IN_param_value == NULL)
       
  8163               IN_param_value = function_call_param_iterator.next();
       
  8164             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8165             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8166             
       
  8167             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8168             {
       
  8169         
       
  8170                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  8171                 s4o.print("(");
       
  8172                 return_type_symbol->accept(*this);
       
  8173                 s4o.print(")");
       
  8174                 IN_param_value->accept(*this);
       
  8175                 return NULL;
       
  8176                 
       
  8177             }
       
  8178             
       
  8179             ERROR;
       
  8180         }
       
  8181         
       
  8182     }/*function_bool_to_uint*/
       
  8183     break;
       
  8184 
       
  8185 /****
       
  8186  *BOOL_TO_UDINT
       
  8187  */
       
  8188     case function_bool_to_udint :
       
  8189     {
       
  8190         symbol_c *last_type_symbol = NULL;
       
  8191 
       
  8192         {
       
  8193             identifier_c param_name("IN");
       
  8194             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8195             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8196             
       
  8197             /* Get the value from a foo(<param_value>) style call */
       
  8198             if (IN_param_value == NULL)
       
  8199               IN_param_value = function_call_param_iterator.next();
       
  8200             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8201             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8202             
       
  8203             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8204             {
       
  8205         
       
  8206                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  8207                 s4o.print("(");
       
  8208                 return_type_symbol->accept(*this);
       
  8209                 s4o.print(")");
       
  8210                 IN_param_value->accept(*this);
       
  8211                 return NULL;
       
  8212                 
       
  8213             }
       
  8214             
       
  8215             ERROR;
       
  8216         }
       
  8217         
       
  8218     }/*function_bool_to_udint*/
       
  8219     break;
       
  8220 
       
  8221 /****
       
  8222  *BOOL_TO_ULINT
       
  8223  */
       
  8224     case function_bool_to_ulint :
       
  8225     {
       
  8226         symbol_c *last_type_symbol = NULL;
       
  8227 
       
  8228         {
       
  8229             identifier_c param_name("IN");
       
  8230             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8231             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8232             
       
  8233             /* Get the value from a foo(<param_value>) style call */
       
  8234             if (IN_param_value == NULL)
       
  8235               IN_param_value = function_call_param_iterator.next();
       
  8236             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8237             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8238             
       
  8239             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8240             {
       
  8241         
       
  8242                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  8243                 s4o.print("(");
       
  8244                 return_type_symbol->accept(*this);
       
  8245                 s4o.print(")");
       
  8246                 IN_param_value->accept(*this);
       
  8247                 return NULL;
       
  8248                 
       
  8249             }
       
  8250             
       
  8251             ERROR;
       
  8252         }
       
  8253         
       
  8254     }/*function_bool_to_ulint*/
       
  8255     break;
       
  8256 
       
  8257 /****
       
  8258  *BOOL_TO_TIME
       
  8259  */
       
  8260     case function_bool_to_time :
       
  8261     {
       
  8262         symbol_c *last_type_symbol = NULL;
       
  8263 
       
  8264         {
       
  8265             identifier_c param_name("IN");
       
  8266             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8267             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8268             
       
  8269             /* Get the value from a foo(<param_value>) style call */
       
  8270             if (IN_param_value == NULL)
       
  8271               IN_param_value = function_call_param_iterator.next();
       
  8272             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8273             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8274             
       
  8275             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8276             {
       
  8277         
       
  8278                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  8279                 s4o.print("(");
       
  8280                 return_type_symbol->accept(*this);
       
  8281                 s4o.print(")real_to_time(");
       
  8282                 IN_param_value->accept(*this);
       
  8283                 s4o.print(")");
       
  8284                 return NULL;
       
  8285                 
       
  8286             }
       
  8287             
       
  8288             ERROR;
       
  8289         }
       
  8290         
       
  8291     }/*function_bool_to_time*/
       
  8292     break;
       
  8293 
       
  8294 /****
       
  8295  *BOOL_TO_BYTE
       
  8296  */
       
  8297     case function_bool_to_byte :
       
  8298     {
       
  8299         symbol_c *last_type_symbol = NULL;
       
  8300 
       
  8301         {
       
  8302             identifier_c param_name("IN");
       
  8303             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8304             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8305             
       
  8306             /* Get the value from a foo(<param_value>) style call */
       
  8307             if (IN_param_value == NULL)
       
  8308               IN_param_value = function_call_param_iterator.next();
       
  8309             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8310             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8311             
       
  8312             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8313             {
       
  8314         
       
  8315                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  8316                 s4o.print("(");
       
  8317                 return_type_symbol->accept(*this);
       
  8318                 s4o.print(")");
       
  8319                 IN_param_value->accept(*this);
       
  8320                 return NULL;
       
  8321                 
       
  8322             }
       
  8323             
       
  8324             ERROR;
       
  8325         }
       
  8326         
       
  8327     }/*function_bool_to_byte*/
       
  8328     break;
       
  8329 
       
  8330 /****
       
  8331  *BOOL_TO_WORD
       
  8332  */
       
  8333     case function_bool_to_word :
       
  8334     {
       
  8335         symbol_c *last_type_symbol = NULL;
       
  8336 
       
  8337         {
       
  8338             identifier_c param_name("IN");
       
  8339             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8340             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8341             
       
  8342             /* Get the value from a foo(<param_value>) style call */
       
  8343             if (IN_param_value == NULL)
       
  8344               IN_param_value = function_call_param_iterator.next();
       
  8345             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8346             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8347             
       
  8348             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8349             {
       
  8350         
       
  8351                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  8352                 s4o.print("(");
       
  8353                 return_type_symbol->accept(*this);
       
  8354                 s4o.print(")");
       
  8355                 IN_param_value->accept(*this);
       
  8356                 return NULL;
       
  8357                 
       
  8358             }
       
  8359             
       
  8360             ERROR;
       
  8361         }
       
  8362         
       
  8363     }/*function_bool_to_word*/
       
  8364     break;
       
  8365 
       
  8366 /****
       
  8367  *BOOL_TO_DWORD
       
  8368  */
       
  8369     case function_bool_to_dword :
       
  8370     {
       
  8371         symbol_c *last_type_symbol = NULL;
       
  8372 
       
  8373         {
       
  8374             identifier_c param_name("IN");
       
  8375             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8376             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8377             
       
  8378             /* Get the value from a foo(<param_value>) style call */
       
  8379             if (IN_param_value == NULL)
       
  8380               IN_param_value = function_call_param_iterator.next();
       
  8381             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8382             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8383             
       
  8384             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8385             {
       
  8386         
       
  8387                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  8388                 s4o.print("(");
       
  8389                 return_type_symbol->accept(*this);
       
  8390                 s4o.print(")");
       
  8391                 IN_param_value->accept(*this);
       
  8392                 return NULL;
       
  8393                 
       
  8394             }
       
  8395             
       
  8396             ERROR;
       
  8397         }
       
  8398         
       
  8399     }/*function_bool_to_dword*/
       
  8400     break;
       
  8401 
       
  8402 /****
       
  8403  *BOOL_TO_LWORD
       
  8404  */
       
  8405     case function_bool_to_lword :
       
  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 (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8421             {
       
  8422         
       
  8423                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  8424                 s4o.print("(");
       
  8425                 return_type_symbol->accept(*this);
       
  8426                 s4o.print(")");
       
  8427                 IN_param_value->accept(*this);
       
  8428                 return NULL;
       
  8429                 
       
  8430             }
       
  8431             
       
  8432             ERROR;
       
  8433         }
       
  8434         
       
  8435     }/*function_bool_to_lword*/
       
  8436     break;
       
  8437 
       
  8438 /****
       
  8439  *BOOL_TO_STRING
       
  8440  */
       
  8441     case function_bool_to_string :
       
  8442     {
       
  8443         symbol_c *last_type_symbol = NULL;
       
  8444 
       
  8445         {
       
  8446             identifier_c param_name("IN");
       
  8447             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8448             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8449             
       
  8450             /* Get the value from a foo(<param_value>) style call */
       
  8451             if (IN_param_value == NULL)
       
  8452               IN_param_value = function_call_param_iterator.next();
       
  8453             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8454             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8455             
       
  8456             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8457             {
       
  8458         
       
  8459                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  8460                 s4o.print("(");
       
  8461                 return_type_symbol->accept(*this);
       
  8462                 s4o.print(")int_to_string(");
       
  8463                 IN_param_value->accept(*this);
       
  8464                 s4o.print(", 16)");
       
  8465                 return NULL;
       
  8466                 
       
  8467             }
       
  8468             
       
  8469             ERROR;
       
  8470         }
       
  8471         
       
  8472     }/*function_bool_to_string*/
       
  8473     break;
       
  8474 
       
  8475 /****
       
  8476  *BOOL_TO_WSTRING
       
  8477  */
       
  8478     case function_bool_to_wstring :
       
  8479     {
       
  8480         symbol_c *last_type_symbol = NULL;
       
  8481 
       
  8482         {
       
  8483             identifier_c param_name("IN");
       
  8484             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8485             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8486             
       
  8487             /* Get the value from a foo(<param_value>) style call */
       
  8488             if (IN_param_value == NULL)
       
  8489               IN_param_value = function_call_param_iterator.next();
       
  8490             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8491             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8492             
       
  8493             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8494             {
       
  8495         
       
  8496                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
  8497                 s4o.print("(");
       
  8498                 return_type_symbol->accept(*this);
       
  8499                 s4o.print(")int_to_string(");
       
  8500                 IN_param_value->accept(*this);
       
  8501                 s4o.print(", 16)");
       
  8502                 return NULL;
       
  8503                 
       
  8504             }
       
  8505             
       
  8506             ERROR;
       
  8507         }
       
  8508         
       
  8509     }/*function_bool_to_wstring*/
       
  8510     break;
       
  8511 
       
  8512 /****
       
  8513  *BOOL_TO_DATE
       
  8514  */
       
  8515     case function_bool_to_date :
       
  8516     {
       
  8517         symbol_c *last_type_symbol = NULL;
       
  8518 
       
  8519         {
       
  8520             identifier_c param_name("IN");
       
  8521             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8522             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8523             
       
  8524             /* Get the value from a foo(<param_value>) style call */
       
  8525             if (IN_param_value == NULL)
       
  8526               IN_param_value = function_call_param_iterator.next();
       
  8527             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8528             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8529             
       
  8530             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8531             {
       
  8532         
       
  8533                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  8534                 s4o.print("(");
       
  8535                 return_type_symbol->accept(*this);
       
  8536                 s4o.print(")real_to_time(");
       
  8537                 IN_param_value->accept(*this);
       
  8538                 s4o.print(")");
       
  8539                 return NULL;
       
  8540                 
       
  8541             }
       
  8542             
       
  8543             ERROR;
       
  8544         }
       
  8545         
       
  8546     }/*function_bool_to_date*/
       
  8547     break;
       
  8548 
       
  8549 /****
       
  8550  *BOOL_TO_TOD
       
  8551  */
       
  8552     case function_bool_to_tod :
       
  8553     {
       
  8554         symbol_c *last_type_symbol = NULL;
       
  8555 
       
  8556         {
       
  8557             identifier_c param_name("IN");
       
  8558             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8559             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8560             
       
  8561             /* Get the value from a foo(<param_value>) style call */
       
  8562             if (IN_param_value == NULL)
       
  8563               IN_param_value = function_call_param_iterator.next();
       
  8564             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8565             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8566             
       
  8567             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8568             {
       
  8569         
       
  8570                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  8571                 s4o.print("(");
       
  8572                 return_type_symbol->accept(*this);
       
  8573                 s4o.print(")real_to_time(");
       
  8574                 IN_param_value->accept(*this);
       
  8575                 s4o.print(")");
       
  8576                 return NULL;
       
  8577                 
       
  8578             }
       
  8579             
       
  8580             ERROR;
       
  8581         }
       
  8582         
       
  8583     }/*function_bool_to_tod*/
       
  8584     break;
       
  8585 
       
  8586 /****
       
  8587  *BOOL_TO_DT
       
  8588  */
       
  8589     case function_bool_to_dt :
       
  8590     {
       
  8591         symbol_c *last_type_symbol = NULL;
       
  8592 
       
  8593         {
       
  8594             identifier_c param_name("IN");
       
  8595             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8596             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8597             
       
  8598             /* Get the value from a foo(<param_value>) style call */
       
  8599             if (IN_param_value == NULL)
       
  8600               IN_param_value = function_call_param_iterator.next();
       
  8601             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8602             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8603             
       
  8604             if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
       
  8605             {
       
  8606         
       
  8607                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  8608                 s4o.print("(");
       
  8609                 return_type_symbol->accept(*this);
       
  8610                 s4o.print(")real_to_time(");
       
  8611                 IN_param_value->accept(*this);
       
  8612                 s4o.print(")");
       
  8613                 return NULL;
       
  8614                 
       
  8615             }
       
  8616             
       
  8617             ERROR;
       
  8618         }
       
  8619         
       
  8620     }/*function_bool_to_dt*/
       
  8621     break;
       
  8622 
       
  8623 /****
       
  8624  *BYTE_TO_REAL
       
  8625  */
       
  8626     case function_byte_to_real :
       
  8627     {
       
  8628         symbol_c *last_type_symbol = NULL;
       
  8629 
       
  8630         {
       
  8631             identifier_c param_name("IN");
       
  8632             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8633             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8634             
       
  8635             /* Get the value from a foo(<param_value>) style call */
       
  8636             if (IN_param_value == NULL)
       
  8637               IN_param_value = function_call_param_iterator.next();
       
  8638             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8639             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8640             
       
  8641             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8642             {
       
  8643         
       
  8644                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  8645                 s4o.print("(");
       
  8646                 return_type_symbol->accept(*this);
       
  8647                 s4o.print(")");
       
  8648                 IN_param_value->accept(*this);
       
  8649                 return NULL;
       
  8650                 
       
  8651             }
       
  8652             
       
  8653             ERROR;
       
  8654         }
       
  8655         
       
  8656     }/*function_byte_to_real*/
       
  8657     break;
       
  8658 
       
  8659 /****
       
  8660  *BYTE_TO_LREAL
       
  8661  */
       
  8662     case function_byte_to_lreal :
       
  8663     {
       
  8664         symbol_c *last_type_symbol = NULL;
       
  8665 
       
  8666         {
       
  8667             identifier_c param_name("IN");
       
  8668             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8669             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8670             
       
  8671             /* Get the value from a foo(<param_value>) style call */
       
  8672             if (IN_param_value == NULL)
       
  8673               IN_param_value = function_call_param_iterator.next();
       
  8674             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8675             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8676             
       
  8677             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8678             {
       
  8679         
       
  8680                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  8681                 s4o.print("(");
       
  8682                 return_type_symbol->accept(*this);
       
  8683                 s4o.print(")");
       
  8684                 IN_param_value->accept(*this);
       
  8685                 return NULL;
       
  8686                 
       
  8687             }
       
  8688             
       
  8689             ERROR;
       
  8690         }
       
  8691         
       
  8692     }/*function_byte_to_lreal*/
       
  8693     break;
       
  8694 
       
  8695 /****
       
  8696  *BYTE_TO_SINT
       
  8697  */
       
  8698     case function_byte_to_sint :
       
  8699     {
       
  8700         symbol_c *last_type_symbol = NULL;
       
  8701 
       
  8702         {
       
  8703             identifier_c param_name("IN");
       
  8704             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8705             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8706             
       
  8707             /* Get the value from a foo(<param_value>) style call */
       
  8708             if (IN_param_value == NULL)
       
  8709               IN_param_value = function_call_param_iterator.next();
       
  8710             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8711             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8712             
       
  8713             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8714             {
       
  8715         
       
  8716                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  8717                 s4o.print("(");
       
  8718                 return_type_symbol->accept(*this);
       
  8719                 s4o.print(")");
       
  8720                 IN_param_value->accept(*this);
       
  8721                 return NULL;
       
  8722                 
       
  8723             }
       
  8724             
       
  8725             ERROR;
       
  8726         }
       
  8727         
       
  8728     }/*function_byte_to_sint*/
       
  8729     break;
       
  8730 
       
  8731 /****
       
  8732  *BYTE_TO_INT
       
  8733  */
       
  8734     case function_byte_to_int :
       
  8735     {
       
  8736         symbol_c *last_type_symbol = NULL;
       
  8737 
       
  8738         {
       
  8739             identifier_c param_name("IN");
       
  8740             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8741             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8742             
       
  8743             /* Get the value from a foo(<param_value>) style call */
       
  8744             if (IN_param_value == NULL)
       
  8745               IN_param_value = function_call_param_iterator.next();
       
  8746             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8747             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8748             
       
  8749             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8750             {
       
  8751         
       
  8752                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  8753                 s4o.print("(");
       
  8754                 return_type_symbol->accept(*this);
       
  8755                 s4o.print(")");
       
  8756                 IN_param_value->accept(*this);
       
  8757                 return NULL;
       
  8758                 
       
  8759             }
       
  8760             
       
  8761             ERROR;
       
  8762         }
       
  8763         
       
  8764     }/*function_byte_to_int*/
       
  8765     break;
       
  8766 
       
  8767 /****
       
  8768  *BYTE_TO_DINT
       
  8769  */
       
  8770     case function_byte_to_dint :
       
  8771     {
       
  8772         symbol_c *last_type_symbol = NULL;
       
  8773 
       
  8774         {
       
  8775             identifier_c param_name("IN");
       
  8776             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8777             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8778             
       
  8779             /* Get the value from a foo(<param_value>) style call */
       
  8780             if (IN_param_value == NULL)
       
  8781               IN_param_value = function_call_param_iterator.next();
       
  8782             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8783             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8784             
       
  8785             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8786             {
       
  8787         
       
  8788                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  8789                 s4o.print("(");
       
  8790                 return_type_symbol->accept(*this);
       
  8791                 s4o.print(")");
       
  8792                 IN_param_value->accept(*this);
       
  8793                 return NULL;
       
  8794                 
       
  8795             }
       
  8796             
       
  8797             ERROR;
       
  8798         }
       
  8799         
       
  8800     }/*function_byte_to_dint*/
       
  8801     break;
       
  8802 
       
  8803 /****
       
  8804  *BYTE_TO_LINT
       
  8805  */
       
  8806     case function_byte_to_lint :
       
  8807     {
       
  8808         symbol_c *last_type_symbol = NULL;
       
  8809 
       
  8810         {
       
  8811             identifier_c param_name("IN");
       
  8812             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8813             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8814             
       
  8815             /* Get the value from a foo(<param_value>) style call */
       
  8816             if (IN_param_value == NULL)
       
  8817               IN_param_value = function_call_param_iterator.next();
       
  8818             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8819             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8820             
       
  8821             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8822             {
       
  8823         
       
  8824                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  8825                 s4o.print("(");
       
  8826                 return_type_symbol->accept(*this);
       
  8827                 s4o.print(")");
       
  8828                 IN_param_value->accept(*this);
       
  8829                 return NULL;
       
  8830                 
       
  8831             }
       
  8832             
       
  8833             ERROR;
       
  8834         }
       
  8835         
       
  8836     }/*function_byte_to_lint*/
       
  8837     break;
       
  8838 
       
  8839 /****
       
  8840  *BYTE_TO_USINT
       
  8841  */
       
  8842     case function_byte_to_usint :
       
  8843     {
       
  8844         symbol_c *last_type_symbol = NULL;
       
  8845 
       
  8846         {
       
  8847             identifier_c param_name("IN");
       
  8848             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8849             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8850             
       
  8851             /* Get the value from a foo(<param_value>) style call */
       
  8852             if (IN_param_value == NULL)
       
  8853               IN_param_value = function_call_param_iterator.next();
       
  8854             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8855             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8856             
       
  8857             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8858             {
       
  8859         
       
  8860                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  8861                 s4o.print("(");
       
  8862                 return_type_symbol->accept(*this);
       
  8863                 s4o.print(")");
       
  8864                 IN_param_value->accept(*this);
       
  8865                 return NULL;
       
  8866                 
       
  8867             }
       
  8868             
       
  8869             ERROR;
       
  8870         }
       
  8871         
       
  8872     }/*function_byte_to_usint*/
       
  8873     break;
       
  8874 
       
  8875 /****
       
  8876  *BYTE_TO_UINT
       
  8877  */
       
  8878     case function_byte_to_uint :
       
  8879     {
       
  8880         symbol_c *last_type_symbol = NULL;
       
  8881 
       
  8882         {
       
  8883             identifier_c param_name("IN");
       
  8884             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8885             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8886             
       
  8887             /* Get the value from a foo(<param_value>) style call */
       
  8888             if (IN_param_value == NULL)
       
  8889               IN_param_value = function_call_param_iterator.next();
       
  8890             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8891             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8892             
       
  8893             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8894             {
       
  8895         
       
  8896                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  8897                 s4o.print("(");
       
  8898                 return_type_symbol->accept(*this);
       
  8899                 s4o.print(")");
       
  8900                 IN_param_value->accept(*this);
       
  8901                 return NULL;
       
  8902                 
       
  8903             }
       
  8904             
       
  8905             ERROR;
       
  8906         }
       
  8907         
       
  8908     }/*function_byte_to_uint*/
       
  8909     break;
       
  8910 
       
  8911 /****
       
  8912  *BYTE_TO_UDINT
       
  8913  */
       
  8914     case function_byte_to_udint :
       
  8915     {
       
  8916         symbol_c *last_type_symbol = NULL;
       
  8917 
       
  8918         {
       
  8919             identifier_c param_name("IN");
       
  8920             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8921             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8922             
       
  8923             /* Get the value from a foo(<param_value>) style call */
       
  8924             if (IN_param_value == NULL)
       
  8925               IN_param_value = function_call_param_iterator.next();
       
  8926             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8927             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8928             
       
  8929             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8930             {
       
  8931         
       
  8932                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  8933                 s4o.print("(");
       
  8934                 return_type_symbol->accept(*this);
       
  8935                 s4o.print(")");
       
  8936                 IN_param_value->accept(*this);
       
  8937                 return NULL;
       
  8938                 
       
  8939             }
       
  8940             
       
  8941             ERROR;
       
  8942         }
       
  8943         
       
  8944     }/*function_byte_to_udint*/
       
  8945     break;
       
  8946 
       
  8947 /****
       
  8948  *BYTE_TO_ULINT
       
  8949  */
       
  8950     case function_byte_to_ulint :
       
  8951     {
       
  8952         symbol_c *last_type_symbol = NULL;
       
  8953 
       
  8954         {
       
  8955             identifier_c param_name("IN");
       
  8956             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8957             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8958             
       
  8959             /* Get the value from a foo(<param_value>) style call */
       
  8960             if (IN_param_value == NULL)
       
  8961               IN_param_value = function_call_param_iterator.next();
       
  8962             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8963             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  8964             
       
  8965             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  8966             {
       
  8967         
       
  8968                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  8969                 s4o.print("(");
       
  8970                 return_type_symbol->accept(*this);
       
  8971                 s4o.print(")");
       
  8972                 IN_param_value->accept(*this);
       
  8973                 return NULL;
       
  8974                 
       
  8975             }
       
  8976             
       
  8977             ERROR;
       
  8978         }
       
  8979         
       
  8980     }/*function_byte_to_ulint*/
       
  8981     break;
       
  8982 
       
  8983 /****
       
  8984  *BYTE_TO_TIME
       
  8985  */
       
  8986     case function_byte_to_time :
       
  8987     {
       
  8988         symbol_c *last_type_symbol = NULL;
       
  8989 
       
  8990         {
       
  8991             identifier_c param_name("IN");
       
  8992             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  8993             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  8994             
       
  8995             /* Get the value from a foo(<param_value>) style call */
       
  8996             if (IN_param_value == NULL)
       
  8997               IN_param_value = function_call_param_iterator.next();
       
  8998             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  8999             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9000             
       
  9001             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  9002             {
       
  9003         
       
  9004                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  9005                 s4o.print("(");
       
  9006                 return_type_symbol->accept(*this);
       
  9007                 s4o.print(")real_to_time(");
       
  9008                 IN_param_value->accept(*this);
       
  9009                 s4o.print(")");
       
  9010                 return NULL;
       
  9011                 
       
  9012             }
       
  9013             
       
  9014             ERROR;
       
  9015         }
       
  9016         
       
  9017     }/*function_byte_to_time*/
       
  9018     break;
       
  9019 
       
  9020 /****
       
  9021  *BYTE_TO_BOOL
       
  9022  */
       
  9023     case function_byte_to_bool :
       
  9024     {
       
  9025         symbol_c *last_type_symbol = NULL;
       
  9026 
       
  9027         {
       
  9028             identifier_c param_name("IN");
       
  9029             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9030             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9031             
       
  9032             /* Get the value from a foo(<param_value>) style call */
       
  9033             if (IN_param_value == NULL)
       
  9034               IN_param_value = function_call_param_iterator.next();
       
  9035             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9036             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9037             
       
  9038             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  9039             {
       
  9040         
       
  9041                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  9042                 s4o.print("(");
       
  9043                 return_type_symbol->accept(*this);
       
  9044                 s4o.print(")");
       
  9045                 IN_param_value->accept(*this);
       
  9046                 return NULL;
       
  9047                 
       
  9048             }
       
  9049             
       
  9050             ERROR;
       
  9051         }
       
  9052         
       
  9053     }/*function_byte_to_bool*/
       
  9054     break;
       
  9055 
       
  9056 /****
       
  9057  *BYTE_TO_WORD
       
  9058  */
       
  9059     case function_byte_to_word :
       
  9060     {
       
  9061         symbol_c *last_type_symbol = NULL;
       
  9062 
       
  9063         {
       
  9064             identifier_c param_name("IN");
       
  9065             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9066             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9067             
       
  9068             /* Get the value from a foo(<param_value>) style call */
       
  9069             if (IN_param_value == NULL)
       
  9070               IN_param_value = function_call_param_iterator.next();
       
  9071             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9072             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9073             
       
  9074             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  9075             {
       
  9076         
       
  9077                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
  9078                 s4o.print("(");
       
  9079                 return_type_symbol->accept(*this);
       
  9080                 s4o.print(")");
       
  9081                 IN_param_value->accept(*this);
       
  9082                 return NULL;
       
  9083                 
       
  9084             }
       
  9085             
       
  9086             ERROR;
       
  9087         }
       
  9088         
       
  9089     }/*function_byte_to_word*/
       
  9090     break;
       
  9091 
       
  9092 /****
       
  9093  *BYTE_TO_DWORD
       
  9094  */
       
  9095     case function_byte_to_dword :
       
  9096     {
       
  9097         symbol_c *last_type_symbol = NULL;
       
  9098 
       
  9099         {
       
  9100             identifier_c param_name("IN");
       
  9101             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9102             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9103             
       
  9104             /* Get the value from a foo(<param_value>) style call */
       
  9105             if (IN_param_value == NULL)
       
  9106               IN_param_value = function_call_param_iterator.next();
       
  9107             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9108             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9109             
       
  9110             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  9111             {
       
  9112         
       
  9113                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  9114                 s4o.print("(");
       
  9115                 return_type_symbol->accept(*this);
       
  9116                 s4o.print(")");
       
  9117                 IN_param_value->accept(*this);
       
  9118                 return NULL;
       
  9119                 
       
  9120             }
       
  9121             
       
  9122             ERROR;
       
  9123         }
       
  9124         
       
  9125     }/*function_byte_to_dword*/
       
  9126     break;
       
  9127 
       
  9128 /****
       
  9129  *BYTE_TO_LWORD
       
  9130  */
       
  9131     case function_byte_to_lword :
       
  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 (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  9147             {
       
  9148         
       
  9149                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  9150                 s4o.print("(");
       
  9151                 return_type_symbol->accept(*this);
       
  9152                 s4o.print(")");
       
  9153                 IN_param_value->accept(*this);
       
  9154                 return NULL;
       
  9155                 
       
  9156             }
       
  9157             
       
  9158             ERROR;
       
  9159         }
       
  9160         
       
  9161     }/*function_byte_to_lword*/
       
  9162     break;
       
  9163 
       
  9164 /****
       
  9165  *BYTE_TO_STRING
       
  9166  */
       
  9167     case function_byte_to_string :
       
  9168     {
       
  9169         symbol_c *last_type_symbol = NULL;
       
  9170 
       
  9171         {
       
  9172             identifier_c param_name("IN");
       
  9173             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9174             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9175             
       
  9176             /* Get the value from a foo(<param_value>) style call */
       
  9177             if (IN_param_value == NULL)
       
  9178               IN_param_value = function_call_param_iterator.next();
       
  9179             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9180             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9181             
       
  9182             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  9183             {
       
  9184         
       
  9185                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  9186                 s4o.print("(");
       
  9187                 return_type_symbol->accept(*this);
       
  9188                 s4o.print(")int_to_string(");
       
  9189                 IN_param_value->accept(*this);
       
  9190                 s4o.print(", 16)");
       
  9191                 return NULL;
       
  9192                 
       
  9193             }
       
  9194             
       
  9195             ERROR;
       
  9196         }
       
  9197         
       
  9198     }/*function_byte_to_string*/
       
  9199     break;
       
  9200 
       
  9201 /****
       
  9202  *BYTE_TO_WSTRING
       
  9203  */
       
  9204     case function_byte_to_wstring :
       
  9205     {
       
  9206         symbol_c *last_type_symbol = NULL;
       
  9207 
       
  9208         {
       
  9209             identifier_c param_name("IN");
       
  9210             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9211             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9212             
       
  9213             /* Get the value from a foo(<param_value>) style call */
       
  9214             if (IN_param_value == NULL)
       
  9215               IN_param_value = function_call_param_iterator.next();
       
  9216             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9217             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9218             
       
  9219             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  9220             {
       
  9221         
       
  9222                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
  9223                 s4o.print("(");
       
  9224                 return_type_symbol->accept(*this);
       
  9225                 s4o.print(")int_to_string(");
       
  9226                 IN_param_value->accept(*this);
       
  9227                 s4o.print(", 16)");
       
  9228                 return NULL;
       
  9229                 
       
  9230             }
       
  9231             
       
  9232             ERROR;
       
  9233         }
       
  9234         
       
  9235     }/*function_byte_to_wstring*/
       
  9236     break;
       
  9237 
       
  9238 /****
       
  9239  *BYTE_TO_DATE
       
  9240  */
       
  9241     case function_byte_to_date :
       
  9242     {
       
  9243         symbol_c *last_type_symbol = NULL;
       
  9244 
       
  9245         {
       
  9246             identifier_c param_name("IN");
       
  9247             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9248             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9249             
       
  9250             /* Get the value from a foo(<param_value>) style call */
       
  9251             if (IN_param_value == NULL)
       
  9252               IN_param_value = function_call_param_iterator.next();
       
  9253             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9254             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9255             
       
  9256             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  9257             {
       
  9258         
       
  9259                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  9260                 s4o.print("(");
       
  9261                 return_type_symbol->accept(*this);
       
  9262                 s4o.print(")real_to_time(");
       
  9263                 IN_param_value->accept(*this);
       
  9264                 s4o.print(")");
       
  9265                 return NULL;
       
  9266                 
       
  9267             }
       
  9268             
       
  9269             ERROR;
       
  9270         }
       
  9271         
       
  9272     }/*function_byte_to_date*/
       
  9273     break;
       
  9274 
       
  9275 /****
       
  9276  *BYTE_TO_TOD
       
  9277  */
       
  9278     case function_byte_to_tod :
       
  9279     {
       
  9280         symbol_c *last_type_symbol = NULL;
       
  9281 
       
  9282         {
       
  9283             identifier_c param_name("IN");
       
  9284             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9285             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9286             
       
  9287             /* Get the value from a foo(<param_value>) style call */
       
  9288             if (IN_param_value == NULL)
       
  9289               IN_param_value = function_call_param_iterator.next();
       
  9290             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9291             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9292             
       
  9293             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  9294             {
       
  9295         
       
  9296                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
  9297                 s4o.print("(");
       
  9298                 return_type_symbol->accept(*this);
       
  9299                 s4o.print(")real_to_time(");
       
  9300                 IN_param_value->accept(*this);
       
  9301                 s4o.print(")");
       
  9302                 return NULL;
       
  9303                 
       
  9304             }
       
  9305             
       
  9306             ERROR;
       
  9307         }
       
  9308         
       
  9309     }/*function_byte_to_tod*/
       
  9310     break;
       
  9311 
       
  9312 /****
       
  9313  *BYTE_TO_DT
       
  9314  */
       
  9315     case function_byte_to_dt :
       
  9316     {
       
  9317         symbol_c *last_type_symbol = NULL;
       
  9318 
       
  9319         {
       
  9320             identifier_c param_name("IN");
       
  9321             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9322             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9323             
       
  9324             /* Get the value from a foo(<param_value>) style call */
       
  9325             if (IN_param_value == NULL)
       
  9326               IN_param_value = function_call_param_iterator.next();
       
  9327             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9328             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9329             
       
  9330             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
       
  9331             {
       
  9332         
       
  9333                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
  9334                 s4o.print("(");
       
  9335                 return_type_symbol->accept(*this);
       
  9336                 s4o.print(")real_to_time(");
       
  9337                 IN_param_value->accept(*this);
       
  9338                 s4o.print(")");
       
  9339                 return NULL;
       
  9340                 
       
  9341             }
       
  9342             
       
  9343             ERROR;
       
  9344         }
       
  9345         
       
  9346     }/*function_byte_to_dt*/
       
  9347     break;
       
  9348 
       
  9349 /****
       
  9350  *WORD_TO_REAL
       
  9351  */
       
  9352     case function_word_to_real :
       
  9353     {
       
  9354         symbol_c *last_type_symbol = NULL;
       
  9355 
       
  9356         {
       
  9357             identifier_c param_name("IN");
       
  9358             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9359             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9360             
       
  9361             /* Get the value from a foo(<param_value>) style call */
       
  9362             if (IN_param_value == NULL)
       
  9363               IN_param_value = function_call_param_iterator.next();
       
  9364             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9365             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9366             
       
  9367             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9368             {
       
  9369         
       
  9370                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
  9371                 s4o.print("(");
       
  9372                 return_type_symbol->accept(*this);
       
  9373                 s4o.print(")");
       
  9374                 IN_param_value->accept(*this);
       
  9375                 return NULL;
       
  9376                 
       
  9377             }
       
  9378             
       
  9379             ERROR;
       
  9380         }
       
  9381         
       
  9382     }/*function_word_to_real*/
       
  9383     break;
       
  9384 
       
  9385 /****
       
  9386  *WORD_TO_LREAL
       
  9387  */
       
  9388     case function_word_to_lreal :
       
  9389     {
       
  9390         symbol_c *last_type_symbol = NULL;
       
  9391 
       
  9392         {
       
  9393             identifier_c param_name("IN");
       
  9394             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9395             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9396             
       
  9397             /* Get the value from a foo(<param_value>) style call */
       
  9398             if (IN_param_value == NULL)
       
  9399               IN_param_value = function_call_param_iterator.next();
       
  9400             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9401             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9402             
       
  9403             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9404             {
       
  9405         
       
  9406                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
  9407                 s4o.print("(");
       
  9408                 return_type_symbol->accept(*this);
       
  9409                 s4o.print(")");
       
  9410                 IN_param_value->accept(*this);
       
  9411                 return NULL;
       
  9412                 
       
  9413             }
       
  9414             
       
  9415             ERROR;
       
  9416         }
       
  9417         
       
  9418     }/*function_word_to_lreal*/
       
  9419     break;
       
  9420 
       
  9421 /****
       
  9422  *WORD_TO_SINT
       
  9423  */
       
  9424     case function_word_to_sint :
       
  9425     {
       
  9426         symbol_c *last_type_symbol = NULL;
       
  9427 
       
  9428         {
       
  9429             identifier_c param_name("IN");
       
  9430             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9431             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9432             
       
  9433             /* Get the value from a foo(<param_value>) style call */
       
  9434             if (IN_param_value == NULL)
       
  9435               IN_param_value = function_call_param_iterator.next();
       
  9436             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9437             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9438             
       
  9439             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9440             {
       
  9441         
       
  9442                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
  9443                 s4o.print("(");
       
  9444                 return_type_symbol->accept(*this);
       
  9445                 s4o.print(")");
       
  9446                 IN_param_value->accept(*this);
       
  9447                 return NULL;
       
  9448                 
       
  9449             }
       
  9450             
       
  9451             ERROR;
       
  9452         }
       
  9453         
       
  9454     }/*function_word_to_sint*/
       
  9455     break;
       
  9456 
       
  9457 /****
       
  9458  *WORD_TO_INT
       
  9459  */
       
  9460     case function_word_to_int :
       
  9461     {
       
  9462         symbol_c *last_type_symbol = NULL;
       
  9463 
       
  9464         {
       
  9465             identifier_c param_name("IN");
       
  9466             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9467             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9468             
       
  9469             /* Get the value from a foo(<param_value>) style call */
       
  9470             if (IN_param_value == NULL)
       
  9471               IN_param_value = function_call_param_iterator.next();
       
  9472             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9473             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9474             
       
  9475             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9476             {
       
  9477         
       
  9478                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
  9479                 s4o.print("(");
       
  9480                 return_type_symbol->accept(*this);
       
  9481                 s4o.print(")");
       
  9482                 IN_param_value->accept(*this);
       
  9483                 return NULL;
       
  9484                 
       
  9485             }
       
  9486             
       
  9487             ERROR;
       
  9488         }
       
  9489         
       
  9490     }/*function_word_to_int*/
       
  9491     break;
       
  9492 
       
  9493 /****
       
  9494  *WORD_TO_DINT
       
  9495  */
       
  9496     case function_word_to_dint :
       
  9497     {
       
  9498         symbol_c *last_type_symbol = NULL;
       
  9499 
       
  9500         {
       
  9501             identifier_c param_name("IN");
       
  9502             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9503             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9504             
       
  9505             /* Get the value from a foo(<param_value>) style call */
       
  9506             if (IN_param_value == NULL)
       
  9507               IN_param_value = function_call_param_iterator.next();
       
  9508             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9509             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9510             
       
  9511             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9512             {
       
  9513         
       
  9514                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
  9515                 s4o.print("(");
       
  9516                 return_type_symbol->accept(*this);
       
  9517                 s4o.print(")");
       
  9518                 IN_param_value->accept(*this);
       
  9519                 return NULL;
       
  9520                 
       
  9521             }
       
  9522             
       
  9523             ERROR;
       
  9524         }
       
  9525         
       
  9526     }/*function_word_to_dint*/
       
  9527     break;
       
  9528 
       
  9529 /****
       
  9530  *WORD_TO_LINT
       
  9531  */
       
  9532     case function_word_to_lint :
       
  9533     {
       
  9534         symbol_c *last_type_symbol = NULL;
       
  9535 
       
  9536         {
       
  9537             identifier_c param_name("IN");
       
  9538             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9539             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9540             
       
  9541             /* Get the value from a foo(<param_value>) style call */
       
  9542             if (IN_param_value == NULL)
       
  9543               IN_param_value = function_call_param_iterator.next();
       
  9544             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9545             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9546             
       
  9547             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9548             {
       
  9549         
       
  9550                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
  9551                 s4o.print("(");
       
  9552                 return_type_symbol->accept(*this);
       
  9553                 s4o.print(")");
       
  9554                 IN_param_value->accept(*this);
       
  9555                 return NULL;
       
  9556                 
       
  9557             }
       
  9558             
       
  9559             ERROR;
       
  9560         }
       
  9561         
       
  9562     }/*function_word_to_lint*/
       
  9563     break;
       
  9564 
       
  9565 /****
       
  9566  *WORD_TO_USINT
       
  9567  */
       
  9568     case function_word_to_usint :
       
  9569     {
       
  9570         symbol_c *last_type_symbol = NULL;
       
  9571 
       
  9572         {
       
  9573             identifier_c param_name("IN");
       
  9574             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9575             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9576             
       
  9577             /* Get the value from a foo(<param_value>) style call */
       
  9578             if (IN_param_value == NULL)
       
  9579               IN_param_value = function_call_param_iterator.next();
       
  9580             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9581             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9582             
       
  9583             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9584             {
       
  9585         
       
  9586                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
  9587                 s4o.print("(");
       
  9588                 return_type_symbol->accept(*this);
       
  9589                 s4o.print(")");
       
  9590                 IN_param_value->accept(*this);
       
  9591                 return NULL;
       
  9592                 
       
  9593             }
       
  9594             
       
  9595             ERROR;
       
  9596         }
       
  9597         
       
  9598     }/*function_word_to_usint*/
       
  9599     break;
       
  9600 
       
  9601 /****
       
  9602  *WORD_TO_UINT
       
  9603  */
       
  9604     case function_word_to_uint :
       
  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 (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9620             {
       
  9621         
       
  9622                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
  9623                 s4o.print("(");
       
  9624                 return_type_symbol->accept(*this);
       
  9625                 s4o.print(")");
       
  9626                 IN_param_value->accept(*this);
       
  9627                 return NULL;
       
  9628                 
       
  9629             }
       
  9630             
       
  9631             ERROR;
       
  9632         }
       
  9633         
       
  9634     }/*function_word_to_uint*/
       
  9635     break;
       
  9636 
       
  9637 /****
       
  9638  *WORD_TO_UDINT
       
  9639  */
       
  9640     case function_word_to_udint :
       
  9641     {
       
  9642         symbol_c *last_type_symbol = NULL;
       
  9643 
       
  9644         {
       
  9645             identifier_c param_name("IN");
       
  9646             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9647             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9648             
       
  9649             /* Get the value from a foo(<param_value>) style call */
       
  9650             if (IN_param_value == NULL)
       
  9651               IN_param_value = function_call_param_iterator.next();
       
  9652             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9653             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9654             
       
  9655             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9656             {
       
  9657         
       
  9658                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
  9659                 s4o.print("(");
       
  9660                 return_type_symbol->accept(*this);
       
  9661                 s4o.print(")");
       
  9662                 IN_param_value->accept(*this);
       
  9663                 return NULL;
       
  9664                 
       
  9665             }
       
  9666             
       
  9667             ERROR;
       
  9668         }
       
  9669         
       
  9670     }/*function_word_to_udint*/
       
  9671     break;
       
  9672 
       
  9673 /****
       
  9674  *WORD_TO_ULINT
       
  9675  */
       
  9676     case function_word_to_ulint :
       
  9677     {
       
  9678         symbol_c *last_type_symbol = NULL;
       
  9679 
       
  9680         {
       
  9681             identifier_c param_name("IN");
       
  9682             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9683             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9684             
       
  9685             /* Get the value from a foo(<param_value>) style call */
       
  9686             if (IN_param_value == NULL)
       
  9687               IN_param_value = function_call_param_iterator.next();
       
  9688             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9689             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9690             
       
  9691             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9692             {
       
  9693         
       
  9694                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
  9695                 s4o.print("(");
       
  9696                 return_type_symbol->accept(*this);
       
  9697                 s4o.print(")");
       
  9698                 IN_param_value->accept(*this);
       
  9699                 return NULL;
       
  9700                 
       
  9701             }
       
  9702             
       
  9703             ERROR;
       
  9704         }
       
  9705         
       
  9706     }/*function_word_to_ulint*/
       
  9707     break;
       
  9708 
       
  9709 /****
       
  9710  *WORD_TO_TIME
       
  9711  */
       
  9712     case function_word_to_time :
       
  9713     {
       
  9714         symbol_c *last_type_symbol = NULL;
       
  9715 
       
  9716         {
       
  9717             identifier_c param_name("IN");
       
  9718             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9719             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9720             
       
  9721             /* Get the value from a foo(<param_value>) style call */
       
  9722             if (IN_param_value == NULL)
       
  9723               IN_param_value = function_call_param_iterator.next();
       
  9724             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9725             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9726             
       
  9727             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9728             {
       
  9729         
       
  9730                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
  9731                 s4o.print("(");
       
  9732                 return_type_symbol->accept(*this);
       
  9733                 s4o.print(")real_to_time(");
       
  9734                 IN_param_value->accept(*this);
       
  9735                 s4o.print(")");
       
  9736                 return NULL;
       
  9737                 
       
  9738             }
       
  9739             
       
  9740             ERROR;
       
  9741         }
       
  9742         
       
  9743     }/*function_word_to_time*/
       
  9744     break;
       
  9745 
       
  9746 /****
       
  9747  *WORD_TO_BOOL
       
  9748  */
       
  9749     case function_word_to_bool :
       
  9750     {
       
  9751         symbol_c *last_type_symbol = NULL;
       
  9752 
       
  9753         {
       
  9754             identifier_c param_name("IN");
       
  9755             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9756             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9757             
       
  9758             /* Get the value from a foo(<param_value>) style call */
       
  9759             if (IN_param_value == NULL)
       
  9760               IN_param_value = function_call_param_iterator.next();
       
  9761             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9762             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9763             
       
  9764             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9765             {
       
  9766         
       
  9767                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
  9768                 s4o.print("(");
       
  9769                 return_type_symbol->accept(*this);
       
  9770                 s4o.print(")");
       
  9771                 IN_param_value->accept(*this);
       
  9772                 return NULL;
       
  9773                 
       
  9774             }
       
  9775             
       
  9776             ERROR;
       
  9777         }
       
  9778         
       
  9779     }/*function_word_to_bool*/
       
  9780     break;
       
  9781 
       
  9782 /****
       
  9783  *WORD_TO_BYTE
       
  9784  */
       
  9785     case function_word_to_byte :
       
  9786     {
       
  9787         symbol_c *last_type_symbol = NULL;
       
  9788 
       
  9789         {
       
  9790             identifier_c param_name("IN");
       
  9791             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9792             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9793             
       
  9794             /* Get the value from a foo(<param_value>) style call */
       
  9795             if (IN_param_value == NULL)
       
  9796               IN_param_value = function_call_param_iterator.next();
       
  9797             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9798             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9799             
       
  9800             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9801             {
       
  9802         
       
  9803                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
  9804                 s4o.print("(");
       
  9805                 return_type_symbol->accept(*this);
       
  9806                 s4o.print(")");
       
  9807                 IN_param_value->accept(*this);
       
  9808                 return NULL;
       
  9809                 
       
  9810             }
       
  9811             
       
  9812             ERROR;
       
  9813         }
       
  9814         
       
  9815     }/*function_word_to_byte*/
       
  9816     break;
       
  9817 
       
  9818 /****
       
  9819  *WORD_TO_DWORD
       
  9820  */
       
  9821     case function_word_to_dword :
       
  9822     {
       
  9823         symbol_c *last_type_symbol = NULL;
       
  9824 
       
  9825         {
       
  9826             identifier_c param_name("IN");
       
  9827             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9828             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9829             
       
  9830             /* Get the value from a foo(<param_value>) style call */
       
  9831             if (IN_param_value == NULL)
       
  9832               IN_param_value = function_call_param_iterator.next();
       
  9833             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9834             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9835             
       
  9836             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9837             {
       
  9838         
       
  9839                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
  9840                 s4o.print("(");
       
  9841                 return_type_symbol->accept(*this);
       
  9842                 s4o.print(")");
       
  9843                 IN_param_value->accept(*this);
       
  9844                 return NULL;
       
  9845                 
       
  9846             }
       
  9847             
       
  9848             ERROR;
       
  9849         }
       
  9850         
       
  9851     }/*function_word_to_dword*/
       
  9852     break;
       
  9853 
       
  9854 /****
       
  9855  *WORD_TO_LWORD
       
  9856  */
       
  9857     case function_word_to_lword :
       
  9858     {
       
  9859         symbol_c *last_type_symbol = NULL;
       
  9860 
       
  9861         {
       
  9862             identifier_c param_name("IN");
       
  9863             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9864             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9865             
       
  9866             /* Get the value from a foo(<param_value>) style call */
       
  9867             if (IN_param_value == NULL)
       
  9868               IN_param_value = function_call_param_iterator.next();
       
  9869             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9870             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9871             
       
  9872             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9873             {
       
  9874         
       
  9875                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
  9876                 s4o.print("(");
       
  9877                 return_type_symbol->accept(*this);
       
  9878                 s4o.print(")");
       
  9879                 IN_param_value->accept(*this);
       
  9880                 return NULL;
       
  9881                 
       
  9882             }
       
  9883             
       
  9884             ERROR;
       
  9885         }
       
  9886         
       
  9887     }/*function_word_to_lword*/
       
  9888     break;
       
  9889 
       
  9890 /****
       
  9891  *WORD_TO_STRING
       
  9892  */
       
  9893     case function_word_to_string :
       
  9894     {
       
  9895         symbol_c *last_type_symbol = NULL;
       
  9896 
       
  9897         {
       
  9898             identifier_c param_name("IN");
       
  9899             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9900             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9901             
       
  9902             /* Get the value from a foo(<param_value>) style call */
       
  9903             if (IN_param_value == NULL)
       
  9904               IN_param_value = function_call_param_iterator.next();
       
  9905             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9906             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9907             
       
  9908             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9909             {
       
  9910         
       
  9911                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
  9912                 s4o.print("(");
       
  9913                 return_type_symbol->accept(*this);
       
  9914                 s4o.print(")int_to_string(");
       
  9915                 IN_param_value->accept(*this);
       
  9916                 s4o.print(", 16)");
       
  9917                 return NULL;
       
  9918                 
       
  9919             }
       
  9920             
       
  9921             ERROR;
       
  9922         }
       
  9923         
       
  9924     }/*function_word_to_string*/
       
  9925     break;
       
  9926 
       
  9927 /****
       
  9928  *WORD_TO_WSTRING
       
  9929  */
       
  9930     case function_word_to_wstring :
       
  9931     {
       
  9932         symbol_c *last_type_symbol = NULL;
       
  9933 
       
  9934         {
       
  9935             identifier_c param_name("IN");
       
  9936             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9937             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9938             
       
  9939             /* Get the value from a foo(<param_value>) style call */
       
  9940             if (IN_param_value == NULL)
       
  9941               IN_param_value = function_call_param_iterator.next();
       
  9942             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9943             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9944             
       
  9945             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9946             {
       
  9947         
       
  9948                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
  9949                 s4o.print("(");
       
  9950                 return_type_symbol->accept(*this);
       
  9951                 s4o.print(")int_to_string(");
       
  9952                 IN_param_value->accept(*this);
       
  9953                 s4o.print(", 16)");
       
  9954                 return NULL;
       
  9955                 
       
  9956             }
       
  9957             
       
  9958             ERROR;
       
  9959         }
       
  9960         
       
  9961     }/*function_word_to_wstring*/
       
  9962     break;
       
  9963 
       
  9964 /****
       
  9965  *WORD_TO_DATE
       
  9966  */
       
  9967     case function_word_to_date :
       
  9968     {
       
  9969         symbol_c *last_type_symbol = NULL;
       
  9970 
       
  9971         {
       
  9972             identifier_c param_name("IN");
       
  9973             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
  9974             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
  9975             
       
  9976             /* Get the value from a foo(<param_value>) style call */
       
  9977             if (IN_param_value == NULL)
       
  9978               IN_param_value = function_call_param_iterator.next();
       
  9979             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
  9980             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
  9981             
       
  9982             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
  9983             {
       
  9984         
       
  9985                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
  9986                 s4o.print("(");
       
  9987                 return_type_symbol->accept(*this);
       
  9988                 s4o.print(")real_to_time(");
       
  9989                 IN_param_value->accept(*this);
       
  9990                 s4o.print(")");
       
  9991                 return NULL;
       
  9992                 
       
  9993             }
       
  9994             
       
  9995             ERROR;
       
  9996         }
       
  9997         
       
  9998     }/*function_word_to_date*/
       
  9999     break;
       
 10000 
       
 10001 /****
       
 10002  *WORD_TO_TOD
       
 10003  */
       
 10004     case function_word_to_tod :
       
 10005     {
       
 10006         symbol_c *last_type_symbol = NULL;
       
 10007 
       
 10008         {
       
 10009             identifier_c param_name("IN");
       
 10010             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10011             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10012             
       
 10013             /* Get the value from a foo(<param_value>) style call */
       
 10014             if (IN_param_value == NULL)
       
 10015               IN_param_value = function_call_param_iterator.next();
       
 10016             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10017             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10018             
       
 10019             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
 10020             {
       
 10021         
       
 10022                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 10023                 s4o.print("(");
       
 10024                 return_type_symbol->accept(*this);
       
 10025                 s4o.print(")real_to_time(");
       
 10026                 IN_param_value->accept(*this);
       
 10027                 s4o.print(")");
       
 10028                 return NULL;
       
 10029                 
       
 10030             }
       
 10031             
       
 10032             ERROR;
       
 10033         }
       
 10034         
       
 10035     }/*function_word_to_tod*/
       
 10036     break;
       
 10037 
       
 10038 /****
       
 10039  *WORD_TO_DT
       
 10040  */
       
 10041     case function_word_to_dt :
       
 10042     {
       
 10043         symbol_c *last_type_symbol = NULL;
       
 10044 
       
 10045         {
       
 10046             identifier_c param_name("IN");
       
 10047             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10048             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10049             
       
 10050             /* Get the value from a foo(<param_value>) style call */
       
 10051             if (IN_param_value == NULL)
       
 10052               IN_param_value = function_call_param_iterator.next();
       
 10053             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10054             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10055             
       
 10056             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
       
 10057             {
       
 10058         
       
 10059                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 10060                 s4o.print("(");
       
 10061                 return_type_symbol->accept(*this);
       
 10062                 s4o.print(")real_to_time(");
       
 10063                 IN_param_value->accept(*this);
       
 10064                 s4o.print(")");
       
 10065                 return NULL;
       
 10066                 
       
 10067             }
       
 10068             
       
 10069             ERROR;
       
 10070         }
       
 10071         
       
 10072     }/*function_word_to_dt*/
       
 10073     break;
       
 10074 
       
 10075 /****
       
 10076  *DWORD_TO_REAL
       
 10077  */
       
 10078     case function_dword_to_real :
       
 10079     {
       
 10080         symbol_c *last_type_symbol = NULL;
       
 10081 
       
 10082         {
       
 10083             identifier_c param_name("IN");
       
 10084             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10085             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10086             
       
 10087             /* Get the value from a foo(<param_value>) style call */
       
 10088             if (IN_param_value == NULL)
       
 10089               IN_param_value = function_call_param_iterator.next();
       
 10090             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10091             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10092             
       
 10093             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10094             {
       
 10095         
       
 10096                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 10097                 s4o.print("(");
       
 10098                 return_type_symbol->accept(*this);
       
 10099                 s4o.print(")");
       
 10100                 IN_param_value->accept(*this);
       
 10101                 return NULL;
       
 10102                 
       
 10103             }
       
 10104             
       
 10105             ERROR;
       
 10106         }
       
 10107         
       
 10108     }/*function_dword_to_real*/
       
 10109     break;
       
 10110 
       
 10111 /****
       
 10112  *DWORD_TO_LREAL
       
 10113  */
       
 10114     case function_dword_to_lreal :
       
 10115     {
       
 10116         symbol_c *last_type_symbol = NULL;
       
 10117 
       
 10118         {
       
 10119             identifier_c param_name("IN");
       
 10120             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10121             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10122             
       
 10123             /* Get the value from a foo(<param_value>) style call */
       
 10124             if (IN_param_value == NULL)
       
 10125               IN_param_value = function_call_param_iterator.next();
       
 10126             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10127             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10128             
       
 10129             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10130             {
       
 10131         
       
 10132                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 10133                 s4o.print("(");
       
 10134                 return_type_symbol->accept(*this);
       
 10135                 s4o.print(")");
       
 10136                 IN_param_value->accept(*this);
       
 10137                 return NULL;
       
 10138                 
       
 10139             }
       
 10140             
       
 10141             ERROR;
       
 10142         }
       
 10143         
       
 10144     }/*function_dword_to_lreal*/
       
 10145     break;
       
 10146 
       
 10147 /****
       
 10148  *DWORD_TO_SINT
       
 10149  */
       
 10150     case function_dword_to_sint :
       
 10151     {
       
 10152         symbol_c *last_type_symbol = NULL;
       
 10153 
       
 10154         {
       
 10155             identifier_c param_name("IN");
       
 10156             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10157             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10158             
       
 10159             /* Get the value from a foo(<param_value>) style call */
       
 10160             if (IN_param_value == NULL)
       
 10161               IN_param_value = function_call_param_iterator.next();
       
 10162             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10163             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10164             
       
 10165             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10166             {
       
 10167         
       
 10168                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 10169                 s4o.print("(");
       
 10170                 return_type_symbol->accept(*this);
       
 10171                 s4o.print(")");
       
 10172                 IN_param_value->accept(*this);
       
 10173                 return NULL;
       
 10174                 
       
 10175             }
       
 10176             
       
 10177             ERROR;
       
 10178         }
       
 10179         
       
 10180     }/*function_dword_to_sint*/
       
 10181     break;
       
 10182 
       
 10183 /****
       
 10184  *DWORD_TO_INT
       
 10185  */
       
 10186     case function_dword_to_int :
       
 10187     {
       
 10188         symbol_c *last_type_symbol = NULL;
       
 10189 
       
 10190         {
       
 10191             identifier_c param_name("IN");
       
 10192             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10193             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10194             
       
 10195             /* Get the value from a foo(<param_value>) style call */
       
 10196             if (IN_param_value == NULL)
       
 10197               IN_param_value = function_call_param_iterator.next();
       
 10198             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10199             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10200             
       
 10201             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10202             {
       
 10203         
       
 10204                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 10205                 s4o.print("(");
       
 10206                 return_type_symbol->accept(*this);
       
 10207                 s4o.print(")");
       
 10208                 IN_param_value->accept(*this);
       
 10209                 return NULL;
       
 10210                 
       
 10211             }
       
 10212             
       
 10213             ERROR;
       
 10214         }
       
 10215         
       
 10216     }/*function_dword_to_int*/
       
 10217     break;
       
 10218 
       
 10219 /****
       
 10220  *DWORD_TO_DINT
       
 10221  */
       
 10222     case function_dword_to_dint :
       
 10223     {
       
 10224         symbol_c *last_type_symbol = NULL;
       
 10225 
       
 10226         {
       
 10227             identifier_c param_name("IN");
       
 10228             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10229             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10230             
       
 10231             /* Get the value from a foo(<param_value>) style call */
       
 10232             if (IN_param_value == NULL)
       
 10233               IN_param_value = function_call_param_iterator.next();
       
 10234             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10235             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10236             
       
 10237             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10238             {
       
 10239         
       
 10240                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 10241                 s4o.print("(");
       
 10242                 return_type_symbol->accept(*this);
       
 10243                 s4o.print(")");
       
 10244                 IN_param_value->accept(*this);
       
 10245                 return NULL;
       
 10246                 
       
 10247             }
       
 10248             
       
 10249             ERROR;
       
 10250         }
       
 10251         
       
 10252     }/*function_dword_to_dint*/
       
 10253     break;
       
 10254 
       
 10255 /****
       
 10256  *DWORD_TO_LINT
       
 10257  */
       
 10258     case function_dword_to_lint :
       
 10259     {
       
 10260         symbol_c *last_type_symbol = NULL;
       
 10261 
       
 10262         {
       
 10263             identifier_c param_name("IN");
       
 10264             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10265             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10266             
       
 10267             /* Get the value from a foo(<param_value>) style call */
       
 10268             if (IN_param_value == NULL)
       
 10269               IN_param_value = function_call_param_iterator.next();
       
 10270             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10271             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10272             
       
 10273             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10274             {
       
 10275         
       
 10276                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 10277                 s4o.print("(");
       
 10278                 return_type_symbol->accept(*this);
       
 10279                 s4o.print(")");
       
 10280                 IN_param_value->accept(*this);
       
 10281                 return NULL;
       
 10282                 
       
 10283             }
       
 10284             
       
 10285             ERROR;
       
 10286         }
       
 10287         
       
 10288     }/*function_dword_to_lint*/
       
 10289     break;
       
 10290 
       
 10291 /****
       
 10292  *DWORD_TO_USINT
       
 10293  */
       
 10294     case function_dword_to_usint :
       
 10295     {
       
 10296         symbol_c *last_type_symbol = NULL;
       
 10297 
       
 10298         {
       
 10299             identifier_c param_name("IN");
       
 10300             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10301             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10302             
       
 10303             /* Get the value from a foo(<param_value>) style call */
       
 10304             if (IN_param_value == NULL)
       
 10305               IN_param_value = function_call_param_iterator.next();
       
 10306             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10307             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10308             
       
 10309             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10310             {
       
 10311         
       
 10312                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 10313                 s4o.print("(");
       
 10314                 return_type_symbol->accept(*this);
       
 10315                 s4o.print(")");
       
 10316                 IN_param_value->accept(*this);
       
 10317                 return NULL;
       
 10318                 
       
 10319             }
       
 10320             
       
 10321             ERROR;
       
 10322         }
       
 10323         
       
 10324     }/*function_dword_to_usint*/
       
 10325     break;
       
 10326 
       
 10327 /****
       
 10328  *DWORD_TO_UINT
       
 10329  */
       
 10330     case function_dword_to_uint :
       
 10331     {
       
 10332         symbol_c *last_type_symbol = NULL;
       
 10333 
       
 10334         {
       
 10335             identifier_c param_name("IN");
       
 10336             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10337             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10338             
       
 10339             /* Get the value from a foo(<param_value>) style call */
       
 10340             if (IN_param_value == NULL)
       
 10341               IN_param_value = function_call_param_iterator.next();
       
 10342             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10343             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10344             
       
 10345             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10346             {
       
 10347         
       
 10348                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 10349                 s4o.print("(");
       
 10350                 return_type_symbol->accept(*this);
       
 10351                 s4o.print(")");
       
 10352                 IN_param_value->accept(*this);
       
 10353                 return NULL;
       
 10354                 
       
 10355             }
       
 10356             
       
 10357             ERROR;
       
 10358         }
       
 10359         
       
 10360     }/*function_dword_to_uint*/
       
 10361     break;
       
 10362 
       
 10363 /****
       
 10364  *DWORD_TO_UDINT
       
 10365  */
       
 10366     case function_dword_to_udint :
       
 10367     {
       
 10368         symbol_c *last_type_symbol = NULL;
       
 10369 
       
 10370         {
       
 10371             identifier_c param_name("IN");
       
 10372             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10373             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10374             
       
 10375             /* Get the value from a foo(<param_value>) style call */
       
 10376             if (IN_param_value == NULL)
       
 10377               IN_param_value = function_call_param_iterator.next();
       
 10378             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10379             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10380             
       
 10381             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10382             {
       
 10383         
       
 10384                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 10385                 s4o.print("(");
       
 10386                 return_type_symbol->accept(*this);
       
 10387                 s4o.print(")");
       
 10388                 IN_param_value->accept(*this);
       
 10389                 return NULL;
       
 10390                 
       
 10391             }
       
 10392             
       
 10393             ERROR;
       
 10394         }
       
 10395         
       
 10396     }/*function_dword_to_udint*/
       
 10397     break;
       
 10398 
       
 10399 /****
       
 10400  *DWORD_TO_ULINT
       
 10401  */
       
 10402     case function_dword_to_ulint :
       
 10403     {
       
 10404         symbol_c *last_type_symbol = NULL;
       
 10405 
       
 10406         {
       
 10407             identifier_c param_name("IN");
       
 10408             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10409             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10410             
       
 10411             /* Get the value from a foo(<param_value>) style call */
       
 10412             if (IN_param_value == NULL)
       
 10413               IN_param_value = function_call_param_iterator.next();
       
 10414             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10415             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10416             
       
 10417             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10418             {
       
 10419         
       
 10420                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 10421                 s4o.print("(");
       
 10422                 return_type_symbol->accept(*this);
       
 10423                 s4o.print(")");
       
 10424                 IN_param_value->accept(*this);
       
 10425                 return NULL;
       
 10426                 
       
 10427             }
       
 10428             
       
 10429             ERROR;
       
 10430         }
       
 10431         
       
 10432     }/*function_dword_to_ulint*/
       
 10433     break;
       
 10434 
       
 10435 /****
       
 10436  *DWORD_TO_TIME
       
 10437  */
       
 10438     case function_dword_to_time :
       
 10439     {
       
 10440         symbol_c *last_type_symbol = NULL;
       
 10441 
       
 10442         {
       
 10443             identifier_c param_name("IN");
       
 10444             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10445             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10446             
       
 10447             /* Get the value from a foo(<param_value>) style call */
       
 10448             if (IN_param_value == NULL)
       
 10449               IN_param_value = function_call_param_iterator.next();
       
 10450             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10451             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10452             
       
 10453             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10454             {
       
 10455         
       
 10456                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 10457                 s4o.print("(");
       
 10458                 return_type_symbol->accept(*this);
       
 10459                 s4o.print(")real_to_time(");
       
 10460                 IN_param_value->accept(*this);
       
 10461                 s4o.print(")");
       
 10462                 return NULL;
       
 10463                 
       
 10464             }
       
 10465             
       
 10466             ERROR;
       
 10467         }
       
 10468         
       
 10469     }/*function_dword_to_time*/
       
 10470     break;
       
 10471 
       
 10472 /****
       
 10473  *DWORD_TO_BOOL
       
 10474  */
       
 10475     case function_dword_to_bool :
       
 10476     {
       
 10477         symbol_c *last_type_symbol = NULL;
       
 10478 
       
 10479         {
       
 10480             identifier_c param_name("IN");
       
 10481             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10482             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10483             
       
 10484             /* Get the value from a foo(<param_value>) style call */
       
 10485             if (IN_param_value == NULL)
       
 10486               IN_param_value = function_call_param_iterator.next();
       
 10487             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10488             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10489             
       
 10490             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10491             {
       
 10492         
       
 10493                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 10494                 s4o.print("(");
       
 10495                 return_type_symbol->accept(*this);
       
 10496                 s4o.print(")");
       
 10497                 IN_param_value->accept(*this);
       
 10498                 return NULL;
       
 10499                 
       
 10500             }
       
 10501             
       
 10502             ERROR;
       
 10503         }
       
 10504         
       
 10505     }/*function_dword_to_bool*/
       
 10506     break;
       
 10507 
       
 10508 /****
       
 10509  *DWORD_TO_BYTE
       
 10510  */
       
 10511     case function_dword_to_byte :
       
 10512     {
       
 10513         symbol_c *last_type_symbol = NULL;
       
 10514 
       
 10515         {
       
 10516             identifier_c param_name("IN");
       
 10517             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10518             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10519             
       
 10520             /* Get the value from a foo(<param_value>) style call */
       
 10521             if (IN_param_value == NULL)
       
 10522               IN_param_value = function_call_param_iterator.next();
       
 10523             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10524             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10525             
       
 10526             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10527             {
       
 10528         
       
 10529                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 10530                 s4o.print("(");
       
 10531                 return_type_symbol->accept(*this);
       
 10532                 s4o.print(")");
       
 10533                 IN_param_value->accept(*this);
       
 10534                 return NULL;
       
 10535                 
       
 10536             }
       
 10537             
       
 10538             ERROR;
       
 10539         }
       
 10540         
       
 10541     }/*function_dword_to_byte*/
       
 10542     break;
       
 10543 
       
 10544 /****
       
 10545  *DWORD_TO_WORD
       
 10546  */
       
 10547     case function_dword_to_word :
       
 10548     {
       
 10549         symbol_c *last_type_symbol = NULL;
       
 10550 
       
 10551         {
       
 10552             identifier_c param_name("IN");
       
 10553             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10554             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10555             
       
 10556             /* Get the value from a foo(<param_value>) style call */
       
 10557             if (IN_param_value == NULL)
       
 10558               IN_param_value = function_call_param_iterator.next();
       
 10559             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10560             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10561             
       
 10562             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10563             {
       
 10564         
       
 10565                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 10566                 s4o.print("(");
       
 10567                 return_type_symbol->accept(*this);
       
 10568                 s4o.print(")");
       
 10569                 IN_param_value->accept(*this);
       
 10570                 return NULL;
       
 10571                 
       
 10572             }
       
 10573             
       
 10574             ERROR;
       
 10575         }
       
 10576         
       
 10577     }/*function_dword_to_word*/
       
 10578     break;
       
 10579 
       
 10580 /****
       
 10581  *DWORD_TO_LWORD
       
 10582  */
       
 10583     case function_dword_to_lword :
       
 10584     {
       
 10585         symbol_c *last_type_symbol = NULL;
       
 10586 
       
 10587         {
       
 10588             identifier_c param_name("IN");
       
 10589             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10590             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10591             
       
 10592             /* Get the value from a foo(<param_value>) style call */
       
 10593             if (IN_param_value == NULL)
       
 10594               IN_param_value = function_call_param_iterator.next();
       
 10595             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10596             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10597             
       
 10598             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10599             {
       
 10600         
       
 10601                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 10602                 s4o.print("(");
       
 10603                 return_type_symbol->accept(*this);
       
 10604                 s4o.print(")");
       
 10605                 IN_param_value->accept(*this);
       
 10606                 return NULL;
       
 10607                 
       
 10608             }
       
 10609             
       
 10610             ERROR;
       
 10611         }
       
 10612         
       
 10613     }/*function_dword_to_lword*/
       
 10614     break;
       
 10615 
       
 10616 /****
       
 10617  *DWORD_TO_STRING
       
 10618  */
       
 10619     case function_dword_to_string :
       
 10620     {
       
 10621         symbol_c *last_type_symbol = NULL;
       
 10622 
       
 10623         {
       
 10624             identifier_c param_name("IN");
       
 10625             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10626             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10627             
       
 10628             /* Get the value from a foo(<param_value>) style call */
       
 10629             if (IN_param_value == NULL)
       
 10630               IN_param_value = function_call_param_iterator.next();
       
 10631             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10632             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10633             
       
 10634             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10635             {
       
 10636         
       
 10637                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 10638                 s4o.print("(");
       
 10639                 return_type_symbol->accept(*this);
       
 10640                 s4o.print(")int_to_string(");
       
 10641                 IN_param_value->accept(*this);
       
 10642                 s4o.print(", 16)");
       
 10643                 return NULL;
       
 10644                 
       
 10645             }
       
 10646             
       
 10647             ERROR;
       
 10648         }
       
 10649         
       
 10650     }/*function_dword_to_string*/
       
 10651     break;
       
 10652 
       
 10653 /****
       
 10654  *DWORD_TO_WSTRING
       
 10655  */
       
 10656     case function_dword_to_wstring :
       
 10657     {
       
 10658         symbol_c *last_type_symbol = NULL;
       
 10659 
       
 10660         {
       
 10661             identifier_c param_name("IN");
       
 10662             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10663             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10664             
       
 10665             /* Get the value from a foo(<param_value>) style call */
       
 10666             if (IN_param_value == NULL)
       
 10667               IN_param_value = function_call_param_iterator.next();
       
 10668             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10669             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10670             
       
 10671             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10672             {
       
 10673         
       
 10674                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
 10675                 s4o.print("(");
       
 10676                 return_type_symbol->accept(*this);
       
 10677                 s4o.print(")int_to_string(");
       
 10678                 IN_param_value->accept(*this);
       
 10679                 s4o.print(", 16)");
       
 10680                 return NULL;
       
 10681                 
       
 10682             }
       
 10683             
       
 10684             ERROR;
       
 10685         }
       
 10686         
       
 10687     }/*function_dword_to_wstring*/
       
 10688     break;
       
 10689 
       
 10690 /****
       
 10691  *DWORD_TO_DATE
       
 10692  */
       
 10693     case function_dword_to_date :
       
 10694     {
       
 10695         symbol_c *last_type_symbol = NULL;
       
 10696 
       
 10697         {
       
 10698             identifier_c param_name("IN");
       
 10699             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10700             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10701             
       
 10702             /* Get the value from a foo(<param_value>) style call */
       
 10703             if (IN_param_value == NULL)
       
 10704               IN_param_value = function_call_param_iterator.next();
       
 10705             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10706             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10707             
       
 10708             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10709             {
       
 10710         
       
 10711                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 10712                 s4o.print("(");
       
 10713                 return_type_symbol->accept(*this);
       
 10714                 s4o.print(")real_to_time(");
       
 10715                 IN_param_value->accept(*this);
       
 10716                 s4o.print(")");
       
 10717                 return NULL;
       
 10718                 
       
 10719             }
       
 10720             
       
 10721             ERROR;
       
 10722         }
       
 10723         
       
 10724     }/*function_dword_to_date*/
       
 10725     break;
       
 10726 
       
 10727 /****
       
 10728  *DWORD_TO_TOD
       
 10729  */
       
 10730     case function_dword_to_tod :
       
 10731     {
       
 10732         symbol_c *last_type_symbol = NULL;
       
 10733 
       
 10734         {
       
 10735             identifier_c param_name("IN");
       
 10736             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10737             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10738             
       
 10739             /* Get the value from a foo(<param_value>) style call */
       
 10740             if (IN_param_value == NULL)
       
 10741               IN_param_value = function_call_param_iterator.next();
       
 10742             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10743             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10744             
       
 10745             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10746             {
       
 10747         
       
 10748                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 10749                 s4o.print("(");
       
 10750                 return_type_symbol->accept(*this);
       
 10751                 s4o.print(")real_to_time(");
       
 10752                 IN_param_value->accept(*this);
       
 10753                 s4o.print(")");
       
 10754                 return NULL;
       
 10755                 
       
 10756             }
       
 10757             
       
 10758             ERROR;
       
 10759         }
       
 10760         
       
 10761     }/*function_dword_to_tod*/
       
 10762     break;
       
 10763 
       
 10764 /****
       
 10765  *DWORD_TO_DT
       
 10766  */
       
 10767     case function_dword_to_dt :
       
 10768     {
       
 10769         symbol_c *last_type_symbol = NULL;
       
 10770 
       
 10771         {
       
 10772             identifier_c param_name("IN");
       
 10773             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10774             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10775             
       
 10776             /* Get the value from a foo(<param_value>) style call */
       
 10777             if (IN_param_value == NULL)
       
 10778               IN_param_value = function_call_param_iterator.next();
       
 10779             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10780             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10781             
       
 10782             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
       
 10783             {
       
 10784         
       
 10785                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 10786                 s4o.print("(");
       
 10787                 return_type_symbol->accept(*this);
       
 10788                 s4o.print(")real_to_time(");
       
 10789                 IN_param_value->accept(*this);
       
 10790                 s4o.print(")");
       
 10791                 return NULL;
       
 10792                 
       
 10793             }
       
 10794             
       
 10795             ERROR;
       
 10796         }
       
 10797         
       
 10798     }/*function_dword_to_dt*/
       
 10799     break;
       
 10800 
       
 10801 /****
       
 10802  *LWORD_TO_REAL
       
 10803  */
       
 10804     case function_lword_to_real :
       
 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 (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10820             {
       
 10821         
       
 10822                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 10823                 s4o.print("(");
       
 10824                 return_type_symbol->accept(*this);
       
 10825                 s4o.print(")");
       
 10826                 IN_param_value->accept(*this);
       
 10827                 return NULL;
       
 10828                 
       
 10829             }
       
 10830             
       
 10831             ERROR;
       
 10832         }
       
 10833         
       
 10834     }/*function_lword_to_real*/
       
 10835     break;
       
 10836 
       
 10837 /****
       
 10838  *LWORD_TO_LREAL
       
 10839  */
       
 10840     case function_lword_to_lreal :
       
 10841     {
       
 10842         symbol_c *last_type_symbol = NULL;
       
 10843 
       
 10844         {
       
 10845             identifier_c param_name("IN");
       
 10846             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10847             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10848             
       
 10849             /* Get the value from a foo(<param_value>) style call */
       
 10850             if (IN_param_value == NULL)
       
 10851               IN_param_value = function_call_param_iterator.next();
       
 10852             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10853             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10854             
       
 10855             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10856             {
       
 10857         
       
 10858                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 10859                 s4o.print("(");
       
 10860                 return_type_symbol->accept(*this);
       
 10861                 s4o.print(")");
       
 10862                 IN_param_value->accept(*this);
       
 10863                 return NULL;
       
 10864                 
       
 10865             }
       
 10866             
       
 10867             ERROR;
       
 10868         }
       
 10869         
       
 10870     }/*function_lword_to_lreal*/
       
 10871     break;
       
 10872 
       
 10873 /****
       
 10874  *LWORD_TO_SINT
       
 10875  */
       
 10876     case function_lword_to_sint :
       
 10877     {
       
 10878         symbol_c *last_type_symbol = NULL;
       
 10879 
       
 10880         {
       
 10881             identifier_c param_name("IN");
       
 10882             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10883             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10884             
       
 10885             /* Get the value from a foo(<param_value>) style call */
       
 10886             if (IN_param_value == NULL)
       
 10887               IN_param_value = function_call_param_iterator.next();
       
 10888             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10889             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10890             
       
 10891             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10892             {
       
 10893         
       
 10894                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 10895                 s4o.print("(");
       
 10896                 return_type_symbol->accept(*this);
       
 10897                 s4o.print(")");
       
 10898                 IN_param_value->accept(*this);
       
 10899                 return NULL;
       
 10900                 
       
 10901             }
       
 10902             
       
 10903             ERROR;
       
 10904         }
       
 10905         
       
 10906     }/*function_lword_to_sint*/
       
 10907     break;
       
 10908 
       
 10909 /****
       
 10910  *LWORD_TO_INT
       
 10911  */
       
 10912     case function_lword_to_int :
       
 10913     {
       
 10914         symbol_c *last_type_symbol = NULL;
       
 10915 
       
 10916         {
       
 10917             identifier_c param_name("IN");
       
 10918             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10919             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10920             
       
 10921             /* Get the value from a foo(<param_value>) style call */
       
 10922             if (IN_param_value == NULL)
       
 10923               IN_param_value = function_call_param_iterator.next();
       
 10924             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10925             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10926             
       
 10927             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10928             {
       
 10929         
       
 10930                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 10931                 s4o.print("(");
       
 10932                 return_type_symbol->accept(*this);
       
 10933                 s4o.print(")");
       
 10934                 IN_param_value->accept(*this);
       
 10935                 return NULL;
       
 10936                 
       
 10937             }
       
 10938             
       
 10939             ERROR;
       
 10940         }
       
 10941         
       
 10942     }/*function_lword_to_int*/
       
 10943     break;
       
 10944 
       
 10945 /****
       
 10946  *LWORD_TO_DINT
       
 10947  */
       
 10948     case function_lword_to_dint :
       
 10949     {
       
 10950         symbol_c *last_type_symbol = NULL;
       
 10951 
       
 10952         {
       
 10953             identifier_c param_name("IN");
       
 10954             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10955             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10956             
       
 10957             /* Get the value from a foo(<param_value>) style call */
       
 10958             if (IN_param_value == NULL)
       
 10959               IN_param_value = function_call_param_iterator.next();
       
 10960             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10961             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10962             
       
 10963             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 10964             {
       
 10965         
       
 10966                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 10967                 s4o.print("(");
       
 10968                 return_type_symbol->accept(*this);
       
 10969                 s4o.print(")");
       
 10970                 IN_param_value->accept(*this);
       
 10971                 return NULL;
       
 10972                 
       
 10973             }
       
 10974             
       
 10975             ERROR;
       
 10976         }
       
 10977         
       
 10978     }/*function_lword_to_dint*/
       
 10979     break;
       
 10980 
       
 10981 /****
       
 10982  *LWORD_TO_LINT
       
 10983  */
       
 10984     case function_lword_to_lint :
       
 10985     {
       
 10986         symbol_c *last_type_symbol = NULL;
       
 10987 
       
 10988         {
       
 10989             identifier_c param_name("IN");
       
 10990             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 10991             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 10992             
       
 10993             /* Get the value from a foo(<param_value>) style call */
       
 10994             if (IN_param_value == NULL)
       
 10995               IN_param_value = function_call_param_iterator.next();
       
 10996             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 10997             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 10998             
       
 10999             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11000             {
       
 11001         
       
 11002                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 11003                 s4o.print("(");
       
 11004                 return_type_symbol->accept(*this);
       
 11005                 s4o.print(")");
       
 11006                 IN_param_value->accept(*this);
       
 11007                 return NULL;
       
 11008                 
       
 11009             }
       
 11010             
       
 11011             ERROR;
       
 11012         }
       
 11013         
       
 11014     }/*function_lword_to_lint*/
       
 11015     break;
       
 11016 
       
 11017 /****
       
 11018  *LWORD_TO_USINT
       
 11019  */
       
 11020     case function_lword_to_usint :
       
 11021     {
       
 11022         symbol_c *last_type_symbol = NULL;
       
 11023 
       
 11024         {
       
 11025             identifier_c param_name("IN");
       
 11026             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11027             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11028             
       
 11029             /* Get the value from a foo(<param_value>) style call */
       
 11030             if (IN_param_value == NULL)
       
 11031               IN_param_value = function_call_param_iterator.next();
       
 11032             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11033             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11034             
       
 11035             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11036             {
       
 11037         
       
 11038                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 11039                 s4o.print("(");
       
 11040                 return_type_symbol->accept(*this);
       
 11041                 s4o.print(")");
       
 11042                 IN_param_value->accept(*this);
       
 11043                 return NULL;
       
 11044                 
       
 11045             }
       
 11046             
       
 11047             ERROR;
       
 11048         }
       
 11049         
       
 11050     }/*function_lword_to_usint*/
       
 11051     break;
       
 11052 
       
 11053 /****
       
 11054  *LWORD_TO_UINT
       
 11055  */
       
 11056     case function_lword_to_uint :
       
 11057     {
       
 11058         symbol_c *last_type_symbol = NULL;
       
 11059 
       
 11060         {
       
 11061             identifier_c param_name("IN");
       
 11062             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11063             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11064             
       
 11065             /* Get the value from a foo(<param_value>) style call */
       
 11066             if (IN_param_value == NULL)
       
 11067               IN_param_value = function_call_param_iterator.next();
       
 11068             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11069             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11070             
       
 11071             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11072             {
       
 11073         
       
 11074                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 11075                 s4o.print("(");
       
 11076                 return_type_symbol->accept(*this);
       
 11077                 s4o.print(")");
       
 11078                 IN_param_value->accept(*this);
       
 11079                 return NULL;
       
 11080                 
       
 11081             }
       
 11082             
       
 11083             ERROR;
       
 11084         }
       
 11085         
       
 11086     }/*function_lword_to_uint*/
       
 11087     break;
       
 11088 
       
 11089 /****
       
 11090  *LWORD_TO_UDINT
       
 11091  */
       
 11092     case function_lword_to_udint :
       
 11093     {
       
 11094         symbol_c *last_type_symbol = NULL;
       
 11095 
       
 11096         {
       
 11097             identifier_c param_name("IN");
       
 11098             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11099             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11100             
       
 11101             /* Get the value from a foo(<param_value>) style call */
       
 11102             if (IN_param_value == NULL)
       
 11103               IN_param_value = function_call_param_iterator.next();
       
 11104             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11105             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11106             
       
 11107             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11108             {
       
 11109         
       
 11110                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 11111                 s4o.print("(");
       
 11112                 return_type_symbol->accept(*this);
       
 11113                 s4o.print(")");
       
 11114                 IN_param_value->accept(*this);
       
 11115                 return NULL;
       
 11116                 
       
 11117             }
       
 11118             
       
 11119             ERROR;
       
 11120         }
       
 11121         
       
 11122     }/*function_lword_to_udint*/
       
 11123     break;
       
 11124 
       
 11125 /****
       
 11126  *LWORD_TO_ULINT
       
 11127  */
       
 11128     case function_lword_to_ulint :
       
 11129     {
       
 11130         symbol_c *last_type_symbol = NULL;
       
 11131 
       
 11132         {
       
 11133             identifier_c param_name("IN");
       
 11134             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11135             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11136             
       
 11137             /* Get the value from a foo(<param_value>) style call */
       
 11138             if (IN_param_value == NULL)
       
 11139               IN_param_value = function_call_param_iterator.next();
       
 11140             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11141             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11142             
       
 11143             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11144             {
       
 11145         
       
 11146                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 11147                 s4o.print("(");
       
 11148                 return_type_symbol->accept(*this);
       
 11149                 s4o.print(")");
       
 11150                 IN_param_value->accept(*this);
       
 11151                 return NULL;
       
 11152                 
       
 11153             }
       
 11154             
       
 11155             ERROR;
       
 11156         }
       
 11157         
       
 11158     }/*function_lword_to_ulint*/
       
 11159     break;
       
 11160 
       
 11161 /****
       
 11162  *LWORD_TO_TIME
       
 11163  */
       
 11164     case function_lword_to_time :
       
 11165     {
       
 11166         symbol_c *last_type_symbol = NULL;
       
 11167 
       
 11168         {
       
 11169             identifier_c param_name("IN");
       
 11170             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11171             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11172             
       
 11173             /* Get the value from a foo(<param_value>) style call */
       
 11174             if (IN_param_value == NULL)
       
 11175               IN_param_value = function_call_param_iterator.next();
       
 11176             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11177             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11178             
       
 11179             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11180             {
       
 11181         
       
 11182                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 11183                 s4o.print("(");
       
 11184                 return_type_symbol->accept(*this);
       
 11185                 s4o.print(")real_to_time(");
       
 11186                 IN_param_value->accept(*this);
       
 11187                 s4o.print(")");
       
 11188                 return NULL;
       
 11189                 
       
 11190             }
       
 11191             
       
 11192             ERROR;
       
 11193         }
       
 11194         
       
 11195     }/*function_lword_to_time*/
       
 11196     break;
       
 11197 
       
 11198 /****
       
 11199  *LWORD_TO_BOOL
       
 11200  */
       
 11201     case function_lword_to_bool :
       
 11202     {
       
 11203         symbol_c *last_type_symbol = NULL;
       
 11204 
       
 11205         {
       
 11206             identifier_c param_name("IN");
       
 11207             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11208             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11209             
       
 11210             /* Get the value from a foo(<param_value>) style call */
       
 11211             if (IN_param_value == NULL)
       
 11212               IN_param_value = function_call_param_iterator.next();
       
 11213             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11214             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11215             
       
 11216             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11217             {
       
 11218         
       
 11219                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 11220                 s4o.print("(");
       
 11221                 return_type_symbol->accept(*this);
       
 11222                 s4o.print(")");
       
 11223                 IN_param_value->accept(*this);
       
 11224                 return NULL;
       
 11225                 
       
 11226             }
       
 11227             
       
 11228             ERROR;
       
 11229         }
       
 11230         
       
 11231     }/*function_lword_to_bool*/
       
 11232     break;
       
 11233 
       
 11234 /****
       
 11235  *LWORD_TO_BYTE
       
 11236  */
       
 11237     case function_lword_to_byte :
       
 11238     {
       
 11239         symbol_c *last_type_symbol = NULL;
       
 11240 
       
 11241         {
       
 11242             identifier_c param_name("IN");
       
 11243             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11244             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11245             
       
 11246             /* Get the value from a foo(<param_value>) style call */
       
 11247             if (IN_param_value == NULL)
       
 11248               IN_param_value = function_call_param_iterator.next();
       
 11249             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11250             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11251             
       
 11252             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11253             {
       
 11254         
       
 11255                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 11256                 s4o.print("(");
       
 11257                 return_type_symbol->accept(*this);
       
 11258                 s4o.print(")");
       
 11259                 IN_param_value->accept(*this);
       
 11260                 return NULL;
       
 11261                 
       
 11262             }
       
 11263             
       
 11264             ERROR;
       
 11265         }
       
 11266         
       
 11267     }/*function_lword_to_byte*/
       
 11268     break;
       
 11269 
       
 11270 /****
       
 11271  *LWORD_TO_WORD
       
 11272  */
       
 11273     case function_lword_to_word :
       
 11274     {
       
 11275         symbol_c *last_type_symbol = NULL;
       
 11276 
       
 11277         {
       
 11278             identifier_c param_name("IN");
       
 11279             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11280             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11281             
       
 11282             /* Get the value from a foo(<param_value>) style call */
       
 11283             if (IN_param_value == NULL)
       
 11284               IN_param_value = function_call_param_iterator.next();
       
 11285             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11286             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11287             
       
 11288             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11289             {
       
 11290         
       
 11291                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 11292                 s4o.print("(");
       
 11293                 return_type_symbol->accept(*this);
       
 11294                 s4o.print(")");
       
 11295                 IN_param_value->accept(*this);
       
 11296                 return NULL;
       
 11297                 
       
 11298             }
       
 11299             
       
 11300             ERROR;
       
 11301         }
       
 11302         
       
 11303     }/*function_lword_to_word*/
       
 11304     break;
       
 11305 
       
 11306 /****
       
 11307  *LWORD_TO_DWORD
       
 11308  */
       
 11309     case function_lword_to_dword :
       
 11310     {
       
 11311         symbol_c *last_type_symbol = NULL;
       
 11312 
       
 11313         {
       
 11314             identifier_c param_name("IN");
       
 11315             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11316             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11317             
       
 11318             /* Get the value from a foo(<param_value>) style call */
       
 11319             if (IN_param_value == NULL)
       
 11320               IN_param_value = function_call_param_iterator.next();
       
 11321             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11322             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11323             
       
 11324             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11325             {
       
 11326         
       
 11327                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 11328                 s4o.print("(");
       
 11329                 return_type_symbol->accept(*this);
       
 11330                 s4o.print(")");
       
 11331                 IN_param_value->accept(*this);
       
 11332                 return NULL;
       
 11333                 
       
 11334             }
       
 11335             
       
 11336             ERROR;
       
 11337         }
       
 11338         
       
 11339     }/*function_lword_to_dword*/
       
 11340     break;
       
 11341 
       
 11342 /****
       
 11343  *LWORD_TO_STRING
       
 11344  */
       
 11345     case function_lword_to_string :
       
 11346     {
       
 11347         symbol_c *last_type_symbol = NULL;
       
 11348 
       
 11349         {
       
 11350             identifier_c param_name("IN");
       
 11351             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11352             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11353             
       
 11354             /* Get the value from a foo(<param_value>) style call */
       
 11355             if (IN_param_value == NULL)
       
 11356               IN_param_value = function_call_param_iterator.next();
       
 11357             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11358             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11359             
       
 11360             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11361             {
       
 11362         
       
 11363                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 11364                 s4o.print("(");
       
 11365                 return_type_symbol->accept(*this);
       
 11366                 s4o.print(")int_to_string(");
       
 11367                 IN_param_value->accept(*this);
       
 11368                 s4o.print(", 16)");
       
 11369                 return NULL;
       
 11370                 
       
 11371             }
       
 11372             
       
 11373             ERROR;
       
 11374         }
       
 11375         
       
 11376     }/*function_lword_to_string*/
       
 11377     break;
       
 11378 
       
 11379 /****
       
 11380  *LWORD_TO_WSTRING
       
 11381  */
       
 11382     case function_lword_to_wstring :
       
 11383     {
       
 11384         symbol_c *last_type_symbol = NULL;
       
 11385 
       
 11386         {
       
 11387             identifier_c param_name("IN");
       
 11388             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11389             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11390             
       
 11391             /* Get the value from a foo(<param_value>) style call */
       
 11392             if (IN_param_value == NULL)
       
 11393               IN_param_value = function_call_param_iterator.next();
       
 11394             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11395             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11396             
       
 11397             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11398             {
       
 11399         
       
 11400                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
 11401                 s4o.print("(");
       
 11402                 return_type_symbol->accept(*this);
       
 11403                 s4o.print(")int_to_string(");
       
 11404                 IN_param_value->accept(*this);
       
 11405                 s4o.print(", 16)");
       
 11406                 return NULL;
       
 11407                 
       
 11408             }
       
 11409             
       
 11410             ERROR;
       
 11411         }
       
 11412         
       
 11413     }/*function_lword_to_wstring*/
       
 11414     break;
       
 11415 
       
 11416 /****
       
 11417  *LWORD_TO_DATE
       
 11418  */
       
 11419     case function_lword_to_date :
       
 11420     {
       
 11421         symbol_c *last_type_symbol = NULL;
       
 11422 
       
 11423         {
       
 11424             identifier_c param_name("IN");
       
 11425             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11426             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11427             
       
 11428             /* Get the value from a foo(<param_value>) style call */
       
 11429             if (IN_param_value == NULL)
       
 11430               IN_param_value = function_call_param_iterator.next();
       
 11431             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11432             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11433             
       
 11434             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11435             {
       
 11436         
       
 11437                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 11438                 s4o.print("(");
       
 11439                 return_type_symbol->accept(*this);
       
 11440                 s4o.print(")real_to_time(");
       
 11441                 IN_param_value->accept(*this);
       
 11442                 s4o.print(")");
       
 11443                 return NULL;
       
 11444                 
       
 11445             }
       
 11446             
       
 11447             ERROR;
       
 11448         }
       
 11449         
       
 11450     }/*function_lword_to_date*/
       
 11451     break;
       
 11452 
       
 11453 /****
       
 11454  *LWORD_TO_TOD
       
 11455  */
       
 11456     case function_lword_to_tod :
       
 11457     {
       
 11458         symbol_c *last_type_symbol = NULL;
       
 11459 
       
 11460         {
       
 11461             identifier_c param_name("IN");
       
 11462             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11463             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11464             
       
 11465             /* Get the value from a foo(<param_value>) style call */
       
 11466             if (IN_param_value == NULL)
       
 11467               IN_param_value = function_call_param_iterator.next();
       
 11468             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11469             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11470             
       
 11471             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11472             {
       
 11473         
       
 11474                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 11475                 s4o.print("(");
       
 11476                 return_type_symbol->accept(*this);
       
 11477                 s4o.print(")real_to_time(");
       
 11478                 IN_param_value->accept(*this);
       
 11479                 s4o.print(")");
       
 11480                 return NULL;
       
 11481                 
       
 11482             }
       
 11483             
       
 11484             ERROR;
       
 11485         }
       
 11486         
       
 11487     }/*function_lword_to_tod*/
       
 11488     break;
       
 11489 
       
 11490 /****
       
 11491  *LWORD_TO_DT
       
 11492  */
       
 11493     case function_lword_to_dt :
       
 11494     {
       
 11495         symbol_c *last_type_symbol = NULL;
       
 11496 
       
 11497         {
       
 11498             identifier_c param_name("IN");
       
 11499             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11500             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11501             
       
 11502             /* Get the value from a foo(<param_value>) style call */
       
 11503             if (IN_param_value == NULL)
       
 11504               IN_param_value = function_call_param_iterator.next();
       
 11505             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11506             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11507             
       
 11508             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
       
 11509             {
       
 11510         
       
 11511                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 11512                 s4o.print("(");
       
 11513                 return_type_symbol->accept(*this);
       
 11514                 s4o.print(")real_to_time(");
       
 11515                 IN_param_value->accept(*this);
       
 11516                 s4o.print(")");
       
 11517                 return NULL;
       
 11518                 
       
 11519             }
       
 11520             
       
 11521             ERROR;
       
 11522         }
       
 11523         
       
 11524     }/*function_lword_to_dt*/
       
 11525     break;
       
 11526 
       
 11527 /****
       
 11528  *STRING_TO_REAL
       
 11529  */
       
 11530     case function_string_to_real :
       
 11531     {
       
 11532         symbol_c *last_type_symbol = NULL;
       
 11533 
       
 11534         {
       
 11535             identifier_c param_name("IN");
       
 11536             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11537             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11538             
       
 11539             /* Get the value from a foo(<param_value>) style call */
       
 11540             if (IN_param_value == NULL)
       
 11541               IN_param_value = function_call_param_iterator.next();
       
 11542             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11543             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11544             
       
 11545             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11546             {
       
 11547         
       
 11548                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 11549                 s4o.print("(");
       
 11550                 return_type_symbol->accept(*this);
       
 11551                 s4o.print(")string_to_int(");
       
 11552                 IN_param_value->accept(*this);
       
 11553                 s4o.print(", 10)");
       
 11554                 return NULL;
       
 11555                 
       
 11556             }
       
 11557             
       
 11558             ERROR;
       
 11559         }
       
 11560         
       
 11561     }/*function_string_to_real*/
       
 11562     break;
       
 11563 
       
 11564 /****
       
 11565  *STRING_TO_LREAL
       
 11566  */
       
 11567     case function_string_to_lreal :
       
 11568     {
       
 11569         symbol_c *last_type_symbol = NULL;
       
 11570 
       
 11571         {
       
 11572             identifier_c param_name("IN");
       
 11573             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11574             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11575             
       
 11576             /* Get the value from a foo(<param_value>) style call */
       
 11577             if (IN_param_value == NULL)
       
 11578               IN_param_value = function_call_param_iterator.next();
       
 11579             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11580             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11581             
       
 11582             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11583             {
       
 11584         
       
 11585                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 11586                 s4o.print("(");
       
 11587                 return_type_symbol->accept(*this);
       
 11588                 s4o.print(")string_to_int(");
       
 11589                 IN_param_value->accept(*this);
       
 11590                 s4o.print(", 10)");
       
 11591                 return NULL;
       
 11592                 
       
 11593             }
       
 11594             
       
 11595             ERROR;
       
 11596         }
       
 11597         
       
 11598     }/*function_string_to_lreal*/
       
 11599     break;
       
 11600 
       
 11601 /****
       
 11602  *STRING_TO_SINT
       
 11603  */
       
 11604     case function_string_to_sint :
       
 11605     {
       
 11606         symbol_c *last_type_symbol = NULL;
       
 11607 
       
 11608         {
       
 11609             identifier_c param_name("IN");
       
 11610             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11611             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11612             
       
 11613             /* Get the value from a foo(<param_value>) style call */
       
 11614             if (IN_param_value == NULL)
       
 11615               IN_param_value = function_call_param_iterator.next();
       
 11616             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11617             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11618             
       
 11619             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11620             {
       
 11621         
       
 11622                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 11623                 s4o.print("(");
       
 11624                 return_type_symbol->accept(*this);
       
 11625                 s4o.print(")string_to_int(");
       
 11626                 IN_param_value->accept(*this);
       
 11627                 s4o.print(", 10)");
       
 11628                 return NULL;
       
 11629                 
       
 11630             }
       
 11631             
       
 11632             ERROR;
       
 11633         }
       
 11634         
       
 11635     }/*function_string_to_sint*/
       
 11636     break;
       
 11637 
       
 11638 /****
       
 11639  *STRING_TO_INT
       
 11640  */
       
 11641     case function_string_to_int :
       
 11642     {
       
 11643         symbol_c *last_type_symbol = NULL;
       
 11644 
       
 11645         {
       
 11646             identifier_c param_name("IN");
       
 11647             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11648             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11649             
       
 11650             /* Get the value from a foo(<param_value>) style call */
       
 11651             if (IN_param_value == NULL)
       
 11652               IN_param_value = function_call_param_iterator.next();
       
 11653             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11654             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11655             
       
 11656             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11657             {
       
 11658         
       
 11659                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 11660                 s4o.print("(");
       
 11661                 return_type_symbol->accept(*this);
       
 11662                 s4o.print(")string_to_int(");
       
 11663                 IN_param_value->accept(*this);
       
 11664                 s4o.print(", 10)");
       
 11665                 return NULL;
       
 11666                 
       
 11667             }
       
 11668             
       
 11669             ERROR;
       
 11670         }
       
 11671         
       
 11672     }/*function_string_to_int*/
       
 11673     break;
       
 11674 
       
 11675 /****
       
 11676  *STRING_TO_DINT
       
 11677  */
       
 11678     case function_string_to_dint :
       
 11679     {
       
 11680         symbol_c *last_type_symbol = NULL;
       
 11681 
       
 11682         {
       
 11683             identifier_c param_name("IN");
       
 11684             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11685             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11686             
       
 11687             /* Get the value from a foo(<param_value>) style call */
       
 11688             if (IN_param_value == NULL)
       
 11689               IN_param_value = function_call_param_iterator.next();
       
 11690             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11691             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11692             
       
 11693             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11694             {
       
 11695         
       
 11696                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 11697                 s4o.print("(");
       
 11698                 return_type_symbol->accept(*this);
       
 11699                 s4o.print(")string_to_int(");
       
 11700                 IN_param_value->accept(*this);
       
 11701                 s4o.print(", 10)");
       
 11702                 return NULL;
       
 11703                 
       
 11704             }
       
 11705             
       
 11706             ERROR;
       
 11707         }
       
 11708         
       
 11709     }/*function_string_to_dint*/
       
 11710     break;
       
 11711 
       
 11712 /****
       
 11713  *STRING_TO_LINT
       
 11714  */
       
 11715     case function_string_to_lint :
       
 11716     {
       
 11717         symbol_c *last_type_symbol = NULL;
       
 11718 
       
 11719         {
       
 11720             identifier_c param_name("IN");
       
 11721             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11722             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11723             
       
 11724             /* Get the value from a foo(<param_value>) style call */
       
 11725             if (IN_param_value == NULL)
       
 11726               IN_param_value = function_call_param_iterator.next();
       
 11727             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11728             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11729             
       
 11730             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11731             {
       
 11732         
       
 11733                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 11734                 s4o.print("(");
       
 11735                 return_type_symbol->accept(*this);
       
 11736                 s4o.print(")string_to_int(");
       
 11737                 IN_param_value->accept(*this);
       
 11738                 s4o.print(", 10)");
       
 11739                 return NULL;
       
 11740                 
       
 11741             }
       
 11742             
       
 11743             ERROR;
       
 11744         }
       
 11745         
       
 11746     }/*function_string_to_lint*/
       
 11747     break;
       
 11748 
       
 11749 /****
       
 11750  *STRING_TO_USINT
       
 11751  */
       
 11752     case function_string_to_usint :
       
 11753     {
       
 11754         symbol_c *last_type_symbol = NULL;
       
 11755 
       
 11756         {
       
 11757             identifier_c param_name("IN");
       
 11758             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11759             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11760             
       
 11761             /* Get the value from a foo(<param_value>) style call */
       
 11762             if (IN_param_value == NULL)
       
 11763               IN_param_value = function_call_param_iterator.next();
       
 11764             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11765             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11766             
       
 11767             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11768             {
       
 11769         
       
 11770                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 11771                 s4o.print("(");
       
 11772                 return_type_symbol->accept(*this);
       
 11773                 s4o.print(")string_to_int(");
       
 11774                 IN_param_value->accept(*this);
       
 11775                 s4o.print(", 10)");
       
 11776                 return NULL;
       
 11777                 
       
 11778             }
       
 11779             
       
 11780             ERROR;
       
 11781         }
       
 11782         
       
 11783     }/*function_string_to_usint*/
       
 11784     break;
       
 11785 
       
 11786 /****
       
 11787  *STRING_TO_UINT
       
 11788  */
       
 11789     case function_string_to_uint :
       
 11790     {
       
 11791         symbol_c *last_type_symbol = NULL;
       
 11792 
       
 11793         {
       
 11794             identifier_c param_name("IN");
       
 11795             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11796             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11797             
       
 11798             /* Get the value from a foo(<param_value>) style call */
       
 11799             if (IN_param_value == NULL)
       
 11800               IN_param_value = function_call_param_iterator.next();
       
 11801             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11802             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11803             
       
 11804             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11805             {
       
 11806         
       
 11807                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 11808                 s4o.print("(");
       
 11809                 return_type_symbol->accept(*this);
       
 11810                 s4o.print(")string_to_int(");
       
 11811                 IN_param_value->accept(*this);
       
 11812                 s4o.print(", 10)");
       
 11813                 return NULL;
       
 11814                 
       
 11815             }
       
 11816             
       
 11817             ERROR;
       
 11818         }
       
 11819         
       
 11820     }/*function_string_to_uint*/
       
 11821     break;
       
 11822 
       
 11823 /****
       
 11824  *STRING_TO_UDINT
       
 11825  */
       
 11826     case function_string_to_udint :
       
 11827     {
       
 11828         symbol_c *last_type_symbol = NULL;
       
 11829 
       
 11830         {
       
 11831             identifier_c param_name("IN");
       
 11832             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11833             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11834             
       
 11835             /* Get the value from a foo(<param_value>) style call */
       
 11836             if (IN_param_value == NULL)
       
 11837               IN_param_value = function_call_param_iterator.next();
       
 11838             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11839             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11840             
       
 11841             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11842             {
       
 11843         
       
 11844                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 11845                 s4o.print("(");
       
 11846                 return_type_symbol->accept(*this);
       
 11847                 s4o.print(")string_to_int(");
       
 11848                 IN_param_value->accept(*this);
       
 11849                 s4o.print(", 10)");
       
 11850                 return NULL;
       
 11851                 
       
 11852             }
       
 11853             
       
 11854             ERROR;
       
 11855         }
       
 11856         
       
 11857     }/*function_string_to_udint*/
       
 11858     break;
       
 11859 
       
 11860 /****
       
 11861  *STRING_TO_ULINT
       
 11862  */
       
 11863     case function_string_to_ulint :
       
 11864     {
       
 11865         symbol_c *last_type_symbol = NULL;
       
 11866 
       
 11867         {
       
 11868             identifier_c param_name("IN");
       
 11869             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11870             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11871             
       
 11872             /* Get the value from a foo(<param_value>) style call */
       
 11873             if (IN_param_value == NULL)
       
 11874               IN_param_value = function_call_param_iterator.next();
       
 11875             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11876             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11877             
       
 11878             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11879             {
       
 11880         
       
 11881                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 11882                 s4o.print("(");
       
 11883                 return_type_symbol->accept(*this);
       
 11884                 s4o.print(")string_to_int(");
       
 11885                 IN_param_value->accept(*this);
       
 11886                 s4o.print(", 10)");
       
 11887                 return NULL;
       
 11888                 
       
 11889             }
       
 11890             
       
 11891             ERROR;
       
 11892         }
       
 11893         
       
 11894     }/*function_string_to_ulint*/
       
 11895     break;
       
 11896 
       
 11897 /****
       
 11898  *STRING_TO_TIME
       
 11899  */
       
 11900     case function_string_to_time :
       
 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 (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11916             {
       
 11917         
       
 11918                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 11919                 s4o.print("(");
       
 11920                 return_type_symbol->accept(*this);
       
 11921                 s4o.print(")string_to_time(");
       
 11922                 IN_param_value->accept(*this);
       
 11923                 s4o.print(")");
       
 11924                 return NULL;
       
 11925                 
       
 11926             }
       
 11927             
       
 11928             ERROR;
       
 11929         }
       
 11930         
       
 11931     }/*function_string_to_time*/
       
 11932     break;
       
 11933 
       
 11934 /****
       
 11935  *STRING_TO_BOOL
       
 11936  */
       
 11937     case function_string_to_bool :
       
 11938     {
       
 11939         symbol_c *last_type_symbol = NULL;
       
 11940 
       
 11941         {
       
 11942             identifier_c param_name("IN");
       
 11943             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11944             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11945             
       
 11946             /* Get the value from a foo(<param_value>) style call */
       
 11947             if (IN_param_value == NULL)
       
 11948               IN_param_value = function_call_param_iterator.next();
       
 11949             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11950             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11951             
       
 11952             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11953             {
       
 11954         
       
 11955                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 11956                 s4o.print("(");
       
 11957                 return_type_symbol->accept(*this);
       
 11958                 s4o.print(")string_to_int(");
       
 11959                 IN_param_value->accept(*this);
       
 11960                 s4o.print(", 16)");
       
 11961                 return NULL;
       
 11962                 
       
 11963             }
       
 11964             
       
 11965             ERROR;
       
 11966         }
       
 11967         
       
 11968     }/*function_string_to_bool*/
       
 11969     break;
       
 11970 
       
 11971 /****
       
 11972  *STRING_TO_BYTE
       
 11973  */
       
 11974     case function_string_to_byte :
       
 11975     {
       
 11976         symbol_c *last_type_symbol = NULL;
       
 11977 
       
 11978         {
       
 11979             identifier_c param_name("IN");
       
 11980             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 11981             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 11982             
       
 11983             /* Get the value from a foo(<param_value>) style call */
       
 11984             if (IN_param_value == NULL)
       
 11985               IN_param_value = function_call_param_iterator.next();
       
 11986             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 11987             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 11988             
       
 11989             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 11990             {
       
 11991         
       
 11992                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 11993                 s4o.print("(");
       
 11994                 return_type_symbol->accept(*this);
       
 11995                 s4o.print(")string_to_int(");
       
 11996                 IN_param_value->accept(*this);
       
 11997                 s4o.print(", 16)");
       
 11998                 return NULL;
       
 11999                 
       
 12000             }
       
 12001             
       
 12002             ERROR;
       
 12003         }
       
 12004         
       
 12005     }/*function_string_to_byte*/
       
 12006     break;
       
 12007 
       
 12008 /****
       
 12009  *STRING_TO_WORD
       
 12010  */
       
 12011     case function_string_to_word :
       
 12012     {
       
 12013         symbol_c *last_type_symbol = NULL;
       
 12014 
       
 12015         {
       
 12016             identifier_c param_name("IN");
       
 12017             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12018             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12019             
       
 12020             /* Get the value from a foo(<param_value>) style call */
       
 12021             if (IN_param_value == NULL)
       
 12022               IN_param_value = function_call_param_iterator.next();
       
 12023             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12024             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12025             
       
 12026             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 12027             {
       
 12028         
       
 12029                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 12030                 s4o.print("(");
       
 12031                 return_type_symbol->accept(*this);
       
 12032                 s4o.print(")string_to_int(");
       
 12033                 IN_param_value->accept(*this);
       
 12034                 s4o.print(", 16)");
       
 12035                 return NULL;
       
 12036                 
       
 12037             }
       
 12038             
       
 12039             ERROR;
       
 12040         }
       
 12041         
       
 12042     }/*function_string_to_word*/
       
 12043     break;
       
 12044 
       
 12045 /****
       
 12046  *STRING_TO_DWORD
       
 12047  */
       
 12048     case function_string_to_dword :
       
 12049     {
       
 12050         symbol_c *last_type_symbol = NULL;
       
 12051 
       
 12052         {
       
 12053             identifier_c param_name("IN");
       
 12054             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12055             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12056             
       
 12057             /* Get the value from a foo(<param_value>) style call */
       
 12058             if (IN_param_value == NULL)
       
 12059               IN_param_value = function_call_param_iterator.next();
       
 12060             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12061             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12062             
       
 12063             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 12064             {
       
 12065         
       
 12066                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 12067                 s4o.print("(");
       
 12068                 return_type_symbol->accept(*this);
       
 12069                 s4o.print(")string_to_int(");
       
 12070                 IN_param_value->accept(*this);
       
 12071                 s4o.print(", 16)");
       
 12072                 return NULL;
       
 12073                 
       
 12074             }
       
 12075             
       
 12076             ERROR;
       
 12077         }
       
 12078         
       
 12079     }/*function_string_to_dword*/
       
 12080     break;
       
 12081 
       
 12082 /****
       
 12083  *STRING_TO_LWORD
       
 12084  */
       
 12085     case function_string_to_lword :
       
 12086     {
       
 12087         symbol_c *last_type_symbol = NULL;
       
 12088 
       
 12089         {
       
 12090             identifier_c param_name("IN");
       
 12091             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12092             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12093             
       
 12094             /* Get the value from a foo(<param_value>) style call */
       
 12095             if (IN_param_value == NULL)
       
 12096               IN_param_value = function_call_param_iterator.next();
       
 12097             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12098             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12099             
       
 12100             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 12101             {
       
 12102         
       
 12103                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 12104                 s4o.print("(");
       
 12105                 return_type_symbol->accept(*this);
       
 12106                 s4o.print(")string_to_int(");
       
 12107                 IN_param_value->accept(*this);
       
 12108                 s4o.print(", 16)");
       
 12109                 return NULL;
       
 12110                 
       
 12111             }
       
 12112             
       
 12113             ERROR;
       
 12114         }
       
 12115         
       
 12116     }/*function_string_to_lword*/
       
 12117     break;
       
 12118 
       
 12119 /****
       
 12120  *STRING_TO_DATE
       
 12121  */
       
 12122     case function_string_to_date :
       
 12123     {
       
 12124         symbol_c *last_type_symbol = NULL;
       
 12125 
       
 12126         {
       
 12127             identifier_c param_name("IN");
       
 12128             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12129             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12130             
       
 12131             /* Get the value from a foo(<param_value>) style call */
       
 12132             if (IN_param_value == NULL)
       
 12133               IN_param_value = function_call_param_iterator.next();
       
 12134             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12135             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12136             
       
 12137             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 12138             {
       
 12139         
       
 12140                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 12141                 s4o.print("(");
       
 12142                 return_type_symbol->accept(*this);
       
 12143                 s4o.print(")string_to_time(");
       
 12144                 IN_param_value->accept(*this);
       
 12145                 s4o.print(")");
       
 12146                 return NULL;
       
 12147                 
       
 12148             }
       
 12149             
       
 12150             ERROR;
       
 12151         }
       
 12152         
       
 12153     }/*function_string_to_date*/
       
 12154     break;
       
 12155 
       
 12156 /****
       
 12157  *STRING_TO_TOD
       
 12158  */
       
 12159     case function_string_to_tod :
       
 12160     {
       
 12161         symbol_c *last_type_symbol = NULL;
       
 12162 
       
 12163         {
       
 12164             identifier_c param_name("IN");
       
 12165             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12166             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12167             
       
 12168             /* Get the value from a foo(<param_value>) style call */
       
 12169             if (IN_param_value == NULL)
       
 12170               IN_param_value = function_call_param_iterator.next();
       
 12171             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12172             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12173             
       
 12174             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 12175             {
       
 12176         
       
 12177                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 12178                 s4o.print("(");
       
 12179                 return_type_symbol->accept(*this);
       
 12180                 s4o.print(")string_to_time(");
       
 12181                 IN_param_value->accept(*this);
       
 12182                 s4o.print(")");
       
 12183                 return NULL;
       
 12184                 
       
 12185             }
       
 12186             
       
 12187             ERROR;
       
 12188         }
       
 12189         
       
 12190     }/*function_string_to_tod*/
       
 12191     break;
       
 12192 
       
 12193 /****
       
 12194  *STRING_TO_DT
       
 12195  */
       
 12196     case function_string_to_dt :
       
 12197     {
       
 12198         symbol_c *last_type_symbol = NULL;
       
 12199 
       
 12200         {
       
 12201             identifier_c param_name("IN");
       
 12202             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12203             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12204             
       
 12205             /* Get the value from a foo(<param_value>) style call */
       
 12206             if (IN_param_value == NULL)
       
 12207               IN_param_value = function_call_param_iterator.next();
       
 12208             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12209             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12210             
       
 12211             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
       
 12212             {
       
 12213         
       
 12214                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 12215                 s4o.print("(");
       
 12216                 return_type_symbol->accept(*this);
       
 12217                 s4o.print(")string_to_time(");
       
 12218                 IN_param_value->accept(*this);
       
 12219                 s4o.print(")");
       
 12220                 return NULL;
       
 12221                 
       
 12222             }
       
 12223             
       
 12224             ERROR;
       
 12225         }
       
 12226         
       
 12227     }/*function_string_to_dt*/
       
 12228     break;
       
 12229 
       
 12230 /****
       
 12231  *WSTRING_TO_REAL
       
 12232  */
       
 12233     case function_wstring_to_real :
       
 12234     {
       
 12235         symbol_c *last_type_symbol = NULL;
       
 12236 
       
 12237         {
       
 12238             identifier_c param_name("IN");
       
 12239             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12240             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12241             
       
 12242             /* Get the value from a foo(<param_value>) style call */
       
 12243             if (IN_param_value == NULL)
       
 12244               IN_param_value = function_call_param_iterator.next();
       
 12245             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12246             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12247             
       
 12248             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12249             {
       
 12250         
       
 12251                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 12252                 s4o.print("(");
       
 12253                 return_type_symbol->accept(*this);
       
 12254                 s4o.print(")string_to_int(");
       
 12255                 IN_param_value->accept(*this);
       
 12256                 s4o.print(", 10)");
       
 12257                 return NULL;
       
 12258                 
       
 12259             }
       
 12260             
       
 12261             ERROR;
       
 12262         }
       
 12263         
       
 12264     }/*function_wstring_to_real*/
       
 12265     break;
       
 12266 
       
 12267 /****
       
 12268  *WSTRING_TO_LREAL
       
 12269  */
       
 12270     case function_wstring_to_lreal :
       
 12271     {
       
 12272         symbol_c *last_type_symbol = NULL;
       
 12273 
       
 12274         {
       
 12275             identifier_c param_name("IN");
       
 12276             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12277             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12278             
       
 12279             /* Get the value from a foo(<param_value>) style call */
       
 12280             if (IN_param_value == NULL)
       
 12281               IN_param_value = function_call_param_iterator.next();
       
 12282             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12283             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12284             
       
 12285             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12286             {
       
 12287         
       
 12288                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 12289                 s4o.print("(");
       
 12290                 return_type_symbol->accept(*this);
       
 12291                 s4o.print(")string_to_int(");
       
 12292                 IN_param_value->accept(*this);
       
 12293                 s4o.print(", 10)");
       
 12294                 return NULL;
       
 12295                 
       
 12296             }
       
 12297             
       
 12298             ERROR;
       
 12299         }
       
 12300         
       
 12301     }/*function_wstring_to_lreal*/
       
 12302     break;
       
 12303 
       
 12304 /****
       
 12305  *WSTRING_TO_SINT
       
 12306  */
       
 12307     case function_wstring_to_sint :
       
 12308     {
       
 12309         symbol_c *last_type_symbol = NULL;
       
 12310 
       
 12311         {
       
 12312             identifier_c param_name("IN");
       
 12313             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12314             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12315             
       
 12316             /* Get the value from a foo(<param_value>) style call */
       
 12317             if (IN_param_value == NULL)
       
 12318               IN_param_value = function_call_param_iterator.next();
       
 12319             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12320             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12321             
       
 12322             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12323             {
       
 12324         
       
 12325                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 12326                 s4o.print("(");
       
 12327                 return_type_symbol->accept(*this);
       
 12328                 s4o.print(")string_to_int(");
       
 12329                 IN_param_value->accept(*this);
       
 12330                 s4o.print(", 10)");
       
 12331                 return NULL;
       
 12332                 
       
 12333             }
       
 12334             
       
 12335             ERROR;
       
 12336         }
       
 12337         
       
 12338     }/*function_wstring_to_sint*/
       
 12339     break;
       
 12340 
       
 12341 /****
       
 12342  *WSTRING_TO_INT
       
 12343  */
       
 12344     case function_wstring_to_int :
       
 12345     {
       
 12346         symbol_c *last_type_symbol = NULL;
       
 12347 
       
 12348         {
       
 12349             identifier_c param_name("IN");
       
 12350             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12351             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12352             
       
 12353             /* Get the value from a foo(<param_value>) style call */
       
 12354             if (IN_param_value == NULL)
       
 12355               IN_param_value = function_call_param_iterator.next();
       
 12356             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12357             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12358             
       
 12359             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12360             {
       
 12361         
       
 12362                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 12363                 s4o.print("(");
       
 12364                 return_type_symbol->accept(*this);
       
 12365                 s4o.print(")string_to_int(");
       
 12366                 IN_param_value->accept(*this);
       
 12367                 s4o.print(", 10)");
       
 12368                 return NULL;
       
 12369                 
       
 12370             }
       
 12371             
       
 12372             ERROR;
       
 12373         }
       
 12374         
       
 12375     }/*function_wstring_to_int*/
       
 12376     break;
       
 12377 
       
 12378 /****
       
 12379  *WSTRING_TO_DINT
       
 12380  */
       
 12381     case function_wstring_to_dint :
       
 12382     {
       
 12383         symbol_c *last_type_symbol = NULL;
       
 12384 
       
 12385         {
       
 12386             identifier_c param_name("IN");
       
 12387             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12388             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12389             
       
 12390             /* Get the value from a foo(<param_value>) style call */
       
 12391             if (IN_param_value == NULL)
       
 12392               IN_param_value = function_call_param_iterator.next();
       
 12393             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12394             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12395             
       
 12396             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12397             {
       
 12398         
       
 12399                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 12400                 s4o.print("(");
       
 12401                 return_type_symbol->accept(*this);
       
 12402                 s4o.print(")string_to_int(");
       
 12403                 IN_param_value->accept(*this);
       
 12404                 s4o.print(", 10)");
       
 12405                 return NULL;
       
 12406                 
       
 12407             }
       
 12408             
       
 12409             ERROR;
       
 12410         }
       
 12411         
       
 12412     }/*function_wstring_to_dint*/
       
 12413     break;
       
 12414 
       
 12415 /****
       
 12416  *WSTRING_TO_LINT
       
 12417  */
       
 12418     case function_wstring_to_lint :
       
 12419     {
       
 12420         symbol_c *last_type_symbol = NULL;
       
 12421 
       
 12422         {
       
 12423             identifier_c param_name("IN");
       
 12424             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12425             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12426             
       
 12427             /* Get the value from a foo(<param_value>) style call */
       
 12428             if (IN_param_value == NULL)
       
 12429               IN_param_value = function_call_param_iterator.next();
       
 12430             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12431             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12432             
       
 12433             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12434             {
       
 12435         
       
 12436                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 12437                 s4o.print("(");
       
 12438                 return_type_symbol->accept(*this);
       
 12439                 s4o.print(")string_to_int(");
       
 12440                 IN_param_value->accept(*this);
       
 12441                 s4o.print(", 10)");
       
 12442                 return NULL;
       
 12443                 
       
 12444             }
       
 12445             
       
 12446             ERROR;
       
 12447         }
       
 12448         
       
 12449     }/*function_wstring_to_lint*/
       
 12450     break;
       
 12451 
       
 12452 /****
       
 12453  *WSTRING_TO_USINT
       
 12454  */
       
 12455     case function_wstring_to_usint :
       
 12456     {
       
 12457         symbol_c *last_type_symbol = NULL;
       
 12458 
       
 12459         {
       
 12460             identifier_c param_name("IN");
       
 12461             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12462             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12463             
       
 12464             /* Get the value from a foo(<param_value>) style call */
       
 12465             if (IN_param_value == NULL)
       
 12466               IN_param_value = function_call_param_iterator.next();
       
 12467             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12468             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12469             
       
 12470             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12471             {
       
 12472         
       
 12473                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 12474                 s4o.print("(");
       
 12475                 return_type_symbol->accept(*this);
       
 12476                 s4o.print(")string_to_int(");
       
 12477                 IN_param_value->accept(*this);
       
 12478                 s4o.print(", 10)");
       
 12479                 return NULL;
       
 12480                 
       
 12481             }
       
 12482             
       
 12483             ERROR;
       
 12484         }
       
 12485         
       
 12486     }/*function_wstring_to_usint*/
       
 12487     break;
       
 12488 
       
 12489 /****
       
 12490  *WSTRING_TO_UINT
       
 12491  */
       
 12492     case function_wstring_to_uint :
       
 12493     {
       
 12494         symbol_c *last_type_symbol = NULL;
       
 12495 
       
 12496         {
       
 12497             identifier_c param_name("IN");
       
 12498             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12499             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12500             
       
 12501             /* Get the value from a foo(<param_value>) style call */
       
 12502             if (IN_param_value == NULL)
       
 12503               IN_param_value = function_call_param_iterator.next();
       
 12504             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12505             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12506             
       
 12507             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12508             {
       
 12509         
       
 12510                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 12511                 s4o.print("(");
       
 12512                 return_type_symbol->accept(*this);
       
 12513                 s4o.print(")string_to_int(");
       
 12514                 IN_param_value->accept(*this);
       
 12515                 s4o.print(", 10)");
       
 12516                 return NULL;
       
 12517                 
       
 12518             }
       
 12519             
       
 12520             ERROR;
       
 12521         }
       
 12522         
       
 12523     }/*function_wstring_to_uint*/
       
 12524     break;
       
 12525 
       
 12526 /****
       
 12527  *WSTRING_TO_UDINT
       
 12528  */
       
 12529     case function_wstring_to_udint :
       
 12530     {
       
 12531         symbol_c *last_type_symbol = NULL;
       
 12532 
       
 12533         {
       
 12534             identifier_c param_name("IN");
       
 12535             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12536             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12537             
       
 12538             /* Get the value from a foo(<param_value>) style call */
       
 12539             if (IN_param_value == NULL)
       
 12540               IN_param_value = function_call_param_iterator.next();
       
 12541             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12542             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12543             
       
 12544             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12545             {
       
 12546         
       
 12547                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 12548                 s4o.print("(");
       
 12549                 return_type_symbol->accept(*this);
       
 12550                 s4o.print(")string_to_int(");
       
 12551                 IN_param_value->accept(*this);
       
 12552                 s4o.print(", 10)");
       
 12553                 return NULL;
       
 12554                 
       
 12555             }
       
 12556             
       
 12557             ERROR;
       
 12558         }
       
 12559         
       
 12560     }/*function_wstring_to_udint*/
       
 12561     break;
       
 12562 
       
 12563 /****
       
 12564  *WSTRING_TO_ULINT
       
 12565  */
       
 12566     case function_wstring_to_ulint :
       
 12567     {
       
 12568         symbol_c *last_type_symbol = NULL;
       
 12569 
       
 12570         {
       
 12571             identifier_c param_name("IN");
       
 12572             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12573             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12574             
       
 12575             /* Get the value from a foo(<param_value>) style call */
       
 12576             if (IN_param_value == NULL)
       
 12577               IN_param_value = function_call_param_iterator.next();
       
 12578             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12579             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12580             
       
 12581             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12582             {
       
 12583         
       
 12584                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 12585                 s4o.print("(");
       
 12586                 return_type_symbol->accept(*this);
       
 12587                 s4o.print(")string_to_int(");
       
 12588                 IN_param_value->accept(*this);
       
 12589                 s4o.print(", 10)");
       
 12590                 return NULL;
       
 12591                 
       
 12592             }
       
 12593             
       
 12594             ERROR;
       
 12595         }
       
 12596         
       
 12597     }/*function_wstring_to_ulint*/
       
 12598     break;
       
 12599 
       
 12600 /****
       
 12601  *WSTRING_TO_TIME
       
 12602  */
       
 12603     case function_wstring_to_time :
       
 12604     {
       
 12605         symbol_c *last_type_symbol = NULL;
       
 12606 
       
 12607         {
       
 12608             identifier_c param_name("IN");
       
 12609             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12610             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12611             
       
 12612             /* Get the value from a foo(<param_value>) style call */
       
 12613             if (IN_param_value == NULL)
       
 12614               IN_param_value = function_call_param_iterator.next();
       
 12615             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12616             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12617             
       
 12618             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12619             {
       
 12620         
       
 12621                 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
       
 12622                 s4o.print("(");
       
 12623                 return_type_symbol->accept(*this);
       
 12624                 s4o.print(")string_to_time(");
       
 12625                 IN_param_value->accept(*this);
       
 12626                 s4o.print(")");
       
 12627                 return NULL;
       
 12628                 
       
 12629             }
       
 12630             
       
 12631             ERROR;
       
 12632         }
       
 12633         
       
 12634     }/*function_wstring_to_time*/
       
 12635     break;
       
 12636 
       
 12637 /****
       
 12638  *WSTRING_TO_BOOL
       
 12639  */
       
 12640     case function_wstring_to_bool :
       
 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 (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12656             {
       
 12657         
       
 12658                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 12659                 s4o.print("(");
       
 12660                 return_type_symbol->accept(*this);
       
 12661                 s4o.print(")string_to_int(");
       
 12662                 IN_param_value->accept(*this);
       
 12663                 s4o.print(", 16)");
       
 12664                 return NULL;
       
 12665                 
       
 12666             }
       
 12667             
       
 12668             ERROR;
       
 12669         }
       
 12670         
       
 12671     }/*function_wstring_to_bool*/
       
 12672     break;
       
 12673 
       
 12674 /****
       
 12675  *WSTRING_TO_BYTE
       
 12676  */
       
 12677     case function_wstring_to_byte :
       
 12678     {
       
 12679         symbol_c *last_type_symbol = NULL;
       
 12680 
       
 12681         {
       
 12682             identifier_c param_name("IN");
       
 12683             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12684             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12685             
       
 12686             /* Get the value from a foo(<param_value>) style call */
       
 12687             if (IN_param_value == NULL)
       
 12688               IN_param_value = function_call_param_iterator.next();
       
 12689             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12690             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12691             
       
 12692             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12693             {
       
 12694         
       
 12695                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 12696                 s4o.print("(");
       
 12697                 return_type_symbol->accept(*this);
       
 12698                 s4o.print(")string_to_int(");
       
 12699                 IN_param_value->accept(*this);
       
 12700                 s4o.print(", 16)");
       
 12701                 return NULL;
       
 12702                 
       
 12703             }
       
 12704             
       
 12705             ERROR;
       
 12706         }
       
 12707         
       
 12708     }/*function_wstring_to_byte*/
       
 12709     break;
       
 12710 
       
 12711 /****
       
 12712  *WSTRING_TO_WORD
       
 12713  */
       
 12714     case function_wstring_to_word :
       
 12715     {
       
 12716         symbol_c *last_type_symbol = NULL;
       
 12717 
       
 12718         {
       
 12719             identifier_c param_name("IN");
       
 12720             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12721             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12722             
       
 12723             /* Get the value from a foo(<param_value>) style call */
       
 12724             if (IN_param_value == NULL)
       
 12725               IN_param_value = function_call_param_iterator.next();
       
 12726             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12727             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12728             
       
 12729             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12730             {
       
 12731         
       
 12732                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 12733                 s4o.print("(");
       
 12734                 return_type_symbol->accept(*this);
       
 12735                 s4o.print(")string_to_int(");
       
 12736                 IN_param_value->accept(*this);
       
 12737                 s4o.print(", 16)");
       
 12738                 return NULL;
       
 12739                 
       
 12740             }
       
 12741             
       
 12742             ERROR;
       
 12743         }
       
 12744         
       
 12745     }/*function_wstring_to_word*/
       
 12746     break;
       
 12747 
       
 12748 /****
       
 12749  *WSTRING_TO_DWORD
       
 12750  */
       
 12751     case function_wstring_to_dword :
       
 12752     {
       
 12753         symbol_c *last_type_symbol = NULL;
       
 12754 
       
 12755         {
       
 12756             identifier_c param_name("IN");
       
 12757             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12758             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12759             
       
 12760             /* Get the value from a foo(<param_value>) style call */
       
 12761             if (IN_param_value == NULL)
       
 12762               IN_param_value = function_call_param_iterator.next();
       
 12763             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12764             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12765             
       
 12766             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12767             {
       
 12768         
       
 12769                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 12770                 s4o.print("(");
       
 12771                 return_type_symbol->accept(*this);
       
 12772                 s4o.print(")string_to_int(");
       
 12773                 IN_param_value->accept(*this);
       
 12774                 s4o.print(", 16)");
       
 12775                 return NULL;
       
 12776                 
       
 12777             }
       
 12778             
       
 12779             ERROR;
       
 12780         }
       
 12781         
       
 12782     }/*function_wstring_to_dword*/
       
 12783     break;
       
 12784 
       
 12785 /****
       
 12786  *WSTRING_TO_LWORD
       
 12787  */
       
 12788     case function_wstring_to_lword :
       
 12789     {
       
 12790         symbol_c *last_type_symbol = NULL;
       
 12791 
       
 12792         {
       
 12793             identifier_c param_name("IN");
       
 12794             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12795             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12796             
       
 12797             /* Get the value from a foo(<param_value>) style call */
       
 12798             if (IN_param_value == NULL)
       
 12799               IN_param_value = function_call_param_iterator.next();
       
 12800             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12801             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12802             
       
 12803             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12804             {
       
 12805         
       
 12806                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 12807                 s4o.print("(");
       
 12808                 return_type_symbol->accept(*this);
       
 12809                 s4o.print(")string_to_int(");
       
 12810                 IN_param_value->accept(*this);
       
 12811                 s4o.print(", 16)");
       
 12812                 return NULL;
       
 12813                 
       
 12814             }
       
 12815             
       
 12816             ERROR;
       
 12817         }
       
 12818         
       
 12819     }/*function_wstring_to_lword*/
       
 12820     break;
       
 12821 
       
 12822 /****
       
 12823  *WSTRING_TO_DATE
       
 12824  */
       
 12825     case function_wstring_to_date :
       
 12826     {
       
 12827         symbol_c *last_type_symbol = NULL;
       
 12828 
       
 12829         {
       
 12830             identifier_c param_name("IN");
       
 12831             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12832             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12833             
       
 12834             /* Get the value from a foo(<param_value>) style call */
       
 12835             if (IN_param_value == NULL)
       
 12836               IN_param_value = function_call_param_iterator.next();
       
 12837             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12838             last_type_symbol = last_type_symbol && search_expression_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             
       
 12840             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12841             {
       
 12842         
       
 12843                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
       
 12844                 s4o.print("(");
       
 12845                 return_type_symbol->accept(*this);
       
 12846                 s4o.print(")string_to_time(");
       
 12847                 IN_param_value->accept(*this);
       
 12848                 s4o.print(")");
       
 12849                 return NULL;
       
 12850                 
       
 12851             }
       
 12852             
       
 12853             ERROR;
       
 12854         }
       
 12855         
       
 12856     }/*function_wstring_to_date*/
       
 12857     break;
       
 12858 
       
 12859 /****
       
 12860  *WSTRING_TO_TOD
       
 12861  */
       
 12862     case function_wstring_to_tod :
       
 12863     {
       
 12864         symbol_c *last_type_symbol = NULL;
       
 12865 
       
 12866         {
       
 12867             identifier_c param_name("IN");
       
 12868             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12869             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12870             
       
 12871             /* Get the value from a foo(<param_value>) style call */
       
 12872             if (IN_param_value == NULL)
       
 12873               IN_param_value = function_call_param_iterator.next();
       
 12874             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12875             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12876             
       
 12877             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12878             {
       
 12879         
       
 12880                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
       
 12881                 s4o.print("(");
       
 12882                 return_type_symbol->accept(*this);
       
 12883                 s4o.print(")string_to_time(");
       
 12884                 IN_param_value->accept(*this);
       
 12885                 s4o.print(")");
       
 12886                 return NULL;
       
 12887                 
       
 12888             }
       
 12889             
       
 12890             ERROR;
       
 12891         }
       
 12892         
       
 12893     }/*function_wstring_to_tod*/
       
 12894     break;
       
 12895 
       
 12896 /****
       
 12897  *WSTRING_TO_DT
       
 12898  */
       
 12899     case function_wstring_to_dt :
       
 12900     {
       
 12901         symbol_c *last_type_symbol = NULL;
       
 12902 
       
 12903         {
       
 12904             identifier_c param_name("IN");
       
 12905             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12906             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12907             
       
 12908             /* Get the value from a foo(<param_value>) style call */
       
 12909             if (IN_param_value == NULL)
       
 12910               IN_param_value = function_call_param_iterator.next();
       
 12911             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12912             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12913             
       
 12914             if (typeid(*last_type_symbol) == typeid(wstring_type_name_c))
       
 12915             {
       
 12916         
       
 12917                 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
       
 12918                 s4o.print("(");
       
 12919                 return_type_symbol->accept(*this);
       
 12920                 s4o.print(")string_to_time(");
       
 12921                 IN_param_value->accept(*this);
       
 12922                 s4o.print(")");
       
 12923                 return NULL;
       
 12924                 
       
 12925             }
       
 12926             
       
 12927             ERROR;
       
 12928         }
       
 12929         
       
 12930     }/*function_wstring_to_dt*/
       
 12931     break;
       
 12932 
       
 12933 /****
       
 12934  *DATE_TO_REAL
       
 12935  */
       
 12936     case function_date_to_real :
       
 12937     {
       
 12938         symbol_c *last_type_symbol = NULL;
       
 12939 
       
 12940         {
       
 12941             identifier_c param_name("IN");
       
 12942             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12943             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12944             
       
 12945             /* Get the value from a foo(<param_value>) style call */
       
 12946             if (IN_param_value == NULL)
       
 12947               IN_param_value = function_call_param_iterator.next();
       
 12948             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12949             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12950             
       
 12951             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 12952             {
       
 12953         
       
 12954                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 12955                 s4o.print("(");
       
 12956                 return_type_symbol->accept(*this);
       
 12957                 s4o.print(")time_to_real(");
       
 12958                 IN_param_value->accept(*this);
       
 12959                 s4o.print(")");
       
 12960                 return NULL;
       
 12961                 
       
 12962             }
       
 12963             
       
 12964             ERROR;
       
 12965         }
       
 12966         
       
 12967     }/*function_date_to_real*/
       
 12968     break;
       
 12969 
       
 12970 /****
       
 12971  *DATE_TO_LREAL
       
 12972  */
       
 12973     case function_date_to_lreal :
       
 12974     {
       
 12975         symbol_c *last_type_symbol = NULL;
       
 12976 
       
 12977         {
       
 12978             identifier_c param_name("IN");
       
 12979             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 12980             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 12981             
       
 12982             /* Get the value from a foo(<param_value>) style call */
       
 12983             if (IN_param_value == NULL)
       
 12984               IN_param_value = function_call_param_iterator.next();
       
 12985             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 12986             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 12987             
       
 12988             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 12989             {
       
 12990         
       
 12991                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 12992                 s4o.print("(");
       
 12993                 return_type_symbol->accept(*this);
       
 12994                 s4o.print(")time_to_real(");
       
 12995                 IN_param_value->accept(*this);
       
 12996                 s4o.print(")");
       
 12997                 return NULL;
       
 12998                 
       
 12999             }
       
 13000             
       
 13001             ERROR;
       
 13002         }
       
 13003         
       
 13004     }/*function_date_to_lreal*/
       
 13005     break;
       
 13006 
       
 13007 /****
       
 13008  *DATE_TO_SINT
       
 13009  */
       
 13010     case function_date_to_sint :
       
 13011     {
       
 13012         symbol_c *last_type_symbol = NULL;
       
 13013 
       
 13014         {
       
 13015             identifier_c param_name("IN");
       
 13016             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13017             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13018             
       
 13019             /* Get the value from a foo(<param_value>) style call */
       
 13020             if (IN_param_value == NULL)
       
 13021               IN_param_value = function_call_param_iterator.next();
       
 13022             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13023             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13024             
       
 13025             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13026             {
       
 13027         
       
 13028                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 13029                 s4o.print("(");
       
 13030                 return_type_symbol->accept(*this);
       
 13031                 s4o.print(")time_to_real(");
       
 13032                 IN_param_value->accept(*this);
       
 13033                 s4o.print(")");
       
 13034                 return NULL;
       
 13035                 
       
 13036             }
       
 13037             
       
 13038             ERROR;
       
 13039         }
       
 13040         
       
 13041     }/*function_date_to_sint*/
       
 13042     break;
       
 13043 
       
 13044 /****
       
 13045  *DATE_TO_INT
       
 13046  */
       
 13047     case function_date_to_int :
       
 13048     {
       
 13049         symbol_c *last_type_symbol = NULL;
       
 13050 
       
 13051         {
       
 13052             identifier_c param_name("IN");
       
 13053             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13054             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13055             
       
 13056             /* Get the value from a foo(<param_value>) style call */
       
 13057             if (IN_param_value == NULL)
       
 13058               IN_param_value = function_call_param_iterator.next();
       
 13059             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13060             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13061             
       
 13062             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13063             {
       
 13064         
       
 13065                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 13066                 s4o.print("(");
       
 13067                 return_type_symbol->accept(*this);
       
 13068                 s4o.print(")time_to_real(");
       
 13069                 IN_param_value->accept(*this);
       
 13070                 s4o.print(")");
       
 13071                 return NULL;
       
 13072                 
       
 13073             }
       
 13074             
       
 13075             ERROR;
       
 13076         }
       
 13077         
       
 13078     }/*function_date_to_int*/
       
 13079     break;
       
 13080 
       
 13081 /****
       
 13082  *DATE_TO_DINT
       
 13083  */
       
 13084     case function_date_to_dint :
       
 13085     {
       
 13086         symbol_c *last_type_symbol = NULL;
       
 13087 
       
 13088         {
       
 13089             identifier_c param_name("IN");
       
 13090             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13091             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13092             
       
 13093             /* Get the value from a foo(<param_value>) style call */
       
 13094             if (IN_param_value == NULL)
       
 13095               IN_param_value = function_call_param_iterator.next();
       
 13096             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13097             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13098             
       
 13099             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13100             {
       
 13101         
       
 13102                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 13103                 s4o.print("(");
       
 13104                 return_type_symbol->accept(*this);
       
 13105                 s4o.print(")time_to_real(");
       
 13106                 IN_param_value->accept(*this);
       
 13107                 s4o.print(")");
       
 13108                 return NULL;
       
 13109                 
       
 13110             }
       
 13111             
       
 13112             ERROR;
       
 13113         }
       
 13114         
       
 13115     }/*function_date_to_dint*/
       
 13116     break;
       
 13117 
       
 13118 /****
       
 13119  *DATE_TO_LINT
       
 13120  */
       
 13121     case function_date_to_lint :
       
 13122     {
       
 13123         symbol_c *last_type_symbol = NULL;
       
 13124 
       
 13125         {
       
 13126             identifier_c param_name("IN");
       
 13127             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13128             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13129             
       
 13130             /* Get the value from a foo(<param_value>) style call */
       
 13131             if (IN_param_value == NULL)
       
 13132               IN_param_value = function_call_param_iterator.next();
       
 13133             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13134             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13135             
       
 13136             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13137             {
       
 13138         
       
 13139                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 13140                 s4o.print("(");
       
 13141                 return_type_symbol->accept(*this);
       
 13142                 s4o.print(")time_to_real(");
       
 13143                 IN_param_value->accept(*this);
       
 13144                 s4o.print(")");
       
 13145                 return NULL;
       
 13146                 
       
 13147             }
       
 13148             
       
 13149             ERROR;
       
 13150         }
       
 13151         
       
 13152     }/*function_date_to_lint*/
       
 13153     break;
       
 13154 
       
 13155 /****
       
 13156  *DATE_TO_USINT
       
 13157  */
       
 13158     case function_date_to_usint :
       
 13159     {
       
 13160         symbol_c *last_type_symbol = NULL;
       
 13161 
       
 13162         {
       
 13163             identifier_c param_name("IN");
       
 13164             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13165             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13166             
       
 13167             /* Get the value from a foo(<param_value>) style call */
       
 13168             if (IN_param_value == NULL)
       
 13169               IN_param_value = function_call_param_iterator.next();
       
 13170             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13171             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13172             
       
 13173             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13174             {
       
 13175         
       
 13176                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 13177                 s4o.print("(");
       
 13178                 return_type_symbol->accept(*this);
       
 13179                 s4o.print(")time_to_real(");
       
 13180                 IN_param_value->accept(*this);
       
 13181                 s4o.print(")");
       
 13182                 return NULL;
       
 13183                 
       
 13184             }
       
 13185             
       
 13186             ERROR;
       
 13187         }
       
 13188         
       
 13189     }/*function_date_to_usint*/
       
 13190     break;
       
 13191 
       
 13192 /****
       
 13193  *DATE_TO_UINT
       
 13194  */
       
 13195     case function_date_to_uint :
       
 13196     {
       
 13197         symbol_c *last_type_symbol = NULL;
       
 13198 
       
 13199         {
       
 13200             identifier_c param_name("IN");
       
 13201             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13202             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13203             
       
 13204             /* Get the value from a foo(<param_value>) style call */
       
 13205             if (IN_param_value == NULL)
       
 13206               IN_param_value = function_call_param_iterator.next();
       
 13207             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13208             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13209             
       
 13210             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13211             {
       
 13212         
       
 13213                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 13214                 s4o.print("(");
       
 13215                 return_type_symbol->accept(*this);
       
 13216                 s4o.print(")time_to_real(");
       
 13217                 IN_param_value->accept(*this);
       
 13218                 s4o.print(")");
       
 13219                 return NULL;
       
 13220                 
       
 13221             }
       
 13222             
       
 13223             ERROR;
       
 13224         }
       
 13225         
       
 13226     }/*function_date_to_uint*/
       
 13227     break;
       
 13228 
       
 13229 /****
       
 13230  *DATE_TO_UDINT
       
 13231  */
       
 13232     case function_date_to_udint :
       
 13233     {
       
 13234         symbol_c *last_type_symbol = NULL;
       
 13235 
       
 13236         {
       
 13237             identifier_c param_name("IN");
       
 13238             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13239             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13240             
       
 13241             /* Get the value from a foo(<param_value>) style call */
       
 13242             if (IN_param_value == NULL)
       
 13243               IN_param_value = function_call_param_iterator.next();
       
 13244             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13245             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13246             
       
 13247             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13248             {
       
 13249         
       
 13250                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 13251                 s4o.print("(");
       
 13252                 return_type_symbol->accept(*this);
       
 13253                 s4o.print(")time_to_real(");
       
 13254                 IN_param_value->accept(*this);
       
 13255                 s4o.print(")");
       
 13256                 return NULL;
       
 13257                 
       
 13258             }
       
 13259             
       
 13260             ERROR;
       
 13261         }
       
 13262         
       
 13263     }/*function_date_to_udint*/
       
 13264     break;
       
 13265 
       
 13266 /****
       
 13267  *DATE_TO_ULINT
       
 13268  */
       
 13269     case function_date_to_ulint :
       
 13270     {
       
 13271         symbol_c *last_type_symbol = NULL;
       
 13272 
       
 13273         {
       
 13274             identifier_c param_name("IN");
       
 13275             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13276             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13277             
       
 13278             /* Get the value from a foo(<param_value>) style call */
       
 13279             if (IN_param_value == NULL)
       
 13280               IN_param_value = function_call_param_iterator.next();
       
 13281             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13282             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13283             
       
 13284             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13285             {
       
 13286         
       
 13287                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 13288                 s4o.print("(");
       
 13289                 return_type_symbol->accept(*this);
       
 13290                 s4o.print(")time_to_real(");
       
 13291                 IN_param_value->accept(*this);
       
 13292                 s4o.print(")");
       
 13293                 return NULL;
       
 13294                 
       
 13295             }
       
 13296             
       
 13297             ERROR;
       
 13298         }
       
 13299         
       
 13300     }/*function_date_to_ulint*/
       
 13301     break;
       
 13302 
       
 13303 /****
       
 13304  *DATE_TO_BOOL
       
 13305  */
       
 13306     case function_date_to_bool :
       
 13307     {
       
 13308         symbol_c *last_type_symbol = NULL;
       
 13309 
       
 13310         {
       
 13311             identifier_c param_name("IN");
       
 13312             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13313             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13314             
       
 13315             /* Get the value from a foo(<param_value>) style call */
       
 13316             if (IN_param_value == NULL)
       
 13317               IN_param_value = function_call_param_iterator.next();
       
 13318             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13319             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13320             
       
 13321             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13322             {
       
 13323         
       
 13324                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 13325                 s4o.print("(");
       
 13326                 return_type_symbol->accept(*this);
       
 13327                 s4o.print(")time_to_real(");
       
 13328                 IN_param_value->accept(*this);
       
 13329                 s4o.print(")");
       
 13330                 return NULL;
       
 13331                 
       
 13332             }
       
 13333             
       
 13334             ERROR;
       
 13335         }
       
 13336         
       
 13337     }/*function_date_to_bool*/
       
 13338     break;
       
 13339 
       
 13340 /****
       
 13341  *DATE_TO_BYTE
       
 13342  */
       
 13343     case function_date_to_byte :
       
 13344     {
       
 13345         symbol_c *last_type_symbol = NULL;
       
 13346 
       
 13347         {
       
 13348             identifier_c param_name("IN");
       
 13349             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13350             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13351             
       
 13352             /* Get the value from a foo(<param_value>) style call */
       
 13353             if (IN_param_value == NULL)
       
 13354               IN_param_value = function_call_param_iterator.next();
       
 13355             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13356             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13357             
       
 13358             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13359             {
       
 13360         
       
 13361                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 13362                 s4o.print("(");
       
 13363                 return_type_symbol->accept(*this);
       
 13364                 s4o.print(")time_to_real(");
       
 13365                 IN_param_value->accept(*this);
       
 13366                 s4o.print(")");
       
 13367                 return NULL;
       
 13368                 
       
 13369             }
       
 13370             
       
 13371             ERROR;
       
 13372         }
       
 13373         
       
 13374     }/*function_date_to_byte*/
       
 13375     break;
       
 13376 
       
 13377 /****
       
 13378  *DATE_TO_WORD
       
 13379  */
       
 13380     case function_date_to_word :
       
 13381     {
       
 13382         symbol_c *last_type_symbol = NULL;
       
 13383 
       
 13384         {
       
 13385             identifier_c param_name("IN");
       
 13386             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13387             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13388             
       
 13389             /* Get the value from a foo(<param_value>) style call */
       
 13390             if (IN_param_value == NULL)
       
 13391               IN_param_value = function_call_param_iterator.next();
       
 13392             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13393             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13394             
       
 13395             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13396             {
       
 13397         
       
 13398                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 13399                 s4o.print("(");
       
 13400                 return_type_symbol->accept(*this);
       
 13401                 s4o.print(")time_to_real(");
       
 13402                 IN_param_value->accept(*this);
       
 13403                 s4o.print(")");
       
 13404                 return NULL;
       
 13405                 
       
 13406             }
       
 13407             
       
 13408             ERROR;
       
 13409         }
       
 13410         
       
 13411     }/*function_date_to_word*/
       
 13412     break;
       
 13413 
       
 13414 /****
       
 13415  *DATE_TO_DWORD
       
 13416  */
       
 13417     case function_date_to_dword :
       
 13418     {
       
 13419         symbol_c *last_type_symbol = NULL;
       
 13420 
       
 13421         {
       
 13422             identifier_c param_name("IN");
       
 13423             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13424             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13425             
       
 13426             /* Get the value from a foo(<param_value>) style call */
       
 13427             if (IN_param_value == NULL)
       
 13428               IN_param_value = function_call_param_iterator.next();
       
 13429             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13430             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13431             
       
 13432             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13433             {
       
 13434         
       
 13435                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 13436                 s4o.print("(");
       
 13437                 return_type_symbol->accept(*this);
       
 13438                 s4o.print(")time_to_real(");
       
 13439                 IN_param_value->accept(*this);
       
 13440                 s4o.print(")");
       
 13441                 return NULL;
       
 13442                 
       
 13443             }
       
 13444             
       
 13445             ERROR;
       
 13446         }
       
 13447         
       
 13448     }/*function_date_to_dword*/
       
 13449     break;
       
 13450 
       
 13451 /****
       
 13452  *DATE_TO_LWORD
       
 13453  */
       
 13454     case function_date_to_lword :
       
 13455     {
       
 13456         symbol_c *last_type_symbol = NULL;
       
 13457 
       
 13458         {
       
 13459             identifier_c param_name("IN");
       
 13460             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13461             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13462             
       
 13463             /* Get the value from a foo(<param_value>) style call */
       
 13464             if (IN_param_value == NULL)
       
 13465               IN_param_value = function_call_param_iterator.next();
       
 13466             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13467             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13468             
       
 13469             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13470             {
       
 13471         
       
 13472                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 13473                 s4o.print("(");
       
 13474                 return_type_symbol->accept(*this);
       
 13475                 s4o.print(")time_to_real(");
       
 13476                 IN_param_value->accept(*this);
       
 13477                 s4o.print(")");
       
 13478                 return NULL;
       
 13479                 
       
 13480             }
       
 13481             
       
 13482             ERROR;
       
 13483         }
       
 13484         
       
 13485     }/*function_date_to_lword*/
       
 13486     break;
       
 13487 
       
 13488 /****
       
 13489  *DATE_TO_STRING
       
 13490  */
       
 13491     case function_date_to_string :
       
 13492     {
       
 13493         symbol_c *last_type_symbol = NULL;
       
 13494 
       
 13495         {
       
 13496             identifier_c param_name("IN");
       
 13497             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13498             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13499             
       
 13500             /* Get the value from a foo(<param_value>) style call */
       
 13501             if (IN_param_value == NULL)
       
 13502               IN_param_value = function_call_param_iterator.next();
       
 13503             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13504             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13505             
       
 13506             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13507             {
       
 13508         
       
 13509                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 13510                 s4o.print("(");
       
 13511                 return_type_symbol->accept(*this);
       
 13512                 s4o.print(")time_to_string(");
       
 13513                 IN_param_value->accept(*this);
       
 13514                 s4o.print(")");
       
 13515                 return NULL;
       
 13516                 
       
 13517             }
       
 13518             
       
 13519             ERROR;
       
 13520         }
       
 13521         
       
 13522     }/*function_date_to_string*/
       
 13523     break;
       
 13524 
       
 13525 /****
       
 13526  *DATE_TO_WSTRING
       
 13527  */
       
 13528     case function_date_to_wstring :
       
 13529     {
       
 13530         symbol_c *last_type_symbol = NULL;
       
 13531 
       
 13532         {
       
 13533             identifier_c param_name("IN");
       
 13534             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13535             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13536             
       
 13537             /* Get the value from a foo(<param_value>) style call */
       
 13538             if (IN_param_value == NULL)
       
 13539               IN_param_value = function_call_param_iterator.next();
       
 13540             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13541             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13542             
       
 13543             if (typeid(*last_type_symbol) == typeid(date_type_name_c))
       
 13544             {
       
 13545         
       
 13546                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
 13547                 s4o.print("(");
       
 13548                 return_type_symbol->accept(*this);
       
 13549                 s4o.print(")time_to_string(");
       
 13550                 IN_param_value->accept(*this);
       
 13551                 s4o.print(")");
       
 13552                 return NULL;
       
 13553                 
       
 13554             }
       
 13555             
       
 13556             ERROR;
       
 13557         }
       
 13558         
       
 13559     }/*function_date_to_wstring*/
       
 13560     break;
       
 13561 
       
 13562 /****
       
 13563  *TOD_TO_REAL
       
 13564  */
       
 13565     case function_tod_to_real :
       
 13566     {
       
 13567         symbol_c *last_type_symbol = NULL;
       
 13568 
       
 13569         {
       
 13570             identifier_c param_name("IN");
       
 13571             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13572             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13573             
       
 13574             /* Get the value from a foo(<param_value>) style call */
       
 13575             if (IN_param_value == NULL)
       
 13576               IN_param_value = function_call_param_iterator.next();
       
 13577             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13578             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13579             
       
 13580             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 13581             {
       
 13582         
       
 13583                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 13584                 s4o.print("(");
       
 13585                 return_type_symbol->accept(*this);
       
 13586                 s4o.print(")time_to_real(");
       
 13587                 IN_param_value->accept(*this);
       
 13588                 s4o.print(")");
       
 13589                 return NULL;
       
 13590                 
       
 13591             }
       
 13592             
       
 13593             ERROR;
       
 13594         }
       
 13595         
       
 13596     }/*function_tod_to_real*/
       
 13597     break;
       
 13598 
       
 13599 /****
       
 13600  *TOD_TO_LREAL
       
 13601  */
       
 13602     case function_tod_to_lreal :
       
 13603     {
       
 13604         symbol_c *last_type_symbol = NULL;
       
 13605 
       
 13606         {
       
 13607             identifier_c param_name("IN");
       
 13608             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13609             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13610             
       
 13611             /* Get the value from a foo(<param_value>) style call */
       
 13612             if (IN_param_value == NULL)
       
 13613               IN_param_value = function_call_param_iterator.next();
       
 13614             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13615             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13616             
       
 13617             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 13618             {
       
 13619         
       
 13620                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 13621                 s4o.print("(");
       
 13622                 return_type_symbol->accept(*this);
       
 13623                 s4o.print(")time_to_real(");
       
 13624                 IN_param_value->accept(*this);
       
 13625                 s4o.print(")");
       
 13626                 return NULL;
       
 13627                 
       
 13628             }
       
 13629             
       
 13630             ERROR;
       
 13631         }
       
 13632         
       
 13633     }/*function_tod_to_lreal*/
       
 13634     break;
       
 13635 
       
 13636 /****
       
 13637  *TOD_TO_SINT
       
 13638  */
       
 13639     case function_tod_to_sint :
       
 13640     {
       
 13641         symbol_c *last_type_symbol = NULL;
       
 13642 
       
 13643         {
       
 13644             identifier_c param_name("IN");
       
 13645             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13646             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13647             
       
 13648             /* Get the value from a foo(<param_value>) style call */
       
 13649             if (IN_param_value == NULL)
       
 13650               IN_param_value = function_call_param_iterator.next();
       
 13651             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 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 ;
       
 13653             
       
 13654             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 13655             {
       
 13656         
       
 13657                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 13658                 s4o.print("(");
       
 13659                 return_type_symbol->accept(*this);
       
 13660                 s4o.print(")time_to_real(");
       
 13661                 IN_param_value->accept(*this);
       
 13662                 s4o.print(")");
       
 13663                 return NULL;
       
 13664                 
       
 13665             }
       
 13666             
       
 13667             ERROR;
       
 13668         }
       
 13669         
       
 13670     }/*function_tod_to_sint*/
       
 13671     break;
       
 13672 
       
 13673 /****
       
 13674  *TOD_TO_INT
       
 13675  */
       
 13676     case function_tod_to_int :
       
 13677     {
       
 13678         symbol_c *last_type_symbol = NULL;
       
 13679 
       
 13680         {
       
 13681             identifier_c param_name("IN");
       
 13682             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13683             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13684             
       
 13685             /* Get the value from a foo(<param_value>) style call */
       
 13686             if (IN_param_value == NULL)
       
 13687               IN_param_value = function_call_param_iterator.next();
       
 13688             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13689             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13690             
       
 13691             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 13692             {
       
 13693         
       
 13694                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 13695                 s4o.print("(");
       
 13696                 return_type_symbol->accept(*this);
       
 13697                 s4o.print(")time_to_real(");
       
 13698                 IN_param_value->accept(*this);
       
 13699                 s4o.print(")");
       
 13700                 return NULL;
       
 13701                 
       
 13702             }
       
 13703             
       
 13704             ERROR;
       
 13705         }
       
 13706         
       
 13707     }/*function_tod_to_int*/
       
 13708     break;
       
 13709 
       
 13710 /****
       
 13711  *TOD_TO_DINT
       
 13712  */
       
 13713     case function_tod_to_dint :
       
 13714     {
       
 13715         symbol_c *last_type_symbol = NULL;
       
 13716 
       
 13717         {
       
 13718             identifier_c param_name("IN");
       
 13719             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13720             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13721             
       
 13722             /* Get the value from a foo(<param_value>) style call */
       
 13723             if (IN_param_value == NULL)
       
 13724               IN_param_value = function_call_param_iterator.next();
       
 13725             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13726             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13727             
       
 13728             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 13729             {
       
 13730         
       
 13731                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 13732                 s4o.print("(");
       
 13733                 return_type_symbol->accept(*this);
       
 13734                 s4o.print(")time_to_real(");
       
 13735                 IN_param_value->accept(*this);
       
 13736                 s4o.print(")");
       
 13737                 return NULL;
       
 13738                 
       
 13739             }
       
 13740             
       
 13741             ERROR;
       
 13742         }
       
 13743         
       
 13744     }/*function_tod_to_dint*/
       
 13745     break;
       
 13746 
       
 13747 /****
       
 13748  *TOD_TO_LINT
       
 13749  */
       
 13750     case function_tod_to_lint :
       
 13751     {
       
 13752         symbol_c *last_type_symbol = NULL;
       
 13753 
       
 13754         {
       
 13755             identifier_c param_name("IN");
       
 13756             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13757             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13758             
       
 13759             /* Get the value from a foo(<param_value>) style call */
       
 13760             if (IN_param_value == NULL)
       
 13761               IN_param_value = function_call_param_iterator.next();
       
 13762             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13763             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13764             
       
 13765             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 13766             {
       
 13767         
       
 13768                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 13769                 s4o.print("(");
       
 13770                 return_type_symbol->accept(*this);
       
 13771                 s4o.print(")time_to_real(");
       
 13772                 IN_param_value->accept(*this);
       
 13773                 s4o.print(")");
       
 13774                 return NULL;
       
 13775                 
       
 13776             }
       
 13777             
       
 13778             ERROR;
       
 13779         }
       
 13780         
       
 13781     }/*function_tod_to_lint*/
       
 13782     break;
       
 13783 
       
 13784 /****
       
 13785  *TOD_TO_USINT
       
 13786  */
       
 13787     case function_tod_to_usint :
       
 13788     {
       
 13789         symbol_c *last_type_symbol = NULL;
       
 13790 
       
 13791         {
       
 13792             identifier_c param_name("IN");
       
 13793             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13794             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13795             
       
 13796             /* Get the value from a foo(<param_value>) style call */
       
 13797             if (IN_param_value == NULL)
       
 13798               IN_param_value = function_call_param_iterator.next();
       
 13799             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13800             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13801             
       
 13802             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 13803             {
       
 13804         
       
 13805                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 13806                 s4o.print("(");
       
 13807                 return_type_symbol->accept(*this);
       
 13808                 s4o.print(")time_to_real(");
       
 13809                 IN_param_value->accept(*this);
       
 13810                 s4o.print(")");
       
 13811                 return NULL;
       
 13812                 
       
 13813             }
       
 13814             
       
 13815             ERROR;
       
 13816         }
       
 13817         
       
 13818     }/*function_tod_to_usint*/
       
 13819     break;
       
 13820 
       
 13821 /****
       
 13822  *TOD_TO_UINT
       
 13823  */
       
 13824     case function_tod_to_uint :
       
 13825     {
       
 13826         symbol_c *last_type_symbol = NULL;
       
 13827 
       
 13828         {
       
 13829             identifier_c param_name("IN");
       
 13830             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13831             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13832             
       
 13833             /* Get the value from a foo(<param_value>) style call */
       
 13834             if (IN_param_value == NULL)
       
 13835               IN_param_value = function_call_param_iterator.next();
       
 13836             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13837             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13838             
       
 13839             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 13840             {
       
 13841         
       
 13842                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 13843                 s4o.print("(");
       
 13844                 return_type_symbol->accept(*this);
       
 13845                 s4o.print(")time_to_real(");
       
 13846                 IN_param_value->accept(*this);
       
 13847                 s4o.print(")");
       
 13848                 return NULL;
       
 13849                 
       
 13850             }
       
 13851             
       
 13852             ERROR;
       
 13853         }
       
 13854         
       
 13855     }/*function_tod_to_uint*/
       
 13856     break;
       
 13857 
       
 13858 /****
       
 13859  *TOD_TO_UDINT
       
 13860  */
       
 13861     case function_tod_to_udint :
       
 13862     {
       
 13863         symbol_c *last_type_symbol = NULL;
       
 13864 
       
 13865         {
       
 13866             identifier_c param_name("IN");
       
 13867             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13868             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13869             
       
 13870             /* Get the value from a foo(<param_value>) style call */
       
 13871             if (IN_param_value == NULL)
       
 13872               IN_param_value = function_call_param_iterator.next();
       
 13873             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13874             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13875             
       
 13876             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 13877             {
       
 13878         
       
 13879                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 13880                 s4o.print("(");
       
 13881                 return_type_symbol->accept(*this);
       
 13882                 s4o.print(")time_to_real(");
       
 13883                 IN_param_value->accept(*this);
       
 13884                 s4o.print(")");
       
 13885                 return NULL;
       
 13886                 
       
 13887             }
       
 13888             
       
 13889             ERROR;
       
 13890         }
       
 13891         
       
 13892     }/*function_tod_to_udint*/
       
 13893     break;
       
 13894 
       
 13895 /****
       
 13896  *TOD_TO_ULINT
       
 13897  */
       
 13898     case function_tod_to_ulint :
       
 13899     {
       
 13900         symbol_c *last_type_symbol = NULL;
       
 13901 
       
 13902         {
       
 13903             identifier_c param_name("IN");
       
 13904             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13905             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13906             
       
 13907             /* Get the value from a foo(<param_value>) style call */
       
 13908             if (IN_param_value == NULL)
       
 13909               IN_param_value = function_call_param_iterator.next();
       
 13910             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13911             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13912             
       
 13913             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 13914             {
       
 13915         
       
 13916                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 13917                 s4o.print("(");
       
 13918                 return_type_symbol->accept(*this);
       
 13919                 s4o.print(")time_to_real(");
       
 13920                 IN_param_value->accept(*this);
       
 13921                 s4o.print(")");
       
 13922                 return NULL;
       
 13923                 
       
 13924             }
       
 13925             
       
 13926             ERROR;
       
 13927         }
       
 13928         
       
 13929     }/*function_tod_to_ulint*/
       
 13930     break;
       
 13931 
       
 13932 /****
       
 13933  *TOD_TO_BOOL
       
 13934  */
       
 13935     case function_tod_to_bool :
       
 13936     {
       
 13937         symbol_c *last_type_symbol = NULL;
       
 13938 
       
 13939         {
       
 13940             identifier_c param_name("IN");
       
 13941             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13942             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13943             
       
 13944             /* Get the value from a foo(<param_value>) style call */
       
 13945             if (IN_param_value == NULL)
       
 13946               IN_param_value = function_call_param_iterator.next();
       
 13947             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13948             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13949             
       
 13950             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 13951             {
       
 13952         
       
 13953                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 13954                 s4o.print("(");
       
 13955                 return_type_symbol->accept(*this);
       
 13956                 s4o.print(")time_to_real(");
       
 13957                 IN_param_value->accept(*this);
       
 13958                 s4o.print(")");
       
 13959                 return NULL;
       
 13960                 
       
 13961             }
       
 13962             
       
 13963             ERROR;
       
 13964         }
       
 13965         
       
 13966     }/*function_tod_to_bool*/
       
 13967     break;
       
 13968 
       
 13969 /****
       
 13970  *TOD_TO_BYTE
       
 13971  */
       
 13972     case function_tod_to_byte :
       
 13973     {
       
 13974         symbol_c *last_type_symbol = NULL;
       
 13975 
       
 13976         {
       
 13977             identifier_c param_name("IN");
       
 13978             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 13979             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 13980             
       
 13981             /* Get the value from a foo(<param_value>) style call */
       
 13982             if (IN_param_value == NULL)
       
 13983               IN_param_value = function_call_param_iterator.next();
       
 13984             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 13985             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 13986             
       
 13987             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 13988             {
       
 13989         
       
 13990                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 13991                 s4o.print("(");
       
 13992                 return_type_symbol->accept(*this);
       
 13993                 s4o.print(")time_to_real(");
       
 13994                 IN_param_value->accept(*this);
       
 13995                 s4o.print(")");
       
 13996                 return NULL;
       
 13997                 
       
 13998             }
       
 13999             
       
 14000             ERROR;
       
 14001         }
       
 14002         
       
 14003     }/*function_tod_to_byte*/
       
 14004     break;
       
 14005 
       
 14006 /****
       
 14007  *TOD_TO_WORD
       
 14008  */
       
 14009     case function_tod_to_word :
       
 14010     {
       
 14011         symbol_c *last_type_symbol = NULL;
       
 14012 
       
 14013         {
       
 14014             identifier_c param_name("IN");
       
 14015             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14016             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14017             
       
 14018             /* Get the value from a foo(<param_value>) style call */
       
 14019             if (IN_param_value == NULL)
       
 14020               IN_param_value = function_call_param_iterator.next();
       
 14021             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14022             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14023             
       
 14024             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 14025             {
       
 14026         
       
 14027                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 14028                 s4o.print("(");
       
 14029                 return_type_symbol->accept(*this);
       
 14030                 s4o.print(")time_to_real(");
       
 14031                 IN_param_value->accept(*this);
       
 14032                 s4o.print(")");
       
 14033                 return NULL;
       
 14034                 
       
 14035             }
       
 14036             
       
 14037             ERROR;
       
 14038         }
       
 14039         
       
 14040     }/*function_tod_to_word*/
       
 14041     break;
       
 14042 
       
 14043 /****
       
 14044  *TOD_TO_DWORD
       
 14045  */
       
 14046     case function_tod_to_dword :
       
 14047     {
       
 14048         symbol_c *last_type_symbol = NULL;
       
 14049 
       
 14050         {
       
 14051             identifier_c param_name("IN");
       
 14052             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14053             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14054             
       
 14055             /* Get the value from a foo(<param_value>) style call */
       
 14056             if (IN_param_value == NULL)
       
 14057               IN_param_value = function_call_param_iterator.next();
       
 14058             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14059             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14060             
       
 14061             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 14062             {
       
 14063         
       
 14064                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 14065                 s4o.print("(");
       
 14066                 return_type_symbol->accept(*this);
       
 14067                 s4o.print(")time_to_real(");
       
 14068                 IN_param_value->accept(*this);
       
 14069                 s4o.print(")");
       
 14070                 return NULL;
       
 14071                 
       
 14072             }
       
 14073             
       
 14074             ERROR;
       
 14075         }
       
 14076         
       
 14077     }/*function_tod_to_dword*/
       
 14078     break;
       
 14079 
       
 14080 /****
       
 14081  *TOD_TO_LWORD
       
 14082  */
       
 14083     case function_tod_to_lword :
       
 14084     {
       
 14085         symbol_c *last_type_symbol = NULL;
       
 14086 
       
 14087         {
       
 14088             identifier_c param_name("IN");
       
 14089             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14090             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14091             
       
 14092             /* Get the value from a foo(<param_value>) style call */
       
 14093             if (IN_param_value == NULL)
       
 14094               IN_param_value = function_call_param_iterator.next();
       
 14095             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14096             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14097             
       
 14098             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 14099             {
       
 14100         
       
 14101                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 14102                 s4o.print("(");
       
 14103                 return_type_symbol->accept(*this);
       
 14104                 s4o.print(")time_to_real(");
       
 14105                 IN_param_value->accept(*this);
       
 14106                 s4o.print(")");
       
 14107                 return NULL;
       
 14108                 
       
 14109             }
       
 14110             
       
 14111             ERROR;
       
 14112         }
       
 14113         
       
 14114     }/*function_tod_to_lword*/
       
 14115     break;
       
 14116 
       
 14117 /****
       
 14118  *TOD_TO_STRING
       
 14119  */
       
 14120     case function_tod_to_string :
       
 14121     {
       
 14122         symbol_c *last_type_symbol = NULL;
       
 14123 
       
 14124         {
       
 14125             identifier_c param_name("IN");
       
 14126             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14127             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14128             
       
 14129             /* Get the value from a foo(<param_value>) style call */
       
 14130             if (IN_param_value == NULL)
       
 14131               IN_param_value = function_call_param_iterator.next();
       
 14132             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14133             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14134             
       
 14135             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 14136             {
       
 14137         
       
 14138                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 14139                 s4o.print("(");
       
 14140                 return_type_symbol->accept(*this);
       
 14141                 s4o.print(")time_to_string(");
       
 14142                 IN_param_value->accept(*this);
       
 14143                 s4o.print(")");
       
 14144                 return NULL;
       
 14145                 
       
 14146             }
       
 14147             
       
 14148             ERROR;
       
 14149         }
       
 14150         
       
 14151     }/*function_tod_to_string*/
       
 14152     break;
       
 14153 
       
 14154 /****
       
 14155  *TOD_TO_WSTRING
       
 14156  */
       
 14157     case function_tod_to_wstring :
       
 14158     {
       
 14159         symbol_c *last_type_symbol = NULL;
       
 14160 
       
 14161         {
       
 14162             identifier_c param_name("IN");
       
 14163             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14164             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14165             
       
 14166             /* Get the value from a foo(<param_value>) style call */
       
 14167             if (IN_param_value == NULL)
       
 14168               IN_param_value = function_call_param_iterator.next();
       
 14169             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14170             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14171             
       
 14172             if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
       
 14173             {
       
 14174         
       
 14175                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
 14176                 s4o.print("(");
       
 14177                 return_type_symbol->accept(*this);
       
 14178                 s4o.print(")time_to_string(");
       
 14179                 IN_param_value->accept(*this);
       
 14180                 s4o.print(")");
       
 14181                 return NULL;
       
 14182                 
       
 14183             }
       
 14184             
       
 14185             ERROR;
       
 14186         }
       
 14187         
       
 14188     }/*function_tod_to_wstring*/
       
 14189     break;
       
 14190 
       
 14191 /****
       
 14192  *DT_TO_REAL
       
 14193  */
       
 14194     case function_dt_to_real :
       
 14195     {
       
 14196         symbol_c *last_type_symbol = NULL;
       
 14197 
       
 14198         {
       
 14199             identifier_c param_name("IN");
       
 14200             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14201             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14202             
       
 14203             /* Get the value from a foo(<param_value>) style call */
       
 14204             if (IN_param_value == NULL)
       
 14205               IN_param_value = function_call_param_iterator.next();
       
 14206             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14207             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14208             
       
 14209             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14210             {
       
 14211         
       
 14212                 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
       
 14213                 s4o.print("(");
       
 14214                 return_type_symbol->accept(*this);
       
 14215                 s4o.print(")time_to_real(");
       
 14216                 IN_param_value->accept(*this);
       
 14217                 s4o.print(")");
       
 14218                 return NULL;
       
 14219                 
       
 14220             }
       
 14221             
       
 14222             ERROR;
       
 14223         }
       
 14224         
       
 14225     }/*function_dt_to_real*/
       
 14226     break;
       
 14227 
       
 14228 /****
       
 14229  *DT_TO_LREAL
       
 14230  */
       
 14231     case function_dt_to_lreal :
       
 14232     {
       
 14233         symbol_c *last_type_symbol = NULL;
       
 14234 
       
 14235         {
       
 14236             identifier_c param_name("IN");
       
 14237             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14238             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14239             
       
 14240             /* Get the value from a foo(<param_value>) style call */
       
 14241             if (IN_param_value == NULL)
       
 14242               IN_param_value = function_call_param_iterator.next();
       
 14243             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14244             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14245             
       
 14246             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14247             {
       
 14248         
       
 14249                 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
       
 14250                 s4o.print("(");
       
 14251                 return_type_symbol->accept(*this);
       
 14252                 s4o.print(")time_to_real(");
       
 14253                 IN_param_value->accept(*this);
       
 14254                 s4o.print(")");
       
 14255                 return NULL;
       
 14256                 
       
 14257             }
       
 14258             
       
 14259             ERROR;
       
 14260         }
       
 14261         
       
 14262     }/*function_dt_to_lreal*/
       
 14263     break;
       
 14264 
       
 14265 /****
       
 14266  *DT_TO_SINT
       
 14267  */
       
 14268     case function_dt_to_sint :
       
 14269     {
       
 14270         symbol_c *last_type_symbol = NULL;
       
 14271 
       
 14272         {
       
 14273             identifier_c param_name("IN");
       
 14274             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14275             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14276             
       
 14277             /* Get the value from a foo(<param_value>) style call */
       
 14278             if (IN_param_value == NULL)
       
 14279               IN_param_value = function_call_param_iterator.next();
       
 14280             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14281             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14282             
       
 14283             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14284             {
       
 14285         
       
 14286                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 14287                 s4o.print("(");
       
 14288                 return_type_symbol->accept(*this);
       
 14289                 s4o.print(")time_to_real(");
       
 14290                 IN_param_value->accept(*this);
       
 14291                 s4o.print(")");
       
 14292                 return NULL;
       
 14293                 
       
 14294             }
       
 14295             
       
 14296             ERROR;
       
 14297         }
       
 14298         
       
 14299     }/*function_dt_to_sint*/
       
 14300     break;
       
 14301 
       
 14302 /****
       
 14303  *DT_TO_INT
       
 14304  */
       
 14305     case function_dt_to_int :
       
 14306     {
       
 14307         symbol_c *last_type_symbol = NULL;
       
 14308 
       
 14309         {
       
 14310             identifier_c param_name("IN");
       
 14311             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14312             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14313             
       
 14314             /* Get the value from a foo(<param_value>) style call */
       
 14315             if (IN_param_value == NULL)
       
 14316               IN_param_value = function_call_param_iterator.next();
       
 14317             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14318             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14319             
       
 14320             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14321             {
       
 14322         
       
 14323                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 14324                 s4o.print("(");
       
 14325                 return_type_symbol->accept(*this);
       
 14326                 s4o.print(")time_to_real(");
       
 14327                 IN_param_value->accept(*this);
       
 14328                 s4o.print(")");
       
 14329                 return NULL;
       
 14330                 
       
 14331             }
       
 14332             
       
 14333             ERROR;
       
 14334         }
       
 14335         
       
 14336     }/*function_dt_to_int*/
       
 14337     break;
       
 14338 
       
 14339 /****
       
 14340  *DT_TO_DINT
       
 14341  */
       
 14342     case function_dt_to_dint :
       
 14343     {
       
 14344         symbol_c *last_type_symbol = NULL;
       
 14345 
       
 14346         {
       
 14347             identifier_c param_name("IN");
       
 14348             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14349             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14350             
       
 14351             /* Get the value from a foo(<param_value>) style call */
       
 14352             if (IN_param_value == NULL)
       
 14353               IN_param_value = function_call_param_iterator.next();
       
 14354             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14355             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14356             
       
 14357             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14358             {
       
 14359         
       
 14360                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 14361                 s4o.print("(");
       
 14362                 return_type_symbol->accept(*this);
       
 14363                 s4o.print(")time_to_real(");
       
 14364                 IN_param_value->accept(*this);
       
 14365                 s4o.print(")");
       
 14366                 return NULL;
       
 14367                 
       
 14368             }
       
 14369             
       
 14370             ERROR;
       
 14371         }
       
 14372         
       
 14373     }/*function_dt_to_dint*/
       
 14374     break;
       
 14375 
       
 14376 /****
       
 14377  *DT_TO_LINT
       
 14378  */
       
 14379     case function_dt_to_lint :
       
 14380     {
       
 14381         symbol_c *last_type_symbol = NULL;
       
 14382 
       
 14383         {
       
 14384             identifier_c param_name("IN");
       
 14385             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14386             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14387             
       
 14388             /* Get the value from a foo(<param_value>) style call */
       
 14389             if (IN_param_value == NULL)
       
 14390               IN_param_value = function_call_param_iterator.next();
       
 14391             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14392             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14393             
       
 14394             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14395             {
       
 14396         
       
 14397                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 14398                 s4o.print("(");
       
 14399                 return_type_symbol->accept(*this);
       
 14400                 s4o.print(")time_to_real(");
       
 14401                 IN_param_value->accept(*this);
       
 14402                 s4o.print(")");
       
 14403                 return NULL;
       
 14404                 
       
 14405             }
       
 14406             
       
 14407             ERROR;
       
 14408         }
       
 14409         
       
 14410     }/*function_dt_to_lint*/
       
 14411     break;
       
 14412 
       
 14413 /****
       
 14414  *DT_TO_USINT
       
 14415  */
       
 14416     case function_dt_to_usint :
       
 14417     {
       
 14418         symbol_c *last_type_symbol = NULL;
       
 14419 
       
 14420         {
       
 14421             identifier_c param_name("IN");
       
 14422             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14423             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14424             
       
 14425             /* Get the value from a foo(<param_value>) style call */
       
 14426             if (IN_param_value == NULL)
       
 14427               IN_param_value = function_call_param_iterator.next();
       
 14428             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14429             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14430             
       
 14431             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14432             {
       
 14433         
       
 14434                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
       
 14435                 s4o.print("(");
       
 14436                 return_type_symbol->accept(*this);
       
 14437                 s4o.print(")time_to_real(");
       
 14438                 IN_param_value->accept(*this);
       
 14439                 s4o.print(")");
       
 14440                 return NULL;
       
 14441                 
       
 14442             }
       
 14443             
       
 14444             ERROR;
       
 14445         }
       
 14446         
       
 14447     }/*function_dt_to_usint*/
       
 14448     break;
       
 14449 
       
 14450 /****
       
 14451  *DT_TO_UINT
       
 14452  */
       
 14453     case function_dt_to_uint :
       
 14454     {
       
 14455         symbol_c *last_type_symbol = NULL;
       
 14456 
       
 14457         {
       
 14458             identifier_c param_name("IN");
       
 14459             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14460             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14461             
       
 14462             /* Get the value from a foo(<param_value>) style call */
       
 14463             if (IN_param_value == NULL)
       
 14464               IN_param_value = function_call_param_iterator.next();
       
 14465             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14466             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14467             
       
 14468             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14469             {
       
 14470         
       
 14471                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
       
 14472                 s4o.print("(");
       
 14473                 return_type_symbol->accept(*this);
       
 14474                 s4o.print(")time_to_real(");
       
 14475                 IN_param_value->accept(*this);
       
 14476                 s4o.print(")");
       
 14477                 return NULL;
       
 14478                 
       
 14479             }
       
 14480             
       
 14481             ERROR;
       
 14482         }
       
 14483         
       
 14484     }/*function_dt_to_uint*/
       
 14485     break;
       
 14486 
       
 14487 /****
       
 14488  *DT_TO_UDINT
       
 14489  */
       
 14490     case function_dt_to_udint :
       
 14491     {
       
 14492         symbol_c *last_type_symbol = NULL;
       
 14493 
       
 14494         {
       
 14495             identifier_c param_name("IN");
       
 14496             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14497             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14498             
       
 14499             /* Get the value from a foo(<param_value>) style call */
       
 14500             if (IN_param_value == NULL)
       
 14501               IN_param_value = function_call_param_iterator.next();
       
 14502             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14503             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14504             
       
 14505             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14506             {
       
 14507         
       
 14508                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
       
 14509                 s4o.print("(");
       
 14510                 return_type_symbol->accept(*this);
       
 14511                 s4o.print(")time_to_real(");
       
 14512                 IN_param_value->accept(*this);
       
 14513                 s4o.print(")");
       
 14514                 return NULL;
       
 14515                 
       
 14516             }
       
 14517             
       
 14518             ERROR;
       
 14519         }
       
 14520         
       
 14521     }/*function_dt_to_udint*/
       
 14522     break;
       
 14523 
       
 14524 /****
       
 14525  *DT_TO_ULINT
       
 14526  */
       
 14527     case function_dt_to_ulint :
       
 14528     {
       
 14529         symbol_c *last_type_symbol = NULL;
       
 14530 
       
 14531         {
       
 14532             identifier_c param_name("IN");
       
 14533             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14534             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14535             
       
 14536             /* Get the value from a foo(<param_value>) style call */
       
 14537             if (IN_param_value == NULL)
       
 14538               IN_param_value = function_call_param_iterator.next();
       
 14539             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14540             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14541             
       
 14542             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14543             {
       
 14544         
       
 14545                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
       
 14546                 s4o.print("(");
       
 14547                 return_type_symbol->accept(*this);
       
 14548                 s4o.print(")time_to_real(");
       
 14549                 IN_param_value->accept(*this);
       
 14550                 s4o.print(")");
       
 14551                 return NULL;
       
 14552                 
       
 14553             }
       
 14554             
       
 14555             ERROR;
       
 14556         }
       
 14557         
       
 14558     }/*function_dt_to_ulint*/
       
 14559     break;
       
 14560 
       
 14561 /****
       
 14562  *DT_TO_BOOL
       
 14563  */
       
 14564     case function_dt_to_bool :
       
 14565     {
       
 14566         symbol_c *last_type_symbol = NULL;
       
 14567 
       
 14568         {
       
 14569             identifier_c param_name("IN");
       
 14570             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14571             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14572             
       
 14573             /* Get the value from a foo(<param_value>) style call */
       
 14574             if (IN_param_value == NULL)
       
 14575               IN_param_value = function_call_param_iterator.next();
       
 14576             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14577             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14578             
       
 14579             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14580             {
       
 14581         
       
 14582                 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
       
 14583                 s4o.print("(");
       
 14584                 return_type_symbol->accept(*this);
       
 14585                 s4o.print(")time_to_real(");
       
 14586                 IN_param_value->accept(*this);
       
 14587                 s4o.print(")");
       
 14588                 return NULL;
       
 14589                 
       
 14590             }
       
 14591             
       
 14592             ERROR;
       
 14593         }
       
 14594         
       
 14595     }/*function_dt_to_bool*/
       
 14596     break;
       
 14597 
       
 14598 /****
       
 14599  *DT_TO_BYTE
       
 14600  */
       
 14601     case function_dt_to_byte :
       
 14602     {
       
 14603         symbol_c *last_type_symbol = NULL;
       
 14604 
       
 14605         {
       
 14606             identifier_c param_name("IN");
       
 14607             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14608             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14609             
       
 14610             /* Get the value from a foo(<param_value>) style call */
       
 14611             if (IN_param_value == NULL)
       
 14612               IN_param_value = function_call_param_iterator.next();
       
 14613             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14614             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14615             
       
 14616             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14617             {
       
 14618         
       
 14619                 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
       
 14620                 s4o.print("(");
       
 14621                 return_type_symbol->accept(*this);
       
 14622                 s4o.print(")time_to_real(");
       
 14623                 IN_param_value->accept(*this);
       
 14624                 s4o.print(")");
       
 14625                 return NULL;
       
 14626                 
       
 14627             }
       
 14628             
       
 14629             ERROR;
       
 14630         }
       
 14631         
       
 14632     }/*function_dt_to_byte*/
       
 14633     break;
       
 14634 
       
 14635 /****
       
 14636  *DT_TO_WORD
       
 14637  */
       
 14638     case function_dt_to_word :
       
 14639     {
       
 14640         symbol_c *last_type_symbol = NULL;
       
 14641 
       
 14642         {
       
 14643             identifier_c param_name("IN");
       
 14644             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14645             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14646             
       
 14647             /* Get the value from a foo(<param_value>) style call */
       
 14648             if (IN_param_value == NULL)
       
 14649               IN_param_value = function_call_param_iterator.next();
       
 14650             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14651             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14652             
       
 14653             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14654             {
       
 14655         
       
 14656                 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
       
 14657                 s4o.print("(");
       
 14658                 return_type_symbol->accept(*this);
       
 14659                 s4o.print(")time_to_real(");
       
 14660                 IN_param_value->accept(*this);
       
 14661                 s4o.print(")");
       
 14662                 return NULL;
       
 14663                 
       
 14664             }
       
 14665             
       
 14666             ERROR;
       
 14667         }
       
 14668         
       
 14669     }/*function_dt_to_word*/
       
 14670     break;
       
 14671 
       
 14672 /****
       
 14673  *DT_TO_DWORD
       
 14674  */
       
 14675     case function_dt_to_dword :
       
 14676     {
       
 14677         symbol_c *last_type_symbol = NULL;
       
 14678 
       
 14679         {
       
 14680             identifier_c param_name("IN");
       
 14681             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14682             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14683             
       
 14684             /* Get the value from a foo(<param_value>) style call */
       
 14685             if (IN_param_value == NULL)
       
 14686               IN_param_value = function_call_param_iterator.next();
       
 14687             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14688             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14689             
       
 14690             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14691             {
       
 14692         
       
 14693                 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
       
 14694                 s4o.print("(");
       
 14695                 return_type_symbol->accept(*this);
       
 14696                 s4o.print(")time_to_real(");
       
 14697                 IN_param_value->accept(*this);
       
 14698                 s4o.print(")");
       
 14699                 return NULL;
       
 14700                 
       
 14701             }
       
 14702             
       
 14703             ERROR;
       
 14704         }
       
 14705         
       
 14706     }/*function_dt_to_dword*/
       
 14707     break;
       
 14708 
       
 14709 /****
       
 14710  *DT_TO_LWORD
       
 14711  */
       
 14712     case function_dt_to_lword :
       
 14713     {
       
 14714         symbol_c *last_type_symbol = NULL;
       
 14715 
       
 14716         {
       
 14717             identifier_c param_name("IN");
       
 14718             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14719             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14720             
       
 14721             /* Get the value from a foo(<param_value>) style call */
       
 14722             if (IN_param_value == NULL)
       
 14723               IN_param_value = function_call_param_iterator.next();
       
 14724             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14725             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14726             
       
 14727             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14728             {
       
 14729         
       
 14730                 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
       
 14731                 s4o.print("(");
       
 14732                 return_type_symbol->accept(*this);
       
 14733                 s4o.print(")time_to_real(");
       
 14734                 IN_param_value->accept(*this);
       
 14735                 s4o.print(")");
       
 14736                 return NULL;
       
 14737                 
       
 14738             }
       
 14739             
       
 14740             ERROR;
       
 14741         }
       
 14742         
       
 14743     }/*function_dt_to_lword*/
       
 14744     break;
       
 14745 
       
 14746 /****
       
 14747  *DT_TO_STRING
       
 14748  */
       
 14749     case function_dt_to_string :
       
 14750     {
       
 14751         symbol_c *last_type_symbol = NULL;
       
 14752 
       
 14753         {
       
 14754             identifier_c param_name("IN");
       
 14755             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14756             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14757             
       
 14758             /* Get the value from a foo(<param_value>) style call */
       
 14759             if (IN_param_value == NULL)
       
 14760               IN_param_value = function_call_param_iterator.next();
       
 14761             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14762             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14763             
       
 14764             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14765             {
       
 14766         
       
 14767                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
       
 14768                 s4o.print("(");
       
 14769                 return_type_symbol->accept(*this);
       
 14770                 s4o.print(")time_to_string(");
       
 14771                 IN_param_value->accept(*this);
 13402                 IN_param_value->accept(*this);
 14772                 s4o.print(")");
 13403                 s4o.print(")");
 14773                 return NULL;
 13404                 return NULL;
 14774                 
 13405                 
 14775             }
 13406             }
 14776             
 13407             
 14777             ERROR;
 13408             ERROR;
 14778         }
 13409         }
 14779         
 13410         
 14780     }/*function_dt_to_string*/
 13411     }/*function_dt_to_string*/
 14781     break;
       
 14782 
       
 14783 /****
       
 14784  *DT_TO_WSTRING
       
 14785  */
       
 14786     case function_dt_to_wstring :
       
 14787     {
       
 14788         symbol_c *last_type_symbol = NULL;
       
 14789 
       
 14790         {
       
 14791             identifier_c param_name("IN");
       
 14792             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14793             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14794             
       
 14795             /* Get the value from a foo(<param_value>) style call */
       
 14796             if (IN_param_value == NULL)
       
 14797               IN_param_value = function_call_param_iterator.next();
       
 14798             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14799             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14800             
       
 14801             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
       
 14802             {
       
 14803         
       
 14804                 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name;
       
 14805                 s4o.print("(");
       
 14806                 return_type_symbol->accept(*this);
       
 14807                 s4o.print(")time_to_string(");
       
 14808                 IN_param_value->accept(*this);
       
 14809                 s4o.print(")");
       
 14810                 return NULL;
       
 14811                 
       
 14812             }
       
 14813             
       
 14814             ERROR;
       
 14815         }
       
 14816         
       
 14817     }/*function_dt_to_wstring*/
       
 14818     break;
 13412     break;
 14819 
 13413 
 14820 /****
 13414 /****
 14821  *TRUNC
 13415  *TRUNC
 14822  */
 13416  */
 14850         
 13444         
 14851     }/*function_trunc*/
 13445     }/*function_trunc*/
 14852     break;
 13446     break;
 14853 
 13447 
 14854 /****
 13448 /****
 14855  *BCD_TO_SINT
       
 14856  */
       
 14857     case function_bcd_to_sint :
       
 14858     {
       
 14859         symbol_c *last_type_symbol = NULL;
       
 14860 
       
 14861         {
       
 14862             identifier_c param_name("IN");
       
 14863             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14864             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14865             
       
 14866             /* Get the value from a foo(<param_value>) style call */
       
 14867             if (IN_param_value == NULL)
       
 14868               IN_param_value = function_call_param_iterator.next();
       
 14869             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14870             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14871             
       
 14872             if(search_expression_type->is_binary_type(IN_type_symbol))
       
 14873             {
       
 14874         
       
 14875                 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
       
 14876                 s4o.print("__bcd_to_something(sizeof(");
       
 14877                 IN_type_symbol->accept(*this);
       
 14878                 s4o.print("),&");
       
 14879                 IN_param_value->accept(*this);
       
 14880                 s4o.print(")");
       
 14881                 return NULL;
       
 14882                 
       
 14883             }
       
 14884             
       
 14885             ERROR;
       
 14886         }
       
 14887         
       
 14888     }/*function_bcd_to_sint*/
       
 14889     break;
       
 14890 
       
 14891 /****
       
 14892  *BCD_TO_INT
       
 14893  */
       
 14894     case function_bcd_to_int :
       
 14895     {
       
 14896         symbol_c *last_type_symbol = NULL;
       
 14897 
       
 14898         {
       
 14899             identifier_c param_name("IN");
       
 14900             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14901             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14902             
       
 14903             /* Get the value from a foo(<param_value>) style call */
       
 14904             if (IN_param_value == NULL)
       
 14905               IN_param_value = function_call_param_iterator.next();
       
 14906             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14907             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14908             
       
 14909             if(search_expression_type->is_binary_type(IN_type_symbol))
       
 14910             {
       
 14911         
       
 14912                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
       
 14913                 s4o.print("__bcd_to_something(sizeof(");
       
 14914                 IN_type_symbol->accept(*this);
       
 14915                 s4o.print("),&");
       
 14916                 IN_param_value->accept(*this);
       
 14917                 s4o.print(")");
       
 14918                 return NULL;
       
 14919                 
       
 14920             }
       
 14921             
       
 14922             ERROR;
       
 14923         }
       
 14924         
       
 14925     }/*function_bcd_to_int*/
       
 14926     break;
       
 14927 
       
 14928 /****
       
 14929  *BCD_TO_DINT
       
 14930  */
       
 14931     case function_bcd_to_dint :
       
 14932     {
       
 14933         symbol_c *last_type_symbol = NULL;
       
 14934 
       
 14935         {
       
 14936             identifier_c param_name("IN");
       
 14937             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14938             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14939             
       
 14940             /* Get the value from a foo(<param_value>) style call */
       
 14941             if (IN_param_value == NULL)
       
 14942               IN_param_value = function_call_param_iterator.next();
       
 14943             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14944             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14945             
       
 14946             if(search_expression_type->is_binary_type(IN_type_symbol))
       
 14947             {
       
 14948         
       
 14949                 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
       
 14950                 s4o.print("__bcd_to_something(sizeof(");
       
 14951                 IN_type_symbol->accept(*this);
       
 14952                 s4o.print("),&");
       
 14953                 IN_param_value->accept(*this);
       
 14954                 s4o.print(")");
       
 14955                 return NULL;
       
 14956                 
       
 14957             }
       
 14958             
       
 14959             ERROR;
       
 14960         }
       
 14961         
       
 14962     }/*function_bcd_to_dint*/
       
 14963     break;
       
 14964 
       
 14965 /****
       
 14966  *BCD_TO_LINT
       
 14967  */
       
 14968     case function_bcd_to_lint :
       
 14969     {
       
 14970         symbol_c *last_type_symbol = NULL;
       
 14971 
       
 14972         {
       
 14973             identifier_c param_name("IN");
       
 14974             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 14975             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 14976             
       
 14977             /* Get the value from a foo(<param_value>) style call */
       
 14978             if (IN_param_value == NULL)
       
 14979               IN_param_value = function_call_param_iterator.next();
       
 14980             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 14981             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 14982             
       
 14983             if(search_expression_type->is_binary_type(IN_type_symbol))
       
 14984             {
       
 14985         
       
 14986                 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
       
 14987                 s4o.print("__bcd_to_something(sizeof(");
       
 14988                 IN_type_symbol->accept(*this);
       
 14989                 s4o.print("),&");
       
 14990                 IN_param_value->accept(*this);
       
 14991                 s4o.print(")");
       
 14992                 return NULL;
       
 14993                 
       
 14994             }
       
 14995             
       
 14996             ERROR;
       
 14997         }
       
 14998         
       
 14999     }/*function_bcd_to_lint*/
       
 15000     break;
       
 15001 
       
 15002 /****
       
 15003  *BCD_TO_USINT
 13449  *BCD_TO_USINT
 15004  */
 13450  */
 15005     case function_bcd_to_usint :
 13451     case function_bcd_to_usint :
 15006     {
 13452     {
 15007         symbol_c *last_type_symbol = NULL;
 13453         symbol_c *last_type_symbol = NULL;
 15015             if (IN_param_value == NULL)
 13461             if (IN_param_value == NULL)
 15016               IN_param_value = function_call_param_iterator.next();
 13462               IN_param_value = function_call_param_iterator.next();
 15017             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13463             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 15018             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13464             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 15019             
 13465             
 15020             if(search_expression_type->is_binary_type(IN_type_symbol))
 13466             if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
 15021             {
 13467             {
 15022         
 13468         
 15023                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
 13469                 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
 15024                 s4o.print("__bcd_to_something(sizeof(");
 13470                 s4o.print("(");
 15025                 IN_type_symbol->accept(*this);
 13471                 return_type_symbol->accept(*this);
 15026                 s4o.print("),&");
 13472                 s4o.print(")__bcd_to_uint(");
 15027                 IN_param_value->accept(*this);
 13473                 IN_param_value->accept(*this);
 15028                 s4o.print(")");
 13474                 s4o.print(")");
 15029                 return NULL;
 13475                 return NULL;
 15030                 
 13476                 
 15031             }
 13477             }
 15052             if (IN_param_value == NULL)
 13498             if (IN_param_value == NULL)
 15053               IN_param_value = function_call_param_iterator.next();
 13499               IN_param_value = function_call_param_iterator.next();
 15054             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13500             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 15055             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13501             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 15056             
 13502             
 15057             if(search_expression_type->is_binary_type(IN_type_symbol))
 13503             if (typeid(*last_type_symbol) == typeid(word_type_name_c))
 15058             {
 13504             {
 15059         
 13505         
 15060                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
 13506                 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
 15061                 s4o.print("__bcd_to_something(sizeof(");
 13507                 s4o.print("(");
 15062                 IN_type_symbol->accept(*this);
 13508                 return_type_symbol->accept(*this);
 15063                 s4o.print("),&");
 13509                 s4o.print(")__bcd_to_uint(");
 15064                 IN_param_value->accept(*this);
 13510                 IN_param_value->accept(*this);
 15065                 s4o.print(")");
 13511                 s4o.print(")");
 15066                 return NULL;
 13512                 return NULL;
 15067                 
 13513                 
 15068             }
 13514             }
 15089             if (IN_param_value == NULL)
 13535             if (IN_param_value == NULL)
 15090               IN_param_value = function_call_param_iterator.next();
 13536               IN_param_value = function_call_param_iterator.next();
 15091             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13537             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 15092             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13538             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 15093             
 13539             
 15094             if(search_expression_type->is_binary_type(IN_type_symbol))
 13540             if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
 15095             {
 13541             {
 15096         
 13542         
 15097                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
 13543                 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
 15098                 s4o.print("__bcd_to_something(sizeof(");
 13544                 s4o.print("(");
 15099                 IN_type_symbol->accept(*this);
 13545                 return_type_symbol->accept(*this);
 15100                 s4o.print("),&");
 13546                 s4o.print(")__bcd_to_uint(");
 15101                 IN_param_value->accept(*this);
 13547                 IN_param_value->accept(*this);
 15102                 s4o.print(")");
 13548                 s4o.print(")");
 15103                 return NULL;
 13549                 return NULL;
 15104                 
 13550                 
 15105             }
 13551             }
 15126             if (IN_param_value == NULL)
 13572             if (IN_param_value == NULL)
 15127               IN_param_value = function_call_param_iterator.next();
 13573               IN_param_value = function_call_param_iterator.next();
 15128             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13574             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 15129             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13575             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 15130             
 13576             
 15131             if(search_expression_type->is_binary_type(IN_type_symbol))
 13577             if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
 15132             {
 13578             {
 15133         
 13579         
 15134                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
 13580                 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
 15135                 s4o.print("__bcd_to_something(sizeof(");
 13581                 s4o.print("(");
 15136                 IN_type_symbol->accept(*this);
 13582                 return_type_symbol->accept(*this);
 15137                 s4o.print("),&");
 13583                 s4o.print(")__bcd_to_uint(");
 15138                 IN_param_value->accept(*this);
 13584                 IN_param_value->accept(*this);
 15139                 s4o.print(")");
 13585                 s4o.print(")");
 15140                 return NULL;
 13586                 return NULL;
 15141                 
 13587                 
 15142             }
 13588             }
 15146         
 13592         
 15147     }/*function_bcd_to_ulint*/
 13593     }/*function_bcd_to_ulint*/
 15148     break;
 13594     break;
 15149 
 13595 
 15150 /****
 13596 /****
 15151  *SINT_TO_BCD
 13597  *USINT_TO_BCD
 15152  */
 13598  */
 15153     case function_sint_to_bcd :
 13599     case function_usint_to_bcd :
 15154     {
 13600     {
 15155         symbol_c *last_type_symbol = NULL;
 13601         symbol_c *last_type_symbol = NULL;
 15156 
 13602 
 15157         {
 13603         {
 15158             identifier_c param_name("IN");
 13604             identifier_c param_name("IN");
 15159             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13605             /* Get the value from a foo(<param_name> = <param_value>) style call */
 15160             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13606             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 15161             
 13607             
 15162             /* Get the value from a foo(<param_value>) style call */
 13608             /* Get the value from a foo(<param_value>) style call */
 15163             if (IN_param_value == NULL)
 13609             if (IN_param_value == NULL)
 15164               IN_param_value = function_call_param_iterator.next();
 13610               IN_param_value = function_call_param_iterator.next();
 15165             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13611             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 15166             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13612             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 15167             
 13613             
 15168             if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
 13614             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
 15169             {
 13615             {
 15170         
 13616         
 15171                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
 13617                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
 15172                 s4o.print("__something_to_bcd(sizeof(");
 13618                 s4o.print("(");
 15173                 IN_type_symbol->accept(*this);
 13619                 return_type_symbol->accept(*this);
 15174                 s4o.print("),&");
 13620                 s4o.print(")__uint_to_bcd(");
 15175                 IN_param_value->accept(*this);
 13621                 IN_param_value->accept(*this);
 15176                 s4o.print(")");
 13622                 s4o.print(")");
 15177                 return NULL;
 13623                 return NULL;
 15178                 
 13624                 
 15179             }
 13625             }
 15180             
 13626             
 15181             ERROR;
 13627             ERROR;
 15182         }
 13628         }
 15183         
 13629         
 15184     }/*function_sint_to_bcd*/
 13630     }/*function_usint_to_bcd*/
 15185     break;
 13631     break;
 15186 
 13632 
 15187 /****
 13633 /****
 15188  *INT_TO_BCD
 13634  *UINT_TO_BCD
 15189  */
 13635  */
 15190     case function_int_to_bcd :
 13636     case function_uint_to_bcd :
 15191     {
 13637     {
 15192         symbol_c *last_type_symbol = NULL;
 13638         symbol_c *last_type_symbol = NULL;
 15193 
 13639 
 15194         {
 13640         {
 15195             identifier_c param_name("IN");
 13641             identifier_c param_name("IN");
 15196             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13642             /* Get the value from a foo(<param_name> = <param_value>) style call */
 15197             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13643             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 15198             
 13644             
 15199             /* Get the value from a foo(<param_value>) style call */
 13645             /* Get the value from a foo(<param_value>) style call */
 15200             if (IN_param_value == NULL)
 13646             if (IN_param_value == NULL)
 15201               IN_param_value = function_call_param_iterator.next();
 13647               IN_param_value = function_call_param_iterator.next();
 15202             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13648             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 15203             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13649             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 15204             
 13650             
 15205             if (typeid(*last_type_symbol) == typeid(int_type_name_c))
 13651             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 15206             {
 13652             {
 15207         
 13653         
 15208                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
 13654                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
 15209                 s4o.print("__something_to_bcd(sizeof(");
 13655                 s4o.print("(");
 15210                 IN_type_symbol->accept(*this);
 13656                 return_type_symbol->accept(*this);
 15211                 s4o.print("),&");
 13657                 s4o.print(")__uint_to_bcd(");
 15212                 IN_param_value->accept(*this);
 13658                 IN_param_value->accept(*this);
 15213                 s4o.print(")");
 13659                 s4o.print(")");
 15214                 return NULL;
 13660                 return NULL;
 15215                 
 13661                 
 15216             }
 13662             }
 15217             
 13663             
 15218             ERROR;
 13664             ERROR;
 15219         }
 13665         }
 15220         
 13666         
 15221     }/*function_int_to_bcd*/
 13667     }/*function_uint_to_bcd*/
 15222     break;
 13668     break;
 15223 
 13669 
 15224 /****
 13670 /****
 15225  *DINT_TO_BCD
 13671  *UDINT_TO_BCD
 15226  */
 13672  */
 15227     case function_dint_to_bcd :
 13673     case function_udint_to_bcd :
 15228     {
 13674     {
 15229         symbol_c *last_type_symbol = NULL;
 13675         symbol_c *last_type_symbol = NULL;
 15230 
 13676 
 15231         {
 13677         {
 15232             identifier_c param_name("IN");
 13678             identifier_c param_name("IN");
 15233             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13679             /* Get the value from a foo(<param_name> = <param_value>) style call */
 15234             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13680             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 15235             
 13681             
 15236             /* Get the value from a foo(<param_value>) style call */
 13682             /* Get the value from a foo(<param_value>) style call */
 15237             if (IN_param_value == NULL)
 13683             if (IN_param_value == NULL)
 15238               IN_param_value = function_call_param_iterator.next();
 13684               IN_param_value = function_call_param_iterator.next();
 15239             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13685             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 15240             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13686             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 15241             
 13687             
 15242             if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
 13688             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
 15243             {
 13689             {
 15244         
 13690         
 15245                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
 13691                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
 15246                 s4o.print("__something_to_bcd(sizeof(");
 13692                 s4o.print("(");
 15247                 IN_type_symbol->accept(*this);
 13693                 return_type_symbol->accept(*this);
 15248                 s4o.print("),&");
 13694                 s4o.print(")__uint_to_bcd(");
 15249                 IN_param_value->accept(*this);
 13695                 IN_param_value->accept(*this);
 15250                 s4o.print(")");
 13696                 s4o.print(")");
 15251                 return NULL;
 13697                 return NULL;
 15252                 
 13698                 
 15253             }
 13699             }
 15254             
 13700             
 15255             ERROR;
 13701             ERROR;
 15256         }
 13702         }
 15257         
 13703         
 15258     }/*function_dint_to_bcd*/
 13704     }/*function_udint_to_bcd*/
 15259     break;
 13705     break;
 15260 
 13706 
 15261 /****
 13707 /****
 15262  *LINT_TO_BCD
 13708  *ULINT_TO_BCD
 15263  */
 13709  */
 15264     case function_lint_to_bcd :
 13710     case function_ulint_to_bcd :
 15265     {
 13711     {
 15266         symbol_c *last_type_symbol = NULL;
 13712         symbol_c *last_type_symbol = NULL;
 15267 
 13713 
 15268         {
 13714         {
 15269             identifier_c param_name("IN");
 13715             identifier_c param_name("IN");
 15270             /* Get the value from a foo(<param_name> = <param_value>) style call */
 13716             /* Get the value from a foo(<param_name> = <param_value>) style call */
 15271             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 13717             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
 15272             
 13718             
 15273             /* Get the value from a foo(<param_value>) style call */
 13719             /* Get the value from a foo(<param_value>) style call */
 15274             if (IN_param_value == NULL)
 13720             if (IN_param_value == NULL)
 15275               IN_param_value = function_call_param_iterator.next();
 13721               IN_param_value = function_call_param_iterator.next();
 15276             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 13722             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 15277             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 13723             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 15278             
 13724             
 15279             if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
 13725             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
 15280             {
 13726             {
 15281         
 13727         
 15282                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
 13728                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
 15283                 s4o.print("__something_to_bcd(sizeof(");
 13729                 s4o.print("(");
 15284                 IN_type_symbol->accept(*this);
 13730                 return_type_symbol->accept(*this);
 15285                 s4o.print("),&");
 13731                 s4o.print(")__uint_to_bcd(");
 15286                 IN_param_value->accept(*this);
       
 15287                 s4o.print(")");
       
 15288                 return NULL;
       
 15289                 
       
 15290             }
       
 15291             
       
 15292             ERROR;
       
 15293         }
       
 15294         
       
 15295     }/*function_lint_to_bcd*/
       
 15296     break;
       
 15297 
       
 15298 /****
       
 15299  *USINT_TO_BCD
       
 15300  */
       
 15301     case function_usint_to_bcd :
       
 15302     {
       
 15303         symbol_c *last_type_symbol = NULL;
       
 15304 
       
 15305         {
       
 15306             identifier_c param_name("IN");
       
 15307             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15308             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 15309             
       
 15310             /* Get the value from a foo(<param_value>) style call */
       
 15311             if (IN_param_value == NULL)
       
 15312               IN_param_value = function_call_param_iterator.next();
       
 15313             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 15314             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 15315             
       
 15316             if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
       
 15317             {
       
 15318         
       
 15319                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
       
 15320                 s4o.print("__something_to_bcd(sizeof(");
       
 15321                 IN_type_symbol->accept(*this);
       
 15322                 s4o.print("),&");
       
 15323                 IN_param_value->accept(*this);
       
 15324                 s4o.print(")");
       
 15325                 return NULL;
       
 15326                 
       
 15327             }
       
 15328             
       
 15329             ERROR;
       
 15330         }
       
 15331         
       
 15332     }/*function_usint_to_bcd*/
       
 15333     break;
       
 15334 
       
 15335 /****
       
 15336  *UINT_TO_BCD
       
 15337  */
       
 15338     case function_uint_to_bcd :
       
 15339     {
       
 15340         symbol_c *last_type_symbol = NULL;
       
 15341 
       
 15342         {
       
 15343             identifier_c param_name("IN");
       
 15344             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15345             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 15346             
       
 15347             /* Get the value from a foo(<param_value>) style call */
       
 15348             if (IN_param_value == NULL)
       
 15349               IN_param_value = function_call_param_iterator.next();
       
 15350             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 15351             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 15352             
       
 15353             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
       
 15354             {
       
 15355         
       
 15356                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
       
 15357                 s4o.print("__something_to_bcd(sizeof(");
       
 15358                 IN_type_symbol->accept(*this);
       
 15359                 s4o.print("),&");
       
 15360                 IN_param_value->accept(*this);
       
 15361                 s4o.print(")");
       
 15362                 return NULL;
       
 15363                 
       
 15364             }
       
 15365             
       
 15366             ERROR;
       
 15367         }
       
 15368         
       
 15369     }/*function_uint_to_bcd*/
       
 15370     break;
       
 15371 
       
 15372 /****
       
 15373  *UDINT_TO_BCD
       
 15374  */
       
 15375     case function_udint_to_bcd :
       
 15376     {
       
 15377         symbol_c *last_type_symbol = NULL;
       
 15378 
       
 15379         {
       
 15380             identifier_c param_name("IN");
       
 15381             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15382             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 15383             
       
 15384             /* Get the value from a foo(<param_value>) style call */
       
 15385             if (IN_param_value == NULL)
       
 15386               IN_param_value = function_call_param_iterator.next();
       
 15387             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 15388             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 15389             
       
 15390             if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
       
 15391             {
       
 15392         
       
 15393                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
       
 15394                 s4o.print("__something_to_bcd(sizeof(");
       
 15395                 IN_type_symbol->accept(*this);
       
 15396                 s4o.print("),&");
       
 15397                 IN_param_value->accept(*this);
       
 15398                 s4o.print(")");
       
 15399                 return NULL;
       
 15400                 
       
 15401             }
       
 15402             
       
 15403             ERROR;
       
 15404         }
       
 15405         
       
 15406     }/*function_udint_to_bcd*/
       
 15407     break;
       
 15408 
       
 15409 /****
       
 15410  *ULINT_TO_BCD
       
 15411  */
       
 15412     case function_ulint_to_bcd :
       
 15413     {
       
 15414         symbol_c *last_type_symbol = NULL;
       
 15415 
       
 15416         {
       
 15417             identifier_c param_name("IN");
       
 15418             /* Get the value from a foo(<param_name> = <param_value>) style call */
       
 15419             symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
       
 15420             
       
 15421             /* Get the value from a foo(<param_value>) style call */
       
 15422             if (IN_param_value == NULL)
       
 15423               IN_param_value = function_call_param_iterator.next();
       
 15424             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
       
 15425             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
       
 15426             
       
 15427             if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
       
 15428             {
       
 15429         
       
 15430                 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
       
 15431                 s4o.print("__something_to_bcd(sizeof(");
       
 15432                 IN_type_symbol->accept(*this);
       
 15433                 s4o.print("),&");
       
 15434                 IN_param_value->accept(*this);
 13732                 IN_param_value->accept(*this);
 15435                 s4o.print(")");
 13733                 s4o.print(")");
 15436                 return NULL;
 13734                 return NULL;
 15437                 
 13735                 
 15438             }
 13736             }
 15463             
 13761             
 15464             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
 13762             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
 15465             {
 13763             {
 15466         
 13764         
 15467                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
 13765                 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
 15468                 s4o.print("__date_and_time_to_time_of_day(&");
 13766                 s4o.print("__date_and_time_to_time_of_day(");
 15469                 IN_param_value->accept(*this);
 13767                 IN_param_value->accept(*this);
 15470                 s4o.print(")");
 13768                 s4o.print(")");
 15471                 return NULL;
 13769                 return NULL;
 15472                 
 13770                 
 15473             }
 13771             }
 15498             
 13796             
 15499             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
 13797             if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
 15500             {
 13798             {
 15501         
 13799         
 15502                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
 13800                 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
 15503                 s4o.print("__date_and_time_to_time_of_day(&");
 13801                 s4o.print("__date_and_time_to_date(");
 15504                 IN_param_value->accept(*this);
 13802                 IN_param_value->accept(*this);
 15505                 s4o.print(")");
 13803                 s4o.print(")");
 15506                 return NULL;
 13804                 return NULL;
 15507                 
 13805                 
 15508             }
 13806             }
 15992                     
 14290                     
 15993                     if (typeid(*last_type_symbol) == typeid(time_type_name_c))
 14291                     if (typeid(*last_type_symbol) == typeid(time_type_name_c))
 15994                     {
 14292                     {
 15995                 
 14293                 
 15996                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
 14294                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
 15997                         s4o.print("__time_add(&");
 14295                         s4o.print("__time_add(");
 15998                         IN1_param_value->accept(*this);
 14296                         IN1_param_value->accept(*this);
 15999                         s4o.print(", &");
 14297                         s4o.print(", ");
 16000                         IN2_param_value->accept(*this);
 14298                         IN2_param_value->accept(*this);
 16001                         s4o.print(")");
 14299                         s4o.print(")");
 16002                         return NULL;
 14300                         return NULL;
 16003                         
 14301                         
 16004                     }
 14302                     }
 16024                     
 14322                     
 16025                     if (typeid(*last_type_symbol) == typeid(time_type_name_c))
 14323                     if (typeid(*last_type_symbol) == typeid(time_type_name_c))
 16026                     {
 14324                     {
 16027                 
 14325                 
 16028                         symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
 14326                         symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
 16029                         s4o.print("__time_add(&");
 14327                         s4o.print("__time_add(");
 16030                         IN1_param_value->accept(*this);
 14328                         IN1_param_value->accept(*this);
 16031                         s4o.print(", &");
 14329                         s4o.print(", ");
 16032                         IN2_param_value->accept(*this);
 14330                         IN2_param_value->accept(*this);
 16033                         s4o.print(")");
 14331                         s4o.print(")");
 16034                         return NULL;
 14332                         return NULL;
 16035                         
 14333                         
 16036                     }
 14334                     }
 16056                     
 14354                     
 16057                     if (typeid(*last_type_symbol) == typeid(time_type_name_c))
 14355                     if (typeid(*last_type_symbol) == typeid(time_type_name_c))
 16058                     {
 14356                     {
 16059                 
 14357                 
 16060                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14358                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 16061                         s4o.print("__time_add(&");
 14359                         s4o.print("__time_add(");
 16062                         IN1_param_value->accept(*this);
 14360                         IN1_param_value->accept(*this);
 16063                         s4o.print(", &");
 14361                         s4o.print(", ");
 16064                         IN2_param_value->accept(*this);
 14362                         IN2_param_value->accept(*this);
 16065                         s4o.print(")");
 14363                         s4o.print(")");
 16066                         return NULL;
 14364                         return NULL;
 16067                         
 14365                         
 16068                     }
 14366                     }
 16170                     
 14468                     
 16171                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14469                     if(search_expression_type->is_num_type(IN2_type_symbol))
 16172                     {
 14470                     {
 16173                 
 14471                 
 16174                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14472                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 16175                         s4o.print("__time_mul(&");
 14473                         s4o.print("__time_mul(");
 16176                         IN1_param_value->accept(*this);
 14474                         IN1_param_value->accept(*this);
 16177                         s4o.print(", &");
 14475                         s4o.print(", ");
 16178                         IN2_param_value->accept(*this);
 14476                         IN2_param_value->accept(*this);
 16179                         s4o.print(")");
 14477                         s4o.print(")");
 16180                         return NULL;
 14478                         return NULL;
 16181                         
 14479                         
 16182                     }
 14480                     }
 16258                     
 14556                     
 16259                     if (typeid(*last_type_symbol) == typeid(date_type_name_c))
 14557                     if (typeid(*last_type_symbol) == typeid(date_type_name_c))
 16260                     {
 14558                     {
 16261                 
 14559                 
 16262                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14560                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 16263                         s4o.print("__time_sub(&");
 14561                         s4o.print("__time_sub(");
 16264                         IN1_param_value->accept(*this);
 14562                         IN1_param_value->accept(*this);
 16265                         s4o.print(", &");
 14563                         s4o.print(", ");
 16266                         IN2_param_value->accept(*this);
 14564                         IN2_param_value->accept(*this);
 16267                         s4o.print(")");
 14565                         s4o.print(")");
 16268                         return NULL;
 14566                         return NULL;
 16269                         
 14567                         
 16270                     }
 14568                     }
 16290                     
 14588                     
 16291                     if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
 14589                     if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
 16292                     {
 14590                     {
 16293                 
 14591                 
 16294                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14592                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 16295                         s4o.print("__time_sub(&");
 14593                         s4o.print("__time_sub(");
 16296                         IN1_param_value->accept(*this);
 14594                         IN1_param_value->accept(*this);
 16297                         s4o.print(", &");
 14595                         s4o.print(", ");
 16298                         IN2_param_value->accept(*this);
 14596                         IN2_param_value->accept(*this);
 16299                         s4o.print(")");
 14597                         s4o.print(")");
 16300                         return NULL;
 14598                         return NULL;
 16301                         
 14599                         
 16302                     }
 14600                     }
 16303                     
 14601                     
 16304                     if (typeid(*last_type_symbol) == typeid(time_type_name_c))
 14602                     if (typeid(*last_type_symbol) == typeid(time_type_name_c))
 16305                     {
 14603                     {
 16306                 
 14604                 
 16307                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
 14605                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
 16308                         s4o.print("__time_sub(&");
 14606                         s4o.print("__time_sub(");
 16309                         IN1_param_value->accept(*this);
 14607                         IN1_param_value->accept(*this);
 16310                         s4o.print(", &");
 14608                         s4o.print(", ");
 16311                         IN2_param_value->accept(*this);
 14609                         IN2_param_value->accept(*this);
 16312                         s4o.print(")");
 14610                         s4o.print(")");
 16313                         return NULL;
 14611                         return NULL;
 16314                         
 14612                         
 16315                     }
 14613                     }
 16335                     
 14633                     
 16336                     if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
 14634                     if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
 16337                     {
 14635                     {
 16338                 
 14636                 
 16339                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14637                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 16340                         s4o.print("__time_sub(&");
 14638                         s4o.print("__time_sub(");
 16341                         IN1_param_value->accept(*this);
 14639                         IN1_param_value->accept(*this);
 16342                         s4o.print(", &");
 14640                         s4o.print(", ");
 16343                         IN2_param_value->accept(*this);
 14641                         IN2_param_value->accept(*this);
 16344                         s4o.print(")");
 14642                         s4o.print(")");
 16345                         return NULL;
 14643                         return NULL;
 16346                         
 14644                         
 16347                     }
 14645                     }
 16348                     
 14646                     
 16349                     if (typeid(*last_type_symbol) == typeid(time_type_name_c))
 14647                     if (typeid(*last_type_symbol) == typeid(time_type_name_c))
 16350                     {
 14648                     {
 16351                 
 14649                 
 16352                         symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
 14650                         symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
 16353                         s4o.print("__time_sub(&");
 14651                         s4o.print("__time_sub(");
 16354                         IN1_param_value->accept(*this);
 14652                         IN1_param_value->accept(*this);
 16355                         s4o.print(", &");
 14653                         s4o.print(", ");
 16356                         IN2_param_value->accept(*this);
 14654                         IN2_param_value->accept(*this);
 16357                         s4o.print(")");
 14655                         s4o.print(")");
 16358                         return NULL;
 14656                         return NULL;
 16359                         
 14657                         
 16360                     }
 14658                     }
 16380                     
 14678                     
 16381                     if (typeid(*last_type_symbol) == typeid(time_type_name_c))
 14679                     if (typeid(*last_type_symbol) == typeid(time_type_name_c))
 16382                     {
 14680                     {
 16383                 
 14681                 
 16384                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14682                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 16385                         s4o.print("__time_sub(&");
 14683                         s4o.print("__time_sub(");
 16386                         IN1_param_value->accept(*this);
 14684                         IN1_param_value->accept(*this);
 16387                         s4o.print(", &");
 14685                         s4o.print(", ");
 16388                         IN2_param_value->accept(*this);
 14686                         IN2_param_value->accept(*this);
 16389                         s4o.print(")");
 14687                         s4o.print(")");
 16390                         return NULL;
 14688                         return NULL;
 16391                         
 14689                         
 16392                     }
 14690                     }
 16468                     
 14766                     
 16469                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14767                     if(search_expression_type->is_num_type(IN2_type_symbol))
 16470                     {
 14768                     {
 16471                 
 14769                 
 16472                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 14770                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
 16473                         s4o.print("__time_div(&");
 14771                         s4o.print("__time_div(");
 16474                         IN1_param_value->accept(*this);
 14772                         IN1_param_value->accept(*this);
 16475                         s4o.print(", &");
 14773                         s4o.print(", ");
 16476                         IN2_param_value->accept(*this);
 14774                         IN2_param_value->accept(*this);
 16477                         s4o.print(")");
 14775                         s4o.print(")");
 16478                         return NULL;
 14776                         return NULL;
 16479                         
 14777                         
 16480                     }
 14778                     }
 16580                     
 14878                     
 16581                     if(search_expression_type->is_num_type(IN2_type_symbol))
 14879                     if(search_expression_type->is_num_type(IN2_type_symbol))
 16582                     {
 14880                     {
 16583                 
 14881                 
 16584                         symbol_c * return_type_symbol = last_type_symbol;
 14882                         symbol_c * return_type_symbol = last_type_symbol;
 16585                         s4o.print("pow(&");
 14883                         s4o.print("pow(");
 16586                         IN1_param_value->accept(*this);
 14884                         IN1_param_value->accept(*this);
 16587                         s4o.print(", &");
 14885                         s4o.print(", ");
 16588                         IN2_param_value->accept(*this);
 14886                         IN2_param_value->accept(*this);
 16589                         s4o.print(")");
 14887                         s4o.print(")");
 16590                         return NULL;
 14888                         return NULL;
 16591                         
 14889                         
 16592                     }
 14890                     }
 16759             if (IN_param_value == NULL)
 15057             if (IN_param_value == NULL)
 16760               IN_param_value = function_call_param_iterator.next();
 15058               IN_param_value = function_call_param_iterator.next();
 16761             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 15059             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 16762             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 15060             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 16763             
 15061             
 16764             if(search_expression_type->is_binary_type(IN_type_symbol))
 15062             if(search_expression_type->is_nbinary_type(IN_type_symbol))
 16765             {
 15063             {
 16766         
 15064         
 16767                 {
 15065                 {
 16768                     identifier_c param_name("N");
 15066                     identifier_c param_name("N");
 16769                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 15067                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 16777                     
 15075                     
 16778                     if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 15076                     if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 16779                     {
 15077                     {
 16780                 
 15078                 
 16781                         symbol_c * return_type_symbol = IN_type_symbol;
 15079                         symbol_c * return_type_symbol = IN_type_symbol;
 16782                         s4o.print("__ror(sizeof(");
 15080                         s4o.print("__ror_");
 16783                         IN_type_symbol->accept(*this);
 15081                         IN_type_symbol->accept(*this);
 16784                         s4o.print("), &");
 15082                         s4o.print("(");
 16785                         IN_param_value->accept(*this);
 15083                         IN_param_value->accept(*this);
 16786                         s4o.print(", ");
 15084                         s4o.print(", ");
 16787                         N_param_value->accept(*this);
 15085                         N_param_value->accept(*this);
 16788                         s4o.print(")");
 15086                         s4o.print(")");
 16789                         return NULL;
 15087                         return NULL;
 16817             if (IN_param_value == NULL)
 15115             if (IN_param_value == NULL)
 16818               IN_param_value = function_call_param_iterator.next();
 15116               IN_param_value = function_call_param_iterator.next();
 16819             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 15117             symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
 16820             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 15118             last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
 16821             
 15119             
 16822             if(search_expression_type->is_binary_type(IN_type_symbol))
 15120             if(search_expression_type->is_nbinary_type(IN_type_symbol))
 16823             {
 15121             {
 16824         
 15122         
 16825                 {
 15123                 {
 16826                     identifier_c param_name("N");
 15124                     identifier_c param_name("N");
 16827                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 15125                     /* Get the value from a foo(<param_name> = <param_value>) style call */
 16835                     
 15133                     
 16836                     if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 15134                     if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 16837                     {
 15135                     {
 16838                 
 15136                 
 16839                         symbol_c * return_type_symbol = IN_type_symbol;
 15137                         symbol_c * return_type_symbol = IN_type_symbol;
 16840                         s4o.print("__rol(sizeof(");
 15138                         s4o.print("__rol_");
 16841                         IN_type_symbol->accept(*this);
 15139                         IN_type_symbol->accept(*this);
 16842                         s4o.print("), &");
 15140                         s4o.print("(");
 16843                         IN_param_value->accept(*this);
 15141                         IN_param_value->accept(*this);
 16844                         s4o.print(", ");
 15142                         s4o.print(", ");
 16845                         N_param_value->accept(*this);
 15143                         N_param_value->accept(*this);
 16846                         s4o.print(")");
 15144                         s4o.print(")");
 16847                         return NULL;
 15145                         return NULL;
 18129             
 16427             
 18130             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
 16428             if (typeid(*last_type_symbol) == typeid(string_type_name_c))
 18131             {
 16429             {
 18132         
 16430         
 18133                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
 16431                 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
 18134                 s4o.print("__len(&");
 16432                 s4o.print("__len(");
 18135                 IN_param_value->accept(*this);
 16433                 IN_param_value->accept(*this);
 18136                 s4o.print(")");
 16434                 s4o.print(")");
 18137                 return NULL;
 16435                 return NULL;
 18138                 
 16436                 
 18139             }
 16437             }
 18178                     
 16476                     
 18179                     if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 16477                     if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 18180                     {
 16478                     {
 18181                 
 16479                 
 18182                         symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16480                         symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 18183                         s4o.print("__left(&");
 16481                         s4o.print("__left(");
 18184                         IN_param_value->accept(*this);
 16482                         IN_param_value->accept(*this);
 18185                         s4o.print(", ");
 16483                         s4o.print(", ");
 18186                         L_param_value->accept(*this);
 16484                         L_param_value->accept(*this);
 18187                         s4o.print(")");
 16485                         s4o.print(")");
 18188                         return NULL;
 16486                         return NULL;
 18234                     
 16532                     
 18235                     if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 16533                     if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 18236                     {
 16534                     {
 18237                 
 16535                 
 18238                         symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16536                         symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 18239                         s4o.print("__right(&");
 16537                         s4o.print("__right(");
 18240                         IN_param_value->accept(*this);
 16538                         IN_param_value->accept(*this);
 18241                         s4o.print(", ");
 16539                         s4o.print(", ");
 18242                         L_param_value->accept(*this);
 16540                         L_param_value->accept(*this);
 18243                         s4o.print(")");
 16541                         s4o.print(")");
 18244                         return NULL;
 16542                         return NULL;
 18304                             
 16602                             
 18305                             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 16603                             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 18306                             {
 16604                             {
 18307                         
 16605                         
 18308                                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16606                                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 18309                                 s4o.print("__mid(&");
 16607                                 s4o.print("__mid(");
 18310                                 IN_param_value->accept(*this);
 16608                                 IN_param_value->accept(*this);
 18311                                 s4o.print(", ");
 16609                                 s4o.print(", ");
 18312                                 L_param_value->accept(*this);
 16610                                 L_param_value->accept(*this);
 18313                                 s4o.print(", ");
 16611                                 s4o.print(", ");
 18314                                 P_param_value->accept(*this);
 16612                                 P_param_value->accept(*this);
 18367                     
 16665                     
 18368                     if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
 16666                     if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
 18369                     {
 16667                     {
 18370                 
 16668                 
 18371                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
 16669                         symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
 18372                         s4o.print("__time_add(&");
 16670                         s4o.print("__time_add(");
 18373                         IN1_param_value->accept(*this);
 16671                         IN1_param_value->accept(*this);
 18374                         s4o.print(", &");
 16672                         s4o.print(", ");
 18375                         IN2_param_value->accept(*this);
 16673                         IN2_param_value->accept(*this);
 18376                         s4o.print(")");
 16674                         s4o.print(")");
 18377                         return NULL;
 16675                         return NULL;
 18378                         
 16676                         
 18379                     }
 16677                     }
 18497                             
 16795                             
 18498                             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 16796                             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 18499                             {
 16797                             {
 18500                         
 16798                         
 18501                                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16799                                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 18502                                 s4o.print("__insert(&");
 16800                                 s4o.print("__insert(");
 18503                                 IN1_param_value->accept(*this);
 16801                                 IN1_param_value->accept(*this);
 18504                                 s4o.print(", &");
 16802                                 s4o.print(", ");
 18505                                 IN2_param_value->accept(*this);
 16803                                 IN2_param_value->accept(*this);
 18506                                 s4o.print(", ");
 16804                                 s4o.print(", ");
 18507                                 P_param_value->accept(*this);
 16805                                 P_param_value->accept(*this);
 18508                                 s4o.print(")");
 16806                                 s4o.print(")");
 18509                                 return NULL;
 16807                                 return NULL;
 18574                             
 16872                             
 18575                             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 16873                             if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 18576                             {
 16874                             {
 18577                         
 16875                         
 18578                                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16876                                 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 18579                                 s4o.print("__delete(&");
 16877                                 s4o.print("__delete(");
 18580                                 IN_param_value->accept(*this);
 16878                                 IN_param_value->accept(*this);
 18581                                 s4o.print(", ");
 16879                                 s4o.print(", ");
 18582                                 L_param_value->accept(*this);
 16880                                 L_param_value->accept(*this);
 18583                                 s4o.print(", ");
 16881                                 s4o.print(", ");
 18584                                 P_param_value->accept(*this);
 16882                                 P_param_value->accept(*this);
 18665                                     
 16963                                     
 18666                                     if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 16964                                     if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
 18667                                     {
 16965                                     {
 18668                                 
 16966                                 
 18669                                         symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 16967                                         symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
 18670                                         s4o.print("__replace(&");
 16968                                         s4o.print("__replace(");
 18671                                         IN1_param_value->accept(*this);
 16969                                         IN1_param_value->accept(*this);
 18672                                         s4o.print(", &");
 16970                                         s4o.print(", ");
 18673                                         IN2_param_value->accept(*this);
 16971                                         IN2_param_value->accept(*this);
 18674                                         s4o.print(", ");
 16972                                         s4o.print(", ");
 18675                                         L_param_value->accept(*this);
 16973                                         L_param_value->accept(*this);
 18676                                         s4o.print(", ");
 16974                                         s4o.print(", ");
 18677                                         P_param_value->accept(*this);
 16975                                         P_param_value->accept(*this);
 18735                     
 17033                     
 18736                     if (typeid(*last_type_symbol) == typeid(string_type_name_c))
 17034                     if (typeid(*last_type_symbol) == typeid(string_type_name_c))
 18737                     {
 17035                     {
 18738                 
 17036                 
 18739                         symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
 17037                         symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
 18740                         s4o.print("__find(&");
 17038                         s4o.print("__find(");
 18741                         IN1_param_value->accept(*this);
 17039                         IN1_param_value->accept(*this);
 18742                         s4o.print(", &");
 17040                         s4o.print(", ");
 18743                         IN2_param_value->accept(*this);
 17041                         IN2_param_value->accept(*this);
 18744                         s4o.print(")");
 17042                         s4o.print(")");
 18745                         return NULL;
 17043                         return NULL;
 18746                         
 17044                         
 18747                     }
 17045                     }