etisserant@33: etisserant@33: /**** etisserant@33: * IEC 61131-3 standard function lib etisserant@33: * generated code, do not edit by hand etisserant@33: */ etisserant@33: switch(current_function_type){ etisserant@33: etisserant@33: /**** etisserant@40: *BOOL_TO_SINT etisserant@40: */ etisserant@40: case function_bool_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_INT etisserant@40: */ etisserant@40: case function_bool_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_DINT etisserant@40: */ etisserant@40: case function_bool_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_LINT etisserant@40: */ etisserant@40: case function_bool_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_USINT etisserant@40: */ etisserant@40: case function_bool_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_UINT etisserant@40: */ etisserant@40: case function_bool_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_UDINT etisserant@40: */ etisserant@40: case function_bool_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_ULINT etisserant@40: */ etisserant@40: case function_bool_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_REAL etisserant@40: */ etisserant@40: case function_bool_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_LREAL etisserant@40: */ etisserant@40: case function_bool_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_TIME etisserant@40: */ etisserant@40: case function_bool_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_DATE etisserant@40: */ etisserant@40: case function_bool_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_TOD etisserant@40: */ etisserant@40: case function_bool_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_DT etisserant@40: */ etisserant@40: case function_bool_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_STRING etisserant@40: */ etisserant@40: case function_bool_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__bool_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_BYTE etisserant@40: */ etisserant@40: case function_bool_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_WORD etisserant@40: */ etisserant@40: case function_bool_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_DWORD etisserant@40: */ etisserant@40: case function_bool_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BOOL_TO_LWORD etisserant@40: */ etisserant@40: case function_bool_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_bool_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_BOOL etisserant@40: */ etisserant@40: case function_sint_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_INT etisserant@40: */ etisserant@40: case function_sint_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_DINT etisserant@40: */ etisserant@40: case function_sint_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_LINT etisserant@40: */ etisserant@40: case function_sint_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_USINT etisserant@40: */ etisserant@40: case function_sint_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_UINT etisserant@40: */ etisserant@40: case function_sint_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_UDINT etisserant@40: */ etisserant@40: case function_sint_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_ULINT etisserant@40: */ etisserant@40: case function_sint_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_REAL etisserant@40: */ etisserant@40: case function_sint_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_LREAL etisserant@40: */ etisserant@40: case function_sint_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_TIME etisserant@40: */ etisserant@40: case function_sint_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_DATE etisserant@40: */ etisserant@40: case function_sint_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_TOD etisserant@40: */ etisserant@40: case function_sint_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_DT etisserant@40: */ etisserant@40: case function_sint_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_STRING etisserant@40: */ etisserant@40: case function_sint_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__sint_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_BYTE etisserant@40: */ etisserant@40: case function_sint_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_WORD etisserant@40: */ etisserant@40: case function_sint_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_DWORD etisserant@40: */ etisserant@40: case function_sint_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *SINT_TO_LWORD etisserant@40: */ etisserant@40: case function_sint_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_sint_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_BOOL etisserant@40: */ etisserant@40: case function_int_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_SINT etisserant@40: */ etisserant@40: case function_int_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_DINT etisserant@40: */ etisserant@40: case function_int_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_LINT etisserant@40: */ etisserant@40: case function_int_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_USINT etisserant@40: */ etisserant@40: case function_int_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_UINT etisserant@40: */ etisserant@40: case function_int_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_UDINT etisserant@40: */ etisserant@40: case function_int_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_ULINT etisserant@40: */ etisserant@40: case function_int_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_REAL etisserant@40: */ etisserant@40: case function_int_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_LREAL etisserant@40: */ etisserant@40: case function_int_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_TIME etisserant@40: */ etisserant@40: case function_int_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_DATE etisserant@40: */ etisserant@40: case function_int_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_TOD etisserant@40: */ etisserant@40: case function_int_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_DT etisserant@40: */ etisserant@40: case function_int_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_STRING etisserant@40: */ etisserant@40: case function_int_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__sint_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_BYTE etisserant@40: */ etisserant@40: case function_int_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_WORD etisserant@40: */ etisserant@40: case function_int_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_DWORD etisserant@40: */ etisserant@40: case function_int_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *INT_TO_LWORD etisserant@40: */ etisserant@40: case function_int_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(int_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_int_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_BOOL etisserant@40: */ etisserant@40: case function_dint_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_SINT etisserant@40: */ etisserant@40: case function_dint_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_INT etisserant@40: */ etisserant@40: case function_dint_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_LINT etisserant@40: */ etisserant@40: case function_dint_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_USINT etisserant@40: */ etisserant@40: case function_dint_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_UINT etisserant@40: */ etisserant@40: case function_dint_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_UDINT etisserant@40: */ etisserant@40: case function_dint_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_ULINT etisserant@40: */ etisserant@40: case function_dint_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_REAL etisserant@40: */ etisserant@40: case function_dint_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_LREAL etisserant@40: */ etisserant@40: case function_dint_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_TIME etisserant@40: */ etisserant@40: case function_dint_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_DATE etisserant@40: */ etisserant@40: case function_dint_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_TOD etisserant@40: */ etisserant@40: case function_dint_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_DT etisserant@40: */ etisserant@40: case function_dint_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_STRING etisserant@40: */ etisserant@40: case function_dint_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__sint_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_BYTE etisserant@40: */ etisserant@40: case function_dint_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_WORD etisserant@40: */ etisserant@40: case function_dint_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_DWORD etisserant@40: */ etisserant@40: case function_dint_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DINT_TO_LWORD etisserant@40: */ etisserant@40: case function_dint_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dint_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_BOOL etisserant@40: */ etisserant@40: case function_lint_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_SINT etisserant@40: */ etisserant@40: case function_lint_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_INT etisserant@40: */ etisserant@40: case function_lint_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_DINT etisserant@40: */ etisserant@40: case function_lint_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_USINT etisserant@40: */ etisserant@40: case function_lint_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_UINT etisserant@40: */ etisserant@40: case function_lint_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_UDINT etisserant@40: */ etisserant@40: case function_lint_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_ULINT etisserant@40: */ etisserant@40: case function_lint_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_REAL etisserant@40: */ etisserant@40: case function_lint_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_LREAL etisserant@40: */ etisserant@40: case function_lint_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_TIME etisserant@40: */ etisserant@40: case function_lint_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_DATE etisserant@40: */ etisserant@40: case function_lint_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_TOD etisserant@40: */ etisserant@40: case function_lint_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_DT etisserant@40: */ etisserant@40: case function_lint_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_STRING etisserant@40: */ etisserant@40: case function_lint_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__sint_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_BYTE etisserant@40: */ etisserant@40: case function_lint_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_WORD etisserant@40: */ etisserant@40: case function_lint_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_DWORD etisserant@40: */ etisserant@40: case function_lint_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LINT_TO_LWORD etisserant@40: */ etisserant@40: case function_lint_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lint_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_BOOL etisserant@40: */ etisserant@40: case function_usint_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_SINT etisserant@40: */ etisserant@40: case function_usint_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_INT etisserant@40: */ etisserant@40: case function_usint_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_DINT etisserant@40: */ etisserant@40: case function_usint_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_LINT etisserant@40: */ etisserant@40: case function_usint_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_UINT etisserant@40: */ etisserant@40: case function_usint_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_UDINT etisserant@40: */ etisserant@40: case function_usint_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_ULINT etisserant@40: */ etisserant@40: case function_usint_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_REAL etisserant@40: */ etisserant@40: case function_usint_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_LREAL etisserant@40: */ etisserant@40: case function_usint_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_TIME etisserant@40: */ etisserant@40: case function_usint_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_DATE etisserant@40: */ etisserant@40: case function_usint_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_TOD etisserant@40: */ etisserant@40: case function_usint_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_DT etisserant@40: */ etisserant@40: case function_usint_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_STRING etisserant@40: */ etisserant@40: case function_usint_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__uint_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_BYTE etisserant@40: */ etisserant@40: case function_usint_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_WORD etisserant@40: */ etisserant@40: case function_usint_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_DWORD etisserant@40: */ etisserant@40: case function_usint_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *USINT_TO_LWORD etisserant@40: */ etisserant@40: case function_usint_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_usint_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_BOOL etisserant@40: */ etisserant@40: case function_uint_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_SINT etisserant@40: */ etisserant@40: case function_uint_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_INT etisserant@40: */ etisserant@40: case function_uint_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_DINT etisserant@40: */ etisserant@40: case function_uint_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_LINT etisserant@40: */ etisserant@40: case function_uint_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_USINT etisserant@40: */ etisserant@40: case function_uint_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_UDINT etisserant@40: */ etisserant@40: case function_uint_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_ULINT etisserant@40: */ etisserant@40: case function_uint_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_REAL etisserant@40: */ etisserant@40: case function_uint_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_LREAL etisserant@40: */ etisserant@40: case function_uint_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_TIME etisserant@40: */ etisserant@40: case function_uint_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_DATE etisserant@40: */ etisserant@40: case function_uint_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_TOD etisserant@40: */ etisserant@40: case function_uint_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_DT etisserant@40: */ etisserant@40: case function_uint_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_STRING etisserant@40: */ etisserant@40: case function_uint_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__uint_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_BYTE etisserant@40: */ etisserant@40: case function_uint_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_WORD etisserant@40: */ etisserant@40: case function_uint_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_DWORD etisserant@40: */ etisserant@40: case function_uint_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UINT_TO_LWORD etisserant@40: */ etisserant@40: case function_uint_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_uint_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_BOOL etisserant@40: */ etisserant@40: case function_udint_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_SINT etisserant@40: */ etisserant@40: case function_udint_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_INT etisserant@40: */ etisserant@40: case function_udint_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_DINT etisserant@40: */ etisserant@40: case function_udint_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_LINT etisserant@40: */ etisserant@40: case function_udint_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_USINT etisserant@40: */ etisserant@40: case function_udint_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_UINT etisserant@40: */ etisserant@40: case function_udint_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_ULINT etisserant@40: */ etisserant@40: case function_udint_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_REAL etisserant@40: */ etisserant@40: case function_udint_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_LREAL etisserant@40: */ etisserant@40: case function_udint_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_TIME etisserant@40: */ etisserant@40: case function_udint_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_DATE etisserant@40: */ etisserant@40: case function_udint_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_TOD etisserant@40: */ etisserant@40: case function_udint_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_DT etisserant@40: */ etisserant@40: case function_udint_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_STRING etisserant@40: */ etisserant@40: case function_udint_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__uint_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_BYTE etisserant@40: */ etisserant@40: case function_udint_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_WORD etisserant@40: */ etisserant@40: case function_udint_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_DWORD etisserant@40: */ etisserant@40: case function_udint_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *UDINT_TO_LWORD etisserant@40: */ etisserant@40: case function_udint_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_udint_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_BOOL etisserant@40: */ etisserant@40: case function_ulint_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_SINT etisserant@40: */ etisserant@40: case function_ulint_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_INT etisserant@40: */ etisserant@40: case function_ulint_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_DINT etisserant@40: */ etisserant@40: case function_ulint_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_LINT etisserant@40: */ etisserant@40: case function_ulint_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_USINT etisserant@40: */ etisserant@40: case function_ulint_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_UINT etisserant@40: */ etisserant@40: case function_ulint_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_UDINT etisserant@40: */ etisserant@40: case function_ulint_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_REAL etisserant@40: */ etisserant@40: case function_ulint_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_LREAL etisserant@40: */ etisserant@40: case function_ulint_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_TIME etisserant@40: */ etisserant@40: case function_ulint_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_DATE etisserant@40: */ etisserant@40: case function_ulint_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_TOD etisserant@40: */ etisserant@40: case function_ulint_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_DT etisserant@40: */ etisserant@40: case function_ulint_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_STRING etisserant@40: */ etisserant@40: case function_ulint_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__uint_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_BYTE etisserant@40: */ etisserant@40: case function_ulint_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_WORD etisserant@40: */ etisserant@40: case function_ulint_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_DWORD etisserant@40: */ etisserant@40: case function_ulint_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *ULINT_TO_LWORD etisserant@40: */ etisserant@40: case function_ulint_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_ulint_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_BOOL etisserant@40: */ etisserant@40: case function_real_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_SINT etisserant@40: */ etisserant@40: case function_real_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_INT etisserant@40: */ etisserant@40: case function_real_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_DINT etisserant@40: */ etisserant@40: case function_real_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_LINT etisserant@40: */ etisserant@40: case function_real_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_USINT etisserant@40: */ etisserant@40: case function_real_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_UINT etisserant@40: */ etisserant@40: case function_real_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_UDINT etisserant@40: */ etisserant@40: case function_real_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_ULINT etisserant@40: */ etisserant@40: case function_real_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** lbessard@35: *REAL_TO_LREAL lbessard@35: */ lbessard@35: case function_real_to_lreal : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: IN_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_real_to_lreal*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@40: *REAL_TO_TIME etisserant@40: */ etisserant@40: case function_real_to_time : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) lbessard@35: { lbessard@35: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__real_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_DATE etisserant@40: */ etisserant@40: case function_real_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__real_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_TOD etisserant@40: */ etisserant@40: case function_real_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__real_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_DT etisserant@40: */ etisserant@40: case function_real_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__real_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_STRING etisserant@40: */ etisserant@40: case function_real_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__real_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_BYTE etisserant@40: */ etisserant@40: case function_real_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_WORD etisserant@40: */ etisserant@40: case function_real_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_DWORD etisserant@40: */ etisserant@40: case function_real_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *REAL_TO_LWORD etisserant@40: */ etisserant@40: case function_real_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(real_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_real_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_BOOL etisserant@40: */ etisserant@40: case function_lreal_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lreal_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_SINT etisserant@40: */ etisserant@40: case function_lreal_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) etisserant@40: { etisserant@40: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: IN_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: etisserant@40: }/*function_lreal_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_INT etisserant@40: */ etisserant@40: case function_lreal_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: IN_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: etisserant@40: }/*function_lreal_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_DINT etisserant@40: */ etisserant@40: case function_lreal_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: IN_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: etisserant@40: }/*function_lreal_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_LINT etisserant@40: */ etisserant@40: case function_lreal_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: IN_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: etisserant@40: }/*function_lreal_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_USINT etisserant@40: */ etisserant@40: case function_lreal_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: IN_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: etisserant@40: }/*function_lreal_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_UINT etisserant@40: */ etisserant@40: case function_lreal_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: IN_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: etisserant@40: }/*function_lreal_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_UDINT etisserant@40: */ etisserant@40: case function_lreal_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: IN_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: etisserant@40: }/*function_lreal_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_ULINT etisserant@40: */ etisserant@40: case function_lreal_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: IN_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: etisserant@40: }/*function_lreal_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_REAL etisserant@40: */ etisserant@40: case function_lreal_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lreal_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_TIME etisserant@40: */ etisserant@40: case function_lreal_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); etisserant@38: s4o.print(")__real_to_time("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: etisserant@40: }/*function_lreal_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_DATE etisserant@40: */ etisserant@40: case function_lreal_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__real_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lreal_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_TOD etisserant@40: */ etisserant@40: case function_lreal_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__real_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lreal_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_DT etisserant@40: */ etisserant@40: case function_lreal_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__real_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lreal_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_STRING etisserant@40: */ etisserant@40: case function_lreal_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__real_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lreal_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_BYTE etisserant@40: */ etisserant@40: case function_lreal_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lreal_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_WORD etisserant@40: */ etisserant@40: case function_lreal_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lreal_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_DWORD etisserant@40: */ etisserant@40: case function_lreal_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lreal_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LREAL_TO_LWORD etisserant@40: */ etisserant@40: case function_lreal_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lreal_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_BOOL etisserant@40: */ etisserant@40: case function_time_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_SINT etisserant@40: */ etisserant@40: case function_time_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_INT etisserant@40: */ etisserant@40: case function_time_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_DINT etisserant@40: */ etisserant@40: case function_time_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_LINT etisserant@40: */ etisserant@40: case function_time_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_USINT etisserant@40: */ etisserant@40: case function_time_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_UINT etisserant@40: */ etisserant@40: case function_time_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_UDINT etisserant@40: */ etisserant@40: case function_time_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_ULINT etisserant@40: */ etisserant@40: case function_time_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_REAL etisserant@40: */ etisserant@40: case function_time_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_real("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_LREAL etisserant@40: */ etisserant@40: case function_time_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_real("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_STRING etisserant@40: */ etisserant@40: case function_time_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_BYTE etisserant@40: */ etisserant@40: case function_time_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_WORD etisserant@40: */ etisserant@40: case function_time_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_DWORD etisserant@40: */ etisserant@40: case function_time_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TIME_TO_LWORD etisserant@40: */ etisserant@40: case function_time_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_time_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_BOOL etisserant@40: */ etisserant@40: case function_date_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_SINT etisserant@40: */ etisserant@40: case function_date_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_INT etisserant@40: */ etisserant@40: case function_date_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_DINT etisserant@40: */ etisserant@40: case function_date_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_LINT etisserant@40: */ etisserant@40: case function_date_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_USINT etisserant@40: */ etisserant@40: case function_date_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_UINT etisserant@40: */ etisserant@40: case function_date_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_UDINT etisserant@40: */ etisserant@40: case function_date_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_ULINT etisserant@40: */ etisserant@40: case function_date_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_REAL etisserant@40: */ etisserant@40: case function_date_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_real("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_LREAL etisserant@40: */ etisserant@40: case function_date_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_real("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_STRING etisserant@40: */ etisserant@40: case function_date_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; lbessard@35: s4o.print("("); lbessard@35: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__date_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_BYTE etisserant@40: */ etisserant@40: case function_date_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_WORD etisserant@40: */ etisserant@40: case function_date_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_DWORD etisserant@40: */ etisserant@40: case function_date_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DATE_TO_LWORD etisserant@40: */ etisserant@40: case function_date_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_date_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_BOOL etisserant@40: */ etisserant@40: case function_tod_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_SINT etisserant@40: */ etisserant@40: case function_tod_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_INT etisserant@40: */ etisserant@40: case function_tod_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_DINT etisserant@40: */ etisserant@40: case function_tod_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_LINT etisserant@40: */ etisserant@40: case function_tod_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_USINT etisserant@40: */ etisserant@40: case function_tod_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_UINT etisserant@40: */ etisserant@40: case function_tod_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_UDINT etisserant@40: */ etisserant@40: case function_tod_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_ULINT etisserant@40: */ etisserant@40: case function_tod_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_REAL etisserant@40: */ etisserant@40: case function_tod_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_real("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_LREAL etisserant@40: */ etisserant@40: case function_tod_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_real("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_STRING etisserant@40: */ etisserant@40: case function_tod_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__tod_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_BYTE etisserant@40: */ etisserant@40: case function_tod_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_WORD etisserant@40: */ etisserant@40: case function_tod_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_DWORD etisserant@40: */ etisserant@40: case function_tod_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *TOD_TO_LWORD etisserant@40: */ etisserant@40: case function_tod_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_tod_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_BOOL etisserant@40: */ etisserant@40: case function_dt_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_SINT etisserant@40: */ etisserant@40: case function_dt_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_INT etisserant@40: */ etisserant@40: case function_dt_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_DINT etisserant@40: */ etisserant@40: case function_dt_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_LINT etisserant@40: */ etisserant@40: case function_dt_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_USINT etisserant@40: */ etisserant@40: case function_dt_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_UINT etisserant@40: */ etisserant@40: case function_dt_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_UDINT etisserant@40: */ etisserant@40: case function_dt_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_ULINT etisserant@40: */ etisserant@40: case function_dt_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_REAL etisserant@40: */ etisserant@40: case function_dt_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_real("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_LREAL etisserant@40: */ etisserant@40: case function_dt_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_real("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_STRING etisserant@40: */ etisserant@40: case function_dt_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__dt_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_BYTE etisserant@40: */ etisserant@40: case function_dt_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_WORD etisserant@40: */ etisserant@40: case function_dt_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_DWORD etisserant@40: */ etisserant@40: case function_dt_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DT_TO_LWORD etisserant@40: */ etisserant@40: case function_dt_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__time_to_int("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dt_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_BOOL etisserant@40: */ etisserant@40: case function_string_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_bool("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_SINT etisserant@40: */ etisserant@40: case function_string_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_sint("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_INT etisserant@40: */ etisserant@40: case function_string_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_sint("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_DINT etisserant@40: */ etisserant@40: case function_string_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_sint("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_LINT etisserant@40: */ etisserant@40: case function_string_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_sint("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_USINT etisserant@40: */ etisserant@40: case function_string_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_uint("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_UINT etisserant@40: */ etisserant@40: case function_string_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_uint("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_UDINT etisserant@40: */ etisserant@40: case function_string_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_uint("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_ULINT etisserant@40: */ etisserant@40: case function_string_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_uint("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_REAL etisserant@40: */ etisserant@40: case function_string_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_real("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_LREAL etisserant@40: */ etisserant@40: case function_string_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_real("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_TIME etisserant@40: */ etisserant@40: case function_string_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_DATE etisserant@40: */ etisserant@40: case function_string_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_TOD etisserant@40: */ etisserant@40: case function_string_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_DT etisserant@40: */ etisserant@40: case function_string_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_BYTE etisserant@40: */ etisserant@40: case function_string_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_bit("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_WORD etisserant@40: */ etisserant@40: case function_string_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_bit("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_DWORD etisserant@40: */ etisserant@40: case function_string_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_bit("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *STRING_TO_LWORD etisserant@40: */ etisserant@40: case function_string_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__string_to_bit("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_string_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_BOOL etisserant@40: */ etisserant@40: case function_byte_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_SINT etisserant@40: */ etisserant@40: case function_byte_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_INT etisserant@40: */ etisserant@40: case function_byte_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_DINT etisserant@40: */ etisserant@40: case function_byte_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_LINT etisserant@40: */ etisserant@40: case function_byte_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_USINT etisserant@40: */ etisserant@40: case function_byte_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_UINT etisserant@40: */ etisserant@40: case function_byte_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_UDINT etisserant@40: */ etisserant@40: case function_byte_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_ULINT etisserant@40: */ etisserant@40: case function_byte_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_REAL etisserant@40: */ etisserant@40: case function_byte_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: IN_param_value->accept(*this); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@40: }/*function_byte_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_LREAL etisserant@40: */ etisserant@40: case function_byte_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_TIME etisserant@40: */ etisserant@40: case function_byte_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_DATE etisserant@40: */ etisserant@40: case function_byte_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_TOD etisserant@40: */ etisserant@40: case function_byte_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_DT etisserant@40: */ etisserant@40: case function_byte_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_STRING etisserant@40: */ etisserant@40: case function_byte_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__bit_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_WORD etisserant@40: */ etisserant@40: case function_byte_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_DWORD etisserant@40: */ etisserant@40: case function_byte_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *BYTE_TO_LWORD etisserant@40: */ etisserant@40: case function_byte_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_byte_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_BOOL etisserant@40: */ etisserant@40: case function_word_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_word_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_SINT etisserant@40: */ etisserant@40: case function_word_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: IN_param_value->accept(*this); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@40: }/*function_word_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_INT etisserant@40: */ etisserant@40: case function_word_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: IN_param_value->accept(*this); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@40: }/*function_word_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_DINT etisserant@40: */ etisserant@40: case function_word_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: IN_param_value->accept(*this); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@40: }/*function_word_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_LINT etisserant@40: */ etisserant@40: case function_word_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: IN_param_value->accept(*this); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@40: }/*function_word_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_USINT etisserant@40: */ etisserant@40: case function_word_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: IN_param_value->accept(*this); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@40: }/*function_word_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_UINT etisserant@40: */ etisserant@40: case function_word_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: IN_param_value->accept(*this); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@40: }/*function_word_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_UDINT etisserant@40: */ etisserant@40: case function_word_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: IN_param_value->accept(*this); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@40: }/*function_word_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_ULINT etisserant@40: */ etisserant@40: case function_word_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: IN_param_value->accept(*this); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@40: }/*function_word_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_REAL etisserant@40: */ etisserant@40: case function_word_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_word_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_LREAL etisserant@40: */ etisserant@40: case function_word_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_word_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_TIME etisserant@40: */ etisserant@40: case function_word_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_word_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_DATE etisserant@40: */ etisserant@40: case function_word_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_word_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_TOD etisserant@40: */ etisserant@40: case function_word_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_word_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_DT etisserant@40: */ etisserant@40: case function_word_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_word_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_STRING etisserant@40: */ etisserant@40: case function_word_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__bit_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_word_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_BYTE etisserant@40: */ etisserant@40: case function_word_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_word_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_DWORD etisserant@40: */ etisserant@40: case function_word_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_word_to_dword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *WORD_TO_LWORD etisserant@40: */ etisserant@40: case function_word_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_word_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_BOOL etisserant@40: */ etisserant@40: case function_dword_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: IN_param_value->accept(*this); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@40: }/*function_dword_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_SINT etisserant@40: */ etisserant@40: case function_dword_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_INT etisserant@40: */ etisserant@40: case function_dword_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_DINT etisserant@40: */ etisserant@40: case function_dword_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_LINT etisserant@40: */ etisserant@40: case function_dword_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_USINT etisserant@40: */ etisserant@40: case function_dword_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_UINT etisserant@40: */ etisserant@40: case function_dword_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_UDINT etisserant@40: */ etisserant@40: case function_dword_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_ULINT etisserant@40: */ etisserant@40: case function_dword_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_REAL etisserant@40: */ etisserant@40: case function_dword_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_LREAL etisserant@40: */ etisserant@40: case function_dword_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_TIME etisserant@40: */ etisserant@40: case function_dword_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_DATE etisserant@40: */ etisserant@40: case function_dword_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_TOD etisserant@40: */ etisserant@40: case function_dword_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_DT etisserant@40: */ etisserant@40: case function_dword_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_STRING etisserant@40: */ etisserant@40: case function_dword_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__bit_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_BYTE etisserant@40: */ etisserant@40: case function_dword_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: IN_param_value->accept(*this); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@40: }/*function_dword_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_WORD etisserant@40: */ etisserant@40: case function_dword_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: IN_param_value->accept(*this); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@40: }/*function_dword_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *DWORD_TO_LWORD etisserant@40: */ etisserant@40: case function_dword_to_lword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_dword_to_lword*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_BOOL etisserant@40: */ etisserant@40: case function_lword_to_bool : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_bool*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_SINT etisserant@40: */ etisserant@40: case function_lword_to_sint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_sint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_INT etisserant@40: */ etisserant@40: case function_lword_to_int : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_int*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_DINT etisserant@40: */ etisserant@40: case function_lword_to_dint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_dint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_LINT etisserant@40: */ etisserant@40: case function_lword_to_lint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_lint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_USINT etisserant@40: */ etisserant@40: case function_lword_to_usint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_usint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_UINT etisserant@40: */ etisserant@40: case function_lword_to_uint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_uint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_UDINT etisserant@40: */ etisserant@40: case function_lword_to_udint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_udint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_ULINT etisserant@40: */ etisserant@40: case function_lword_to_ulint : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_ulint*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_REAL etisserant@40: */ etisserant@40: case function_lword_to_real : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_real*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_LREAL etisserant@40: */ etisserant@40: case function_lword_to_lreal : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_lreal*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_TIME etisserant@40: */ etisserant@40: case function_lword_to_time : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_time*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_DATE etisserant@40: */ etisserant@40: case function_lword_to_date : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_date*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_TOD etisserant@40: */ etisserant@40: case function_lword_to_tod : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_tod*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_DT etisserant@40: */ etisserant@40: case function_lword_to_dt : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__int_to_time("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_dt*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_STRING etisserant@40: */ etisserant@40: case function_lword_to_string : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")__bit_to_string("); etisserant@40: IN_param_value->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_string*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_BYTE etisserant@40: */ etisserant@40: case function_lword_to_byte : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_byte*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_WORD etisserant@40: */ etisserant@40: case function_lword_to_word : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@40: { etisserant@40: etisserant@40: symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; etisserant@40: s4o.print("("); etisserant@40: return_type_symbol->accept(*this); etisserant@40: s4o.print(")"); etisserant@40: IN_param_value->accept(*this); etisserant@40: return NULL; etisserant@40: etisserant@40: } etisserant@40: etisserant@40: ERROR; etisserant@40: } etisserant@40: etisserant@40: }/*function_lword_to_word*/ etisserant@40: break; etisserant@40: etisserant@40: /**** etisserant@40: *LWORD_TO_DWORD etisserant@40: */ etisserant@40: case function_lword_to_dword : etisserant@40: { etisserant@40: symbol_c *last_type_symbol = NULL; etisserant@40: etisserant@40: { etisserant@40: identifier_c param_name("IN"); etisserant@40: /* Get the value from a foo( = ) style call */ etisserant@40: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@40: etisserant@40: /* Get the value from a foo() style call */ etisserant@40: if (IN_param_value == NULL) etisserant@40: IN_param_value = function_call_param_iterator.next(); etisserant@40: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@40: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@40: etisserant@40: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) etisserant@38: { etisserant@38: etisserant@38: symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: IN_param_value->accept(*this); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@38: }/*function_lword_to_dword*/ etisserant@38: break; etisserant@38: etisserant@38: /**** etisserant@33: *TRUNC etisserant@33: */ lbessard@35: case function_trunc : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_real_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; lbessard@35: s4o.print("(int)"); lbessard@35: IN_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_trunc*/ lbessard@35: break; etisserant@33: etisserant@33: /**** lbessard@35: *BCD_TO_USINT lbessard@35: */ lbessard@35: case function_bcd_to_usint : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: etisserant@38: if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")__bcd_to_uint("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_bcd_to_usint*/ lbessard@35: break; lbessard@35: lbessard@35: /**** lbessard@35: *BCD_TO_UINT lbessard@35: */ lbessard@35: case function_bcd_to_uint : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: etisserant@38: if (typeid(*last_type_symbol) == typeid(word_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")__bcd_to_uint("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_bcd_to_uint*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *BCD_TO_UDINT etisserant@33: */ lbessard@35: case function_bcd_to_udint : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: etisserant@38: if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")__bcd_to_uint("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_bcd_to_udint*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *BCD_TO_ULINT etisserant@33: */ lbessard@35: case function_bcd_to_ulint : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: etisserant@38: if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")__bcd_to_uint("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_bcd_to_ulint*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@38: *USINT_TO_BCD etisserant@38: */ etisserant@38: case function_usint_to_bcd : etisserant@38: { etisserant@38: symbol_c *last_type_symbol = NULL; etisserant@38: etisserant@38: { etisserant@38: identifier_c param_name("IN"); etisserant@38: /* Get the value from a foo( = ) style call */ etisserant@38: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@38: etisserant@38: /* Get the value from a foo() style call */ etisserant@38: if (IN_param_value == NULL) etisserant@38: IN_param_value = function_call_param_iterator.next(); etisserant@38: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@38: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@38: etisserant@38: if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")__uint_to_bcd("); etisserant@38: IN_param_value->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@38: }/*function_usint_to_bcd*/ etisserant@38: break; etisserant@38: etisserant@38: /**** etisserant@38: *UINT_TO_BCD etisserant@38: */ etisserant@38: case function_uint_to_bcd : etisserant@38: { etisserant@38: symbol_c *last_type_symbol = NULL; etisserant@38: etisserant@38: { etisserant@38: identifier_c param_name("IN"); etisserant@38: /* Get the value from a foo( = ) style call */ etisserant@38: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@38: etisserant@38: /* Get the value from a foo() style call */ etisserant@38: if (IN_param_value == NULL) etisserant@38: IN_param_value = function_call_param_iterator.next(); etisserant@38: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@38: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@38: etisserant@38: if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")__uint_to_bcd("); etisserant@38: IN_param_value->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@38: }/*function_uint_to_bcd*/ etisserant@38: break; etisserant@38: etisserant@38: /**** etisserant@38: *UDINT_TO_BCD etisserant@38: */ etisserant@38: case function_udint_to_bcd : etisserant@38: { etisserant@38: symbol_c *last_type_symbol = NULL; etisserant@38: etisserant@38: { etisserant@38: identifier_c param_name("IN"); etisserant@38: /* Get the value from a foo( = ) style call */ etisserant@38: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@38: etisserant@38: /* Get the value from a foo() style call */ etisserant@38: if (IN_param_value == NULL) etisserant@38: IN_param_value = function_call_param_iterator.next(); etisserant@38: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@38: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@38: etisserant@38: if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")__uint_to_bcd("); etisserant@38: IN_param_value->accept(*this); etisserant@38: s4o.print(")"); etisserant@38: return NULL; etisserant@38: etisserant@38: } etisserant@38: etisserant@38: ERROR; etisserant@38: } etisserant@38: etisserant@38: }/*function_udint_to_bcd*/ etisserant@38: break; etisserant@38: etisserant@38: /**** etisserant@38: *ULINT_TO_BCD etisserant@38: */ etisserant@38: case function_ulint_to_bcd : etisserant@38: { etisserant@38: symbol_c *last_type_symbol = NULL; etisserant@38: etisserant@38: { etisserant@38: identifier_c param_name("IN"); etisserant@38: /* Get the value from a foo( = ) style call */ etisserant@38: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); etisserant@38: etisserant@38: /* Get the value from a foo() style call */ etisserant@38: if (IN_param_value == NULL) etisserant@38: IN_param_value = function_call_param_iterator.next(); etisserant@38: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); etisserant@38: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; etisserant@38: etisserant@38: if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; etisserant@38: s4o.print("("); etisserant@38: return_type_symbol->accept(*this); etisserant@38: s4o.print(")__uint_to_bcd("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_ulint_to_bcd*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *DATE_AND_TIME_TO_TIME_OF_DAY etisserant@33: */ lbessard@35: case function_date_and_time_to_time_of_day : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@38: s4o.print("__date_and_time_to_time_of_day("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_date_and_time_to_time_of_day*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *DATE_AND_TIME_TO_DATE etisserant@33: */ lbessard@35: case function_date_and_time_to_date : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; etisserant@38: s4o.print("__date_and_time_to_date("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_date_and_time_to_date*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *ABS etisserant@33: */ lbessard@35: case function_abs : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: s4o.print("__abs_"); lbessard@35: IN_type_symbol->accept(*this); lbessard@35: s4o.print("("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_abs*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *SQRT etisserant@33: */ lbessard@35: case function_sqrt : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_real_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: s4o.print("sqrt("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_sqrt*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *LN etisserant@33: */ lbessard@35: case function_ln : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_real_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: s4o.print("ln("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_ln*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *LOG etisserant@33: */ lbessard@35: case function_log : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_real_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: s4o.print("log("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_log*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *EXP etisserant@33: */ lbessard@35: case function_exp : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_real_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: s4o.print("exp("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_exp*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *SIN etisserant@33: */ lbessard@35: case function_sin : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_real_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: s4o.print("sin("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_sin*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *COS etisserant@33: */ lbessard@35: case function_cos : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_real_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: s4o.print("cos("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_cos*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *TAN etisserant@33: */ lbessard@35: case function_tan : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_real_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: s4o.print("tan("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_tan*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *ASIN etisserant@33: */ lbessard@35: case function_asin : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_real_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: s4o.print("asin("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_asin*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *ACOS etisserant@33: */ lbessard@35: case function_acos : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_real_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: s4o.print("acos("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_acos*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *ATAN etisserant@33: */ lbessard@35: case function_atan : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_real_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: s4o.print("atan("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_atan*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *ADD etisserant@33: */ lbessard@35: case function_add : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN1_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN2_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = last_type_symbol; lbessard@35: s4o.print("("); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print("+"); lbessard@35: IN2_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 3; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ lbessard@35: s4o.print("+"); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@38: s4o.print("__time_add("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@38: s4o.print("__time_add("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@38: s4o.print("__time_add("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_add*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *MUL etisserant@33: */ lbessard@35: case function_mul : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN1_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN2_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = last_type_symbol; lbessard@35: s4o.print("("); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print("*"); lbessard@35: IN2_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 3; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ lbessard@35: s4o.print("*"); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN2_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@38: s4o.print("__time_mul("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_mul*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *SUB etisserant@33: */ lbessard@35: case function_sub : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN1_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN2_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = last_type_symbol; lbessard@35: s4o.print("("); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print("-"); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@38: s4o.print("__time_sub("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@38: s4o.print("__time_sub("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@38: s4o.print("__time_sub("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@38: s4o.print("__time_sub("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; etisserant@38: s4o.print("__time_sub("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@38: s4o.print("__time_sub("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_sub*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *DIV etisserant@33: */ lbessard@35: case function_div : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN1_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN2_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = last_type_symbol; lbessard@35: s4o.print("("); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print("/"); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(time_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN2_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; etisserant@38: s4o.print("__time_div("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_div*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *MOD etisserant@33: */ lbessard@35: case function_mod : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN1_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN2_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = last_type_symbol; lbessard@35: s4o.print("("); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print("%"); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_mod*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *EXPT etisserant@33: */ lbessard@35: case function_expt : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN1_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN2_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = last_type_symbol; etisserant@38: s4o.print("pow("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_expt*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *MOVE etisserant@33: */ lbessard@35: case function_move : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_num_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = last_type_symbol; lbessard@35: IN_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_move*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *SHL etisserant@33: */ lbessard@35: case function_shl : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_binary_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("N"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *N_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (N_param_value == NULL) lbessard@35: N_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; lbessard@35: etisserant@40: if(search_expression_type->is_integer_type(N_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print("<<"); lbessard@35: N_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_shl*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *SHR etisserant@33: */ lbessard@35: case function_shr : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_binary_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("N"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *N_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (N_param_value == NULL) lbessard@35: N_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; lbessard@35: etisserant@40: if(search_expression_type->is_integer_type(N_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(">>"); lbessard@35: N_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_shr*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *ROR etisserant@33: */ lbessard@35: case function_ror : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: etisserant@38: if(search_expression_type->is_nbinary_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("N"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *N_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (N_param_value == NULL) lbessard@35: N_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; lbessard@35: etisserant@40: if(search_expression_type->is_integer_type(N_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; etisserant@38: s4o.print("__ror_"); lbessard@35: IN_type_symbol->accept(*this); etisserant@38: s4o.print("("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(", "); lbessard@35: N_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_ror*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *ROL etisserant@33: */ lbessard@35: case function_rol : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: etisserant@38: if(search_expression_type->is_nbinary_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("N"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *N_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (N_param_value == NULL) lbessard@35: N_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; lbessard@35: etisserant@40: if(search_expression_type->is_integer_type(N_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; etisserant@38: s4o.print("__rol_"); lbessard@35: IN_type_symbol->accept(*this); etisserant@38: s4o.print("("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(", "); lbessard@35: N_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_rol*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *AND etisserant@33: */ lbessard@35: case function_and : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_binary_type(IN1_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_binary_type(IN2_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = last_type_symbol; lbessard@35: s4o.print("("); lbessard@35: if (search_expression_type->is_bool_type(last_type_symbol)) lbessard@35: s4o.print("("); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print("&"); lbessard@35: IN2_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 3; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ lbessard@35: s4o.print("&"); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: if (search_expression_type->is_bool_type(last_type_symbol)) { lbessard@35: s4o.print("&1"); lbessard@35: s4o.print(")"); lbessard@35: } lbessard@35: s4o.print(""); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_and*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *OR etisserant@33: */ lbessard@35: case function_or : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_binary_type(IN1_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_binary_type(IN2_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = last_type_symbol; lbessard@35: s4o.print("("); lbessard@35: if (search_expression_type->is_bool_type(last_type_symbol)) lbessard@35: s4o.print("("); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print("|"); lbessard@35: IN2_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 3; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ lbessard@35: s4o.print("|"); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: if (search_expression_type->is_bool_type(last_type_symbol)) { lbessard@35: s4o.print("&1"); lbessard@35: s4o.print(")"); lbessard@35: } lbessard@35: s4o.print(""); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_or*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *XOR etisserant@33: */ lbessard@35: case function_xor : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_binary_type(IN1_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_binary_type(IN2_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = last_type_symbol; lbessard@35: s4o.print("("); lbessard@35: if (search_expression_type->is_bool_type(last_type_symbol)) lbessard@35: s4o.print("("); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print("^"); lbessard@35: IN2_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 3; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ lbessard@35: s4o.print("^"); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: if (search_expression_type->is_bool_type(last_type_symbol)) { lbessard@35: s4o.print("&1"); lbessard@35: s4o.print(")"); lbessard@35: } lbessard@35: s4o.print(""); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_xor*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *NOT etisserant@33: */ lbessard@35: case function_not : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_binary_type(IN_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: s4o.print("~"); lbessard@35: IN_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_not*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *SEL etisserant@33: */ lbessard@35: case function_sel : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("G"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *G_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (G_param_value == NULL) lbessard@35: G_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *G_type_symbol = search_expression_type->get_type(G_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(G_type_symbol, last_type_symbol) ? search_expression_type->common_type(G_type_symbol, last_type_symbol) : G_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN0"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN0_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN0_param_value == NULL) lbessard@35: IN0_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN0_type_symbol = search_expression_type->get_type(IN0_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = last_type_symbol; lbessard@35: G_param_value->accept(*this); lbessard@35: s4o.print(" ? "); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print(" : "); lbessard@35: IN0_param_value->accept(*this); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_sel*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *MAX etisserant@33: */ lbessard@35: case function_max : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = last_type_symbol; lbessard@35: s4o.print("__max_"); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print("("); lbessard@35: s4o.print_integer(nb_param); lbessard@35: s4o.print(","); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print(","); lbessard@35: IN2_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 3; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ lbessard@35: s4o.print(","); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_max*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *MIN etisserant@33: */ lbessard@35: case function_min : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = last_type_symbol; lbessard@35: s4o.print("__min_"); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print("("); lbessard@35: s4o.print_integer(nb_param); lbessard@35: s4o.print(","); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print(","); lbessard@35: IN2_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 3; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ lbessard@35: s4o.print(","); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_min*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *LIMIT etisserant@33: */ lbessard@35: case function_limit : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("MN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *MN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (MN_param_value == NULL) lbessard@35: MN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *MN_type_symbol = search_expression_type->get_type(MN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(MN_type_symbol, last_type_symbol) ? search_expression_type->common_type(MN_type_symbol, last_type_symbol) : MN_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("MX"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *MX_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (MX_param_value == NULL) lbessard@35: MX_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *MX_type_symbol = search_expression_type->get_type(MX_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(MX_type_symbol, last_type_symbol) ? search_expression_type->common_type(MX_type_symbol, last_type_symbol) : MX_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = IN_type_symbol; lbessard@35: s4o.print("__limit_"); lbessard@35: IN_type_symbol->accept(*this); lbessard@35: s4o.print("("); lbessard@35: MN_param_value->accept(*this); lbessard@35: s4o.print(", "); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(", "); lbessard@35: MX_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_limit*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *MUX etisserant@33: */ lbessard@35: case function_mux : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("K"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *K_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (K_param_value == NULL) lbessard@35: K_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *K_type_symbol = search_expression_type->get_type(K_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(K_type_symbol, last_type_symbol) ? search_expression_type->common_type(K_type_symbol, last_type_symbol) : K_type_symbol ; lbessard@35: lbessard@35: if(search_expression_type->is_integer_type(K_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN0"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN0_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN0_param_value == NULL) lbessard@35: IN0_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN0_type_symbol = search_expression_type->get_type(IN0_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = last_type_symbol; lbessard@35: s4o.print("__mux_"); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print("("); lbessard@35: s4o.print_integer(nb_param); lbessard@35: s4o.print(","); lbessard@35: K_param_value->accept(*this); lbessard@35: s4o.print(","); lbessard@35: IN0_param_value->accept(*this); lbessard@35: s4o.print(","); lbessard@35: IN1_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 2; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ lbessard@35: s4o.print(","); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_mux*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *GT etisserant@33: */ lbessard@35: case function_gt : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; lbessard@35: s4o.print("__gt_"); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print("("); lbessard@35: s4o.print_integer(nb_param); lbessard@35: s4o.print(","); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print(","); lbessard@35: IN2_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 3; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ lbessard@35: s4o.print(","); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_gt*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *GE etisserant@33: */ lbessard@35: case function_ge : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; lbessard@35: s4o.print("__ge_"); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print("("); lbessard@35: s4o.print_integer(nb_param); lbessard@35: s4o.print(","); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print(","); lbessard@35: IN2_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 3; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ lbessard@35: s4o.print(","); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_ge*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *EQ etisserant@33: */ lbessard@35: case function_eq : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; lbessard@35: s4o.print("__eq_"); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print("("); lbessard@35: s4o.print_integer(nb_param); lbessard@35: s4o.print(","); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print(","); lbessard@35: IN2_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 3; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ lbessard@35: s4o.print(","); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_eq*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *LT etisserant@33: */ lbessard@35: case function_lt : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; lbessard@35: s4o.print("__lt_"); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print("("); lbessard@35: s4o.print_integer(nb_param); lbessard@35: s4o.print(","); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print(","); lbessard@35: IN2_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 3; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ lbessard@35: s4o.print(","); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_lt*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *LE etisserant@33: */ lbessard@35: case function_le : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; lbessard@35: s4o.print("__le_"); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print("("); lbessard@35: s4o.print_integer(nb_param); lbessard@35: s4o.print(","); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print(","); lbessard@35: IN2_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 3; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ lbessard@35: s4o.print(","); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_le*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *NE etisserant@33: */ lbessard@35: case function_ne : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; lbessard@35: s4o.print("__ne_"); lbessard@35: return_type_symbol->accept(*this); lbessard@35: s4o.print("("); lbessard@35: s4o.print_integer(nb_param); lbessard@35: s4o.print(","); lbessard@35: IN1_param_value->accept(*this); lbessard@35: s4o.print(","); lbessard@35: IN2_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 3; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ lbessard@35: s4o.print(","); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_ne*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *LEN etisserant@33: */ lbessard@35: case function_len : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@38: s4o.print("__len("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_len*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *LEFT etisserant@33: */ lbessard@35: case function_left : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("L"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (L_param_value == NULL) lbessard@35: L_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; lbessard@35: etisserant@40: if(search_expression_type->is_integer_type(L_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@38: s4o.print("__left("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(", "); lbessard@35: L_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_left*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *RIGHT etisserant@33: */ lbessard@35: case function_right : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("L"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (L_param_value == NULL) lbessard@35: L_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; lbessard@35: etisserant@40: if(search_expression_type->is_integer_type(L_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@38: s4o.print("__right("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(", "); lbessard@35: L_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_right*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *MID etisserant@33: */ lbessard@35: case function_mid : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("L"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (L_param_value == NULL) lbessard@35: L_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; lbessard@35: etisserant@40: if(search_expression_type->is_integer_type(L_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("P"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *P_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (P_param_value == NULL) lbessard@35: P_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; lbessard@35: etisserant@40: if(search_expression_type->is_integer_type(P_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@38: s4o.print("__mid("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(", "); lbessard@35: L_param_value->accept(*this); lbessard@35: s4o.print(", "); lbessard@35: P_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_mid*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *CONCAT etisserant@33: */ lbessard@35: case function_concat : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(date_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; etisserant@38: s4o.print("__time_add("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; lbessard@35: s4o.print("__concat("); lbessard@35: s4o.print_integer(nb_param); lbessard@35: s4o.print(","); lbessard@35: IN1_param_value->accept(*this); etisserant@41: s4o.print(","); lbessard@35: IN2_param_value->accept(*this); lbessard@35: lbessard@35: int base_num = 3; lbessard@35: symbol_c *param_value = NULL; lbessard@35: do{ lbessard@35: char my_name[10]; lbessard@35: sprintf(my_name, "IN%d", base_num++); lbessard@35: identifier_c param_name(my_name); lbessard@35: lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (param_value == NULL) lbessard@35: param_value = function_call_param_iterator.next(); lbessard@35: if (param_value != NULL){ lbessard@35: symbol_c *current_type_symbol = search_expression_type->get_type(param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; lbessard@35: lbessard@35: /*Function specific CODE */ etisserant@41: s4o.print(","); lbessard@35: param_value->accept(*this); lbessard@35: lbessard@35: } lbessard@35: lbessard@35: }while(param_value != NULL); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_concat*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *INSERT etisserant@33: */ lbessard@35: case function_insert : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("P"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *P_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (P_param_value == NULL) lbessard@35: P_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; lbessard@35: etisserant@40: if(search_expression_type->is_integer_type(P_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@38: s4o.print("__insert("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(", "); lbessard@35: P_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_insert*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *DELETE etisserant@33: */ lbessard@35: case function_delete : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN_param_value == NULL) lbessard@35: IN_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("L"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (L_param_value == NULL) lbessard@35: L_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; lbessard@35: etisserant@40: if(search_expression_type->is_integer_type(L_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("P"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *P_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (P_param_value == NULL) lbessard@35: P_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; lbessard@35: etisserant@40: if(search_expression_type->is_integer_type(P_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@38: s4o.print("__delete("); lbessard@35: IN_param_value->accept(*this); lbessard@35: s4o.print(", "); lbessard@35: L_param_value->accept(*this); lbessard@35: s4o.print(", "); lbessard@35: P_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_delete*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *REPLACE etisserant@33: */ lbessard@35: case function_replace : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("L"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (L_param_value == NULL) lbessard@35: L_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; lbessard@35: etisserant@40: if(search_expression_type->is_integer_type(L_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("P"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *P_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (P_param_value == NULL) lbessard@35: P_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; lbessard@35: etisserant@40: if(search_expression_type->is_integer_type(P_type_symbol)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; etisserant@38: s4o.print("__replace("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(", "); lbessard@35: L_param_value->accept(*this); lbessard@35: s4o.print(", "); lbessard@35: P_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_replace*/ lbessard@35: break; etisserant@33: etisserant@33: /**** etisserant@33: *FIND etisserant@33: */ lbessard@35: case function_find : lbessard@35: { lbessard@35: symbol_c *last_type_symbol = NULL; lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN1"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN1_param_value == NULL) lbessard@35: IN1_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: { lbessard@35: identifier_c param_name("IN2"); lbessard@35: /* Get the value from a foo( = ) style call */ lbessard@35: symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); lbessard@35: lbessard@35: /* Get the value from a foo() style call */ lbessard@35: if (IN2_param_value == NULL) lbessard@35: IN2_param_value = function_call_param_iterator.next(); lbessard@35: symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); lbessard@35: last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; lbessard@35: lbessard@35: if (typeid(*last_type_symbol) == typeid(string_type_name_c)) lbessard@35: { lbessard@35: lbessard@35: symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; etisserant@38: s4o.print("__find("); lbessard@35: IN1_param_value->accept(*this); etisserant@38: s4o.print(", "); lbessard@35: IN2_param_value->accept(*this); lbessard@35: s4o.print(")"); lbessard@35: return NULL; lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: } lbessard@35: lbessard@35: ERROR; lbessard@35: } lbessard@35: lbessard@35: }/*function_find*/ lbessard@35: break; lbessard@35: lbessard@35: case function_none : lbessard@35: ERROR; etisserant@33: } etisserant@33: return NULL;