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(¶m_name); |
10797 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_name); |
12240 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_name); |
12832 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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 */ |