7583 |
7583 |
7584 }/*function_lreal_to_lword*/ |
7584 }/*function_lreal_to_lword*/ |
7585 break; |
7585 break; |
7586 |
7586 |
7587 /**** |
7587 /**** |
7588 *TIME_TO_BOOL |
7588 *TIME_TO_SINT |
7589 */ |
7589 */ |
7590 case function_time_to_bool : |
7590 case function_time_to_sint : |
7591 { |
7591 { |
7592 symbol_c *last_type_symbol = NULL; |
7592 symbol_c *last_type_symbol = NULL; |
7593 |
7593 |
7594 { |
7594 { |
7595 identifier_c param_name("IN"); |
7595 identifier_c param_name("IN"); |
7596 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
7596 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
7597 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
7597 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
7598 |
7598 |
7599 /* Get the value from a foo(<param_value>) style call */ |
7599 /* Get the value from a foo(<param_value>) style call */ |
7600 if (IN_param_value == NULL) |
7600 if (IN_param_value == NULL) |
7601 IN_param_value = function_call_param_iterator.next(); |
7601 IN_param_value = function_call_param_iterator.next(); |
7602 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
7602 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
7603 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
7603 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
7604 |
7604 |
7605 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
7605 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7606 { |
|
7607 |
|
7608 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
7609 s4o.print("("); |
|
7610 return_type_symbol->accept(*this); |
|
7611 s4o.print(")__time_to_int("); |
|
7612 IN_param_value->accept(*this); |
|
7613 s4o.print(")"); |
|
7614 return NULL; |
|
7615 |
|
7616 } |
|
7617 |
|
7618 ERROR; |
|
7619 } |
|
7620 |
|
7621 }/*function_time_to_sint*/ |
|
7622 break; |
|
7623 |
|
7624 /**** |
|
7625 *TIME_TO_INT |
|
7626 */ |
|
7627 case function_time_to_int : |
|
7628 { |
|
7629 symbol_c *last_type_symbol = NULL; |
|
7630 |
|
7631 { |
|
7632 identifier_c param_name("IN"); |
|
7633 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7634 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7635 |
|
7636 /* Get the value from a foo(<param_value>) style call */ |
|
7637 if (IN_param_value == NULL) |
|
7638 IN_param_value = function_call_param_iterator.next(); |
|
7639 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7640 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7641 |
|
7642 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7643 { |
|
7644 |
|
7645 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
7646 s4o.print("("); |
|
7647 return_type_symbol->accept(*this); |
|
7648 s4o.print(")__time_to_int("); |
|
7649 IN_param_value->accept(*this); |
|
7650 s4o.print(")"); |
|
7651 return NULL; |
|
7652 |
|
7653 } |
|
7654 |
|
7655 ERROR; |
|
7656 } |
|
7657 |
|
7658 }/*function_time_to_int*/ |
|
7659 break; |
|
7660 |
|
7661 /**** |
|
7662 *TIME_TO_DINT |
|
7663 */ |
|
7664 case function_time_to_dint : |
|
7665 { |
|
7666 symbol_c *last_type_symbol = NULL; |
|
7667 |
|
7668 { |
|
7669 identifier_c param_name("IN"); |
|
7670 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7671 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7672 |
|
7673 /* Get the value from a foo(<param_value>) style call */ |
|
7674 if (IN_param_value == NULL) |
|
7675 IN_param_value = function_call_param_iterator.next(); |
|
7676 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7677 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7678 |
|
7679 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7680 { |
|
7681 |
|
7682 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
7683 s4o.print("("); |
|
7684 return_type_symbol->accept(*this); |
|
7685 s4o.print(")__time_to_int("); |
|
7686 IN_param_value->accept(*this); |
|
7687 s4o.print(")"); |
|
7688 return NULL; |
|
7689 |
|
7690 } |
|
7691 |
|
7692 ERROR; |
|
7693 } |
|
7694 |
|
7695 }/*function_time_to_dint*/ |
|
7696 break; |
|
7697 |
|
7698 /**** |
|
7699 *TIME_TO_LINT |
|
7700 */ |
|
7701 case function_time_to_lint : |
|
7702 { |
|
7703 symbol_c *last_type_symbol = NULL; |
|
7704 |
|
7705 { |
|
7706 identifier_c param_name("IN"); |
|
7707 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7708 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7709 |
|
7710 /* Get the value from a foo(<param_value>) style call */ |
|
7711 if (IN_param_value == NULL) |
|
7712 IN_param_value = function_call_param_iterator.next(); |
|
7713 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7714 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7715 |
|
7716 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7717 { |
|
7718 |
|
7719 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
7720 s4o.print("("); |
|
7721 return_type_symbol->accept(*this); |
|
7722 s4o.print(")__time_to_int("); |
|
7723 IN_param_value->accept(*this); |
|
7724 s4o.print(")"); |
|
7725 return NULL; |
|
7726 |
|
7727 } |
|
7728 |
|
7729 ERROR; |
|
7730 } |
|
7731 |
|
7732 }/*function_time_to_lint*/ |
|
7733 break; |
|
7734 |
|
7735 /**** |
|
7736 *TIME_TO_USINT |
|
7737 */ |
|
7738 case function_time_to_usint : |
|
7739 { |
|
7740 symbol_c *last_type_symbol = NULL; |
|
7741 |
|
7742 { |
|
7743 identifier_c param_name("IN"); |
|
7744 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7745 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7746 |
|
7747 /* Get the value from a foo(<param_value>) style call */ |
|
7748 if (IN_param_value == NULL) |
|
7749 IN_param_value = function_call_param_iterator.next(); |
|
7750 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7751 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7752 |
|
7753 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7754 { |
|
7755 |
|
7756 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
7757 s4o.print("("); |
|
7758 return_type_symbol->accept(*this); |
|
7759 s4o.print(")__time_to_int("); |
|
7760 IN_param_value->accept(*this); |
|
7761 s4o.print(")"); |
|
7762 return NULL; |
|
7763 |
|
7764 } |
|
7765 |
|
7766 ERROR; |
|
7767 } |
|
7768 |
|
7769 }/*function_time_to_usint*/ |
|
7770 break; |
|
7771 |
|
7772 /**** |
|
7773 *TIME_TO_UINT |
|
7774 */ |
|
7775 case function_time_to_uint : |
|
7776 { |
|
7777 symbol_c *last_type_symbol = NULL; |
|
7778 |
|
7779 { |
|
7780 identifier_c param_name("IN"); |
|
7781 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7782 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7783 |
|
7784 /* Get the value from a foo(<param_value>) style call */ |
|
7785 if (IN_param_value == NULL) |
|
7786 IN_param_value = function_call_param_iterator.next(); |
|
7787 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7788 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7789 |
|
7790 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7791 { |
|
7792 |
|
7793 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
7794 s4o.print("("); |
|
7795 return_type_symbol->accept(*this); |
|
7796 s4o.print(")__time_to_int("); |
|
7797 IN_param_value->accept(*this); |
|
7798 s4o.print(")"); |
|
7799 return NULL; |
|
7800 |
|
7801 } |
|
7802 |
|
7803 ERROR; |
|
7804 } |
|
7805 |
|
7806 }/*function_time_to_uint*/ |
|
7807 break; |
|
7808 |
|
7809 /**** |
|
7810 *TIME_TO_UDINT |
|
7811 */ |
|
7812 case function_time_to_udint : |
|
7813 { |
|
7814 symbol_c *last_type_symbol = NULL; |
|
7815 |
|
7816 { |
|
7817 identifier_c param_name("IN"); |
|
7818 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7819 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7820 |
|
7821 /* Get the value from a foo(<param_value>) style call */ |
|
7822 if (IN_param_value == NULL) |
|
7823 IN_param_value = function_call_param_iterator.next(); |
|
7824 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7825 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7826 |
|
7827 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7828 { |
|
7829 |
|
7830 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
7831 s4o.print("("); |
|
7832 return_type_symbol->accept(*this); |
|
7833 s4o.print(")__time_to_int("); |
|
7834 IN_param_value->accept(*this); |
|
7835 s4o.print(")"); |
|
7836 return NULL; |
|
7837 |
|
7838 } |
|
7839 |
|
7840 ERROR; |
|
7841 } |
|
7842 |
|
7843 }/*function_time_to_udint*/ |
|
7844 break; |
|
7845 |
|
7846 /**** |
|
7847 *TIME_TO_ULINT |
|
7848 */ |
|
7849 case function_time_to_ulint : |
|
7850 { |
|
7851 symbol_c *last_type_symbol = NULL; |
|
7852 |
|
7853 { |
|
7854 identifier_c param_name("IN"); |
|
7855 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7856 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7857 |
|
7858 /* Get the value from a foo(<param_value>) style call */ |
|
7859 if (IN_param_value == NULL) |
|
7860 IN_param_value = function_call_param_iterator.next(); |
|
7861 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7862 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7863 |
|
7864 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7865 { |
|
7866 |
|
7867 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
7868 s4o.print("("); |
|
7869 return_type_symbol->accept(*this); |
|
7870 s4o.print(")__time_to_int("); |
|
7871 IN_param_value->accept(*this); |
|
7872 s4o.print(")"); |
|
7873 return NULL; |
|
7874 |
|
7875 } |
|
7876 |
|
7877 ERROR; |
|
7878 } |
|
7879 |
|
7880 }/*function_time_to_ulint*/ |
|
7881 break; |
|
7882 |
|
7883 /**** |
|
7884 *TIME_TO_REAL |
|
7885 */ |
|
7886 case function_time_to_real : |
|
7887 { |
|
7888 symbol_c *last_type_symbol = NULL; |
|
7889 |
|
7890 { |
|
7891 identifier_c param_name("IN"); |
|
7892 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7893 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7894 |
|
7895 /* Get the value from a foo(<param_value>) style call */ |
|
7896 if (IN_param_value == NULL) |
|
7897 IN_param_value = function_call_param_iterator.next(); |
|
7898 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7899 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7900 |
|
7901 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7902 { |
|
7903 |
|
7904 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
7905 s4o.print("("); |
|
7906 return_type_symbol->accept(*this); |
|
7907 s4o.print(")__time_to_real("); |
|
7908 IN_param_value->accept(*this); |
|
7909 s4o.print(")"); |
|
7910 return NULL; |
|
7911 |
|
7912 } |
|
7913 |
|
7914 ERROR; |
|
7915 } |
|
7916 |
|
7917 }/*function_time_to_real*/ |
|
7918 break; |
|
7919 |
|
7920 /**** |
|
7921 *TIME_TO_LREAL |
|
7922 */ |
|
7923 case function_time_to_lreal : |
|
7924 { |
|
7925 symbol_c *last_type_symbol = NULL; |
|
7926 |
|
7927 { |
|
7928 identifier_c param_name("IN"); |
|
7929 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7930 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7931 |
|
7932 /* Get the value from a foo(<param_value>) style call */ |
|
7933 if (IN_param_value == NULL) |
|
7934 IN_param_value = function_call_param_iterator.next(); |
|
7935 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7936 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7937 |
|
7938 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7939 { |
|
7940 |
|
7941 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
7942 s4o.print("("); |
|
7943 return_type_symbol->accept(*this); |
|
7944 s4o.print(")__time_to_real("); |
|
7945 IN_param_value->accept(*this); |
|
7946 s4o.print(")"); |
|
7947 return NULL; |
|
7948 |
|
7949 } |
|
7950 |
|
7951 ERROR; |
|
7952 } |
|
7953 |
|
7954 }/*function_time_to_lreal*/ |
|
7955 break; |
|
7956 |
|
7957 /**** |
|
7958 *TIME_TO_STRING |
|
7959 */ |
|
7960 case function_time_to_string : |
|
7961 { |
|
7962 symbol_c *last_type_symbol = NULL; |
|
7963 |
|
7964 { |
|
7965 identifier_c param_name("IN"); |
|
7966 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7967 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7968 |
|
7969 /* Get the value from a foo(<param_value>) style call */ |
|
7970 if (IN_param_value == NULL) |
|
7971 IN_param_value = function_call_param_iterator.next(); |
|
7972 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7973 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7974 |
|
7975 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7976 { |
|
7977 |
|
7978 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
7979 s4o.print("("); |
|
7980 return_type_symbol->accept(*this); |
|
7981 s4o.print(")__time_to_string("); |
|
7982 IN_param_value->accept(*this); |
|
7983 s4o.print(")"); |
|
7984 return NULL; |
|
7985 |
|
7986 } |
|
7987 |
|
7988 ERROR; |
|
7989 } |
|
7990 |
|
7991 }/*function_time_to_string*/ |
|
7992 break; |
|
7993 |
|
7994 /**** |
|
7995 *TIME_TO_BYTE |
|
7996 */ |
|
7997 case function_time_to_byte : |
|
7998 { |
|
7999 symbol_c *last_type_symbol = NULL; |
|
8000 |
|
8001 { |
|
8002 identifier_c param_name("IN"); |
|
8003 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8004 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8005 |
|
8006 /* Get the value from a foo(<param_value>) style call */ |
|
8007 if (IN_param_value == NULL) |
|
8008 IN_param_value = function_call_param_iterator.next(); |
|
8009 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8010 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8011 |
|
8012 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
8013 { |
|
8014 |
|
8015 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
8016 s4o.print("("); |
|
8017 return_type_symbol->accept(*this); |
|
8018 s4o.print(")__time_to_int("); |
|
8019 IN_param_value->accept(*this); |
|
8020 s4o.print(")"); |
|
8021 return NULL; |
|
8022 |
|
8023 } |
|
8024 |
|
8025 ERROR; |
|
8026 } |
|
8027 |
|
8028 }/*function_time_to_byte*/ |
|
8029 break; |
|
8030 |
|
8031 /**** |
|
8032 *TIME_TO_WORD |
|
8033 */ |
|
8034 case function_time_to_word : |
|
8035 { |
|
8036 symbol_c *last_type_symbol = NULL; |
|
8037 |
|
8038 { |
|
8039 identifier_c param_name("IN"); |
|
8040 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8041 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8042 |
|
8043 /* Get the value from a foo(<param_value>) style call */ |
|
8044 if (IN_param_value == NULL) |
|
8045 IN_param_value = function_call_param_iterator.next(); |
|
8046 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8047 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8048 |
|
8049 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
8050 { |
|
8051 |
|
8052 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
8053 s4o.print("("); |
|
8054 return_type_symbol->accept(*this); |
|
8055 s4o.print(")__time_to_int("); |
|
8056 IN_param_value->accept(*this); |
|
8057 s4o.print(")"); |
|
8058 return NULL; |
|
8059 |
|
8060 } |
|
8061 |
|
8062 ERROR; |
|
8063 } |
|
8064 |
|
8065 }/*function_time_to_word*/ |
|
8066 break; |
|
8067 |
|
8068 /**** |
|
8069 *TIME_TO_DWORD |
|
8070 */ |
|
8071 case function_time_to_dword : |
|
8072 { |
|
8073 symbol_c *last_type_symbol = NULL; |
|
8074 |
|
8075 { |
|
8076 identifier_c param_name("IN"); |
|
8077 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8078 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8079 |
|
8080 /* Get the value from a foo(<param_value>) style call */ |
|
8081 if (IN_param_value == NULL) |
|
8082 IN_param_value = function_call_param_iterator.next(); |
|
8083 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8084 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8085 |
|
8086 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
8087 { |
|
8088 |
|
8089 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
8090 s4o.print("("); |
|
8091 return_type_symbol->accept(*this); |
|
8092 s4o.print(")__time_to_int("); |
|
8093 IN_param_value->accept(*this); |
|
8094 s4o.print(")"); |
|
8095 return NULL; |
|
8096 |
|
8097 } |
|
8098 |
|
8099 ERROR; |
|
8100 } |
|
8101 |
|
8102 }/*function_time_to_dword*/ |
|
8103 break; |
|
8104 |
|
8105 /**** |
|
8106 *TIME_TO_LWORD |
|
8107 */ |
|
8108 case function_time_to_lword : |
|
8109 { |
|
8110 symbol_c *last_type_symbol = NULL; |
|
8111 |
|
8112 { |
|
8113 identifier_c param_name("IN"); |
|
8114 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8115 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8116 |
|
8117 /* Get the value from a foo(<param_value>) style call */ |
|
8118 if (IN_param_value == NULL) |
|
8119 IN_param_value = function_call_param_iterator.next(); |
|
8120 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8121 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8122 |
|
8123 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
8124 { |
|
8125 |
|
8126 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
8127 s4o.print("("); |
|
8128 return_type_symbol->accept(*this); |
|
8129 s4o.print(")__time_to_int("); |
|
8130 IN_param_value->accept(*this); |
|
8131 s4o.print(")"); |
|
8132 return NULL; |
|
8133 |
|
8134 } |
|
8135 |
|
8136 ERROR; |
|
8137 } |
|
8138 |
|
8139 }/*function_time_to_lword*/ |
|
8140 break; |
|
8141 |
|
8142 /**** |
|
8143 *DATE_TO_SINT |
|
8144 */ |
|
8145 case function_date_to_sint : |
|
8146 { |
|
8147 symbol_c *last_type_symbol = NULL; |
|
8148 |
|
8149 { |
|
8150 identifier_c param_name("IN"); |
|
8151 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8152 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8153 |
|
8154 /* Get the value from a foo(<param_value>) style call */ |
|
8155 if (IN_param_value == NULL) |
|
8156 IN_param_value = function_call_param_iterator.next(); |
|
8157 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8158 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8159 |
|
8160 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8161 { |
|
8162 |
|
8163 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
8164 s4o.print("("); |
|
8165 return_type_symbol->accept(*this); |
|
8166 s4o.print(")__time_to_int("); |
|
8167 IN_param_value->accept(*this); |
|
8168 s4o.print(")"); |
|
8169 return NULL; |
|
8170 |
|
8171 } |
|
8172 |
|
8173 ERROR; |
|
8174 } |
|
8175 |
|
8176 }/*function_date_to_sint*/ |
|
8177 break; |
|
8178 |
|
8179 /**** |
|
8180 *DATE_TO_INT |
|
8181 */ |
|
8182 case function_date_to_int : |
|
8183 { |
|
8184 symbol_c *last_type_symbol = NULL; |
|
8185 |
|
8186 { |
|
8187 identifier_c param_name("IN"); |
|
8188 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8189 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8190 |
|
8191 /* Get the value from a foo(<param_value>) style call */ |
|
8192 if (IN_param_value == NULL) |
|
8193 IN_param_value = function_call_param_iterator.next(); |
|
8194 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8195 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8196 |
|
8197 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8198 { |
|
8199 |
|
8200 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
8201 s4o.print("("); |
|
8202 return_type_symbol->accept(*this); |
|
8203 s4o.print(")__time_to_int("); |
|
8204 IN_param_value->accept(*this); |
|
8205 s4o.print(")"); |
|
8206 return NULL; |
|
8207 |
|
8208 } |
|
8209 |
|
8210 ERROR; |
|
8211 } |
|
8212 |
|
8213 }/*function_date_to_int*/ |
|
8214 break; |
|
8215 |
|
8216 /**** |
|
8217 *DATE_TO_DINT |
|
8218 */ |
|
8219 case function_date_to_dint : |
|
8220 { |
|
8221 symbol_c *last_type_symbol = NULL; |
|
8222 |
|
8223 { |
|
8224 identifier_c param_name("IN"); |
|
8225 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8226 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8227 |
|
8228 /* Get the value from a foo(<param_value>) style call */ |
|
8229 if (IN_param_value == NULL) |
|
8230 IN_param_value = function_call_param_iterator.next(); |
|
8231 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8232 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8233 |
|
8234 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8235 { |
|
8236 |
|
8237 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
8238 s4o.print("("); |
|
8239 return_type_symbol->accept(*this); |
|
8240 s4o.print(")__time_to_int("); |
|
8241 IN_param_value->accept(*this); |
|
8242 s4o.print(")"); |
|
8243 return NULL; |
|
8244 |
|
8245 } |
|
8246 |
|
8247 ERROR; |
|
8248 } |
|
8249 |
|
8250 }/*function_date_to_dint*/ |
|
8251 break; |
|
8252 |
|
8253 /**** |
|
8254 *DATE_TO_LINT |
|
8255 */ |
|
8256 case function_date_to_lint : |
|
8257 { |
|
8258 symbol_c *last_type_symbol = NULL; |
|
8259 |
|
8260 { |
|
8261 identifier_c param_name("IN"); |
|
8262 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8263 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8264 |
|
8265 /* Get the value from a foo(<param_value>) style call */ |
|
8266 if (IN_param_value == NULL) |
|
8267 IN_param_value = function_call_param_iterator.next(); |
|
8268 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8269 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8270 |
|
8271 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8272 { |
|
8273 |
|
8274 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
8275 s4o.print("("); |
|
8276 return_type_symbol->accept(*this); |
|
8277 s4o.print(")__time_to_int("); |
|
8278 IN_param_value->accept(*this); |
|
8279 s4o.print(")"); |
|
8280 return NULL; |
|
8281 |
|
8282 } |
|
8283 |
|
8284 ERROR; |
|
8285 } |
|
8286 |
|
8287 }/*function_date_to_lint*/ |
|
8288 break; |
|
8289 |
|
8290 /**** |
|
8291 *DATE_TO_USINT |
|
8292 */ |
|
8293 case function_date_to_usint : |
|
8294 { |
|
8295 symbol_c *last_type_symbol = NULL; |
|
8296 |
|
8297 { |
|
8298 identifier_c param_name("IN"); |
|
8299 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8300 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8301 |
|
8302 /* Get the value from a foo(<param_value>) style call */ |
|
8303 if (IN_param_value == NULL) |
|
8304 IN_param_value = function_call_param_iterator.next(); |
|
8305 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8306 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8307 |
|
8308 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8309 { |
|
8310 |
|
8311 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
8312 s4o.print("("); |
|
8313 return_type_symbol->accept(*this); |
|
8314 s4o.print(")__time_to_int("); |
|
8315 IN_param_value->accept(*this); |
|
8316 s4o.print(")"); |
|
8317 return NULL; |
|
8318 |
|
8319 } |
|
8320 |
|
8321 ERROR; |
|
8322 } |
|
8323 |
|
8324 }/*function_date_to_usint*/ |
|
8325 break; |
|
8326 |
|
8327 /**** |
|
8328 *DATE_TO_UINT |
|
8329 */ |
|
8330 case function_date_to_uint : |
|
8331 { |
|
8332 symbol_c *last_type_symbol = NULL; |
|
8333 |
|
8334 { |
|
8335 identifier_c param_name("IN"); |
|
8336 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8337 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8338 |
|
8339 /* Get the value from a foo(<param_value>) style call */ |
|
8340 if (IN_param_value == NULL) |
|
8341 IN_param_value = function_call_param_iterator.next(); |
|
8342 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8343 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8344 |
|
8345 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8346 { |
|
8347 |
|
8348 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
8349 s4o.print("("); |
|
8350 return_type_symbol->accept(*this); |
|
8351 s4o.print(")__time_to_int("); |
|
8352 IN_param_value->accept(*this); |
|
8353 s4o.print(")"); |
|
8354 return NULL; |
|
8355 |
|
8356 } |
|
8357 |
|
8358 ERROR; |
|
8359 } |
|
8360 |
|
8361 }/*function_date_to_uint*/ |
|
8362 break; |
|
8363 |
|
8364 /**** |
|
8365 *DATE_TO_UDINT |
|
8366 */ |
|
8367 case function_date_to_udint : |
|
8368 { |
|
8369 symbol_c *last_type_symbol = NULL; |
|
8370 |
|
8371 { |
|
8372 identifier_c param_name("IN"); |
|
8373 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8374 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8375 |
|
8376 /* Get the value from a foo(<param_value>) style call */ |
|
8377 if (IN_param_value == NULL) |
|
8378 IN_param_value = function_call_param_iterator.next(); |
|
8379 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8380 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8381 |
|
8382 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8383 { |
|
8384 |
|
8385 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
8386 s4o.print("("); |
|
8387 return_type_symbol->accept(*this); |
|
8388 s4o.print(")__time_to_int("); |
|
8389 IN_param_value->accept(*this); |
|
8390 s4o.print(")"); |
|
8391 return NULL; |
|
8392 |
|
8393 } |
|
8394 |
|
8395 ERROR; |
|
8396 } |
|
8397 |
|
8398 }/*function_date_to_udint*/ |
|
8399 break; |
|
8400 |
|
8401 /**** |
|
8402 *DATE_TO_ULINT |
|
8403 */ |
|
8404 case function_date_to_ulint : |
|
8405 { |
|
8406 symbol_c *last_type_symbol = NULL; |
|
8407 |
|
8408 { |
|
8409 identifier_c param_name("IN"); |
|
8410 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8411 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8412 |
|
8413 /* Get the value from a foo(<param_value>) style call */ |
|
8414 if (IN_param_value == NULL) |
|
8415 IN_param_value = function_call_param_iterator.next(); |
|
8416 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8417 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8418 |
|
8419 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8420 { |
|
8421 |
|
8422 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
8423 s4o.print("("); |
|
8424 return_type_symbol->accept(*this); |
|
8425 s4o.print(")__time_to_int("); |
|
8426 IN_param_value->accept(*this); |
|
8427 s4o.print(")"); |
|
8428 return NULL; |
|
8429 |
|
8430 } |
|
8431 |
|
8432 ERROR; |
|
8433 } |
|
8434 |
|
8435 }/*function_date_to_ulint*/ |
|
8436 break; |
|
8437 |
|
8438 /**** |
|
8439 *DATE_TO_REAL |
|
8440 */ |
|
8441 case function_date_to_real : |
|
8442 { |
|
8443 symbol_c *last_type_symbol = NULL; |
|
8444 |
|
8445 { |
|
8446 identifier_c param_name("IN"); |
|
8447 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8448 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8449 |
|
8450 /* Get the value from a foo(<param_value>) style call */ |
|
8451 if (IN_param_value == NULL) |
|
8452 IN_param_value = function_call_param_iterator.next(); |
|
8453 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8454 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8455 |
|
8456 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8457 { |
|
8458 |
|
8459 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
8460 s4o.print("("); |
|
8461 return_type_symbol->accept(*this); |
|
8462 s4o.print(")__time_to_real("); |
|
8463 IN_param_value->accept(*this); |
|
8464 s4o.print(")"); |
|
8465 return NULL; |
|
8466 |
|
8467 } |
|
8468 |
|
8469 ERROR; |
|
8470 } |
|
8471 |
|
8472 }/*function_date_to_real*/ |
|
8473 break; |
|
8474 |
|
8475 /**** |
|
8476 *DATE_TO_LREAL |
|
8477 */ |
|
8478 case function_date_to_lreal : |
|
8479 { |
|
8480 symbol_c *last_type_symbol = NULL; |
|
8481 |
|
8482 { |
|
8483 identifier_c param_name("IN"); |
|
8484 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8485 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8486 |
|
8487 /* Get the value from a foo(<param_value>) style call */ |
|
8488 if (IN_param_value == NULL) |
|
8489 IN_param_value = function_call_param_iterator.next(); |
|
8490 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8491 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8492 |
|
8493 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8494 { |
|
8495 |
|
8496 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
8497 s4o.print("("); |
|
8498 return_type_symbol->accept(*this); |
|
8499 s4o.print(")__time_to_real("); |
|
8500 IN_param_value->accept(*this); |
|
8501 s4o.print(")"); |
|
8502 return NULL; |
|
8503 |
|
8504 } |
|
8505 |
|
8506 ERROR; |
|
8507 } |
|
8508 |
|
8509 }/*function_date_to_lreal*/ |
|
8510 break; |
|
8511 |
|
8512 /**** |
|
8513 *DATE_TO_STRING |
|
8514 */ |
|
8515 case function_date_to_string : |
|
8516 { |
|
8517 symbol_c *last_type_symbol = NULL; |
|
8518 |
|
8519 { |
|
8520 identifier_c param_name("IN"); |
|
8521 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8522 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8523 |
|
8524 /* Get the value from a foo(<param_value>) style call */ |
|
8525 if (IN_param_value == NULL) |
|
8526 IN_param_value = function_call_param_iterator.next(); |
|
8527 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8528 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8529 |
|
8530 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8531 { |
|
8532 |
|
8533 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
8534 s4o.print("("); |
|
8535 return_type_symbol->accept(*this); |
|
8536 s4o.print(")__date_to_string("); |
|
8537 IN_param_value->accept(*this); |
|
8538 s4o.print(")"); |
|
8539 return NULL; |
|
8540 |
|
8541 } |
|
8542 |
|
8543 ERROR; |
|
8544 } |
|
8545 |
|
8546 }/*function_date_to_string*/ |
|
8547 break; |
|
8548 |
|
8549 /**** |
|
8550 *DATE_TO_BYTE |
|
8551 */ |
|
8552 case function_date_to_byte : |
|
8553 { |
|
8554 symbol_c *last_type_symbol = NULL; |
|
8555 |
|
8556 { |
|
8557 identifier_c param_name("IN"); |
|
8558 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8559 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8560 |
|
8561 /* Get the value from a foo(<param_value>) style call */ |
|
8562 if (IN_param_value == NULL) |
|
8563 IN_param_value = function_call_param_iterator.next(); |
|
8564 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8565 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8566 |
|
8567 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8568 { |
|
8569 |
|
8570 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
8571 s4o.print("("); |
|
8572 return_type_symbol->accept(*this); |
|
8573 s4o.print(")__time_to_int("); |
|
8574 IN_param_value->accept(*this); |
|
8575 s4o.print(")"); |
|
8576 return NULL; |
|
8577 |
|
8578 } |
|
8579 |
|
8580 ERROR; |
|
8581 } |
|
8582 |
|
8583 }/*function_date_to_byte*/ |
|
8584 break; |
|
8585 |
|
8586 /**** |
|
8587 *DATE_TO_WORD |
|
8588 */ |
|
8589 case function_date_to_word : |
|
8590 { |
|
8591 symbol_c *last_type_symbol = NULL; |
|
8592 |
|
8593 { |
|
8594 identifier_c param_name("IN"); |
|
8595 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8596 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8597 |
|
8598 /* Get the value from a foo(<param_value>) style call */ |
|
8599 if (IN_param_value == NULL) |
|
8600 IN_param_value = function_call_param_iterator.next(); |
|
8601 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8602 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8603 |
|
8604 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8605 { |
|
8606 |
|
8607 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
8608 s4o.print("("); |
|
8609 return_type_symbol->accept(*this); |
|
8610 s4o.print(")__time_to_int("); |
|
8611 IN_param_value->accept(*this); |
|
8612 s4o.print(")"); |
|
8613 return NULL; |
|
8614 |
|
8615 } |
|
8616 |
|
8617 ERROR; |
|
8618 } |
|
8619 |
|
8620 }/*function_date_to_word*/ |
|
8621 break; |
|
8622 |
|
8623 /**** |
|
8624 *DATE_TO_DWORD |
|
8625 */ |
|
8626 case function_date_to_dword : |
|
8627 { |
|
8628 symbol_c *last_type_symbol = NULL; |
|
8629 |
|
8630 { |
|
8631 identifier_c param_name("IN"); |
|
8632 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8633 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8634 |
|
8635 /* Get the value from a foo(<param_value>) style call */ |
|
8636 if (IN_param_value == NULL) |
|
8637 IN_param_value = function_call_param_iterator.next(); |
|
8638 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8639 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8640 |
|
8641 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8642 { |
|
8643 |
|
8644 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
8645 s4o.print("("); |
|
8646 return_type_symbol->accept(*this); |
|
8647 s4o.print(")__time_to_int("); |
|
8648 IN_param_value->accept(*this); |
|
8649 s4o.print(")"); |
|
8650 return NULL; |
|
8651 |
|
8652 } |
|
8653 |
|
8654 ERROR; |
|
8655 } |
|
8656 |
|
8657 }/*function_date_to_dword*/ |
|
8658 break; |
|
8659 |
|
8660 /**** |
|
8661 *DATE_TO_LWORD |
|
8662 */ |
|
8663 case function_date_to_lword : |
|
8664 { |
|
8665 symbol_c *last_type_symbol = NULL; |
|
8666 |
|
8667 { |
|
8668 identifier_c param_name("IN"); |
|
8669 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8670 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8671 |
|
8672 /* Get the value from a foo(<param_value>) style call */ |
|
8673 if (IN_param_value == NULL) |
|
8674 IN_param_value = function_call_param_iterator.next(); |
|
8675 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8676 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8677 |
|
8678 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
8679 { |
|
8680 |
|
8681 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
8682 s4o.print("("); |
|
8683 return_type_symbol->accept(*this); |
|
8684 s4o.print(")__time_to_int("); |
|
8685 IN_param_value->accept(*this); |
|
8686 s4o.print(")"); |
|
8687 return NULL; |
|
8688 |
|
8689 } |
|
8690 |
|
8691 ERROR; |
|
8692 } |
|
8693 |
|
8694 }/*function_date_to_lword*/ |
|
8695 break; |
|
8696 |
|
8697 /**** |
|
8698 *TOD_TO_SINT |
|
8699 */ |
|
8700 case function_tod_to_sint : |
|
8701 { |
|
8702 symbol_c *last_type_symbol = NULL; |
|
8703 |
|
8704 { |
|
8705 identifier_c param_name("IN"); |
|
8706 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8707 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8708 |
|
8709 /* Get the value from a foo(<param_value>) style call */ |
|
8710 if (IN_param_value == NULL) |
|
8711 IN_param_value = function_call_param_iterator.next(); |
|
8712 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8713 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8714 |
|
8715 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8716 { |
|
8717 |
|
8718 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
8719 s4o.print("("); |
|
8720 return_type_symbol->accept(*this); |
|
8721 s4o.print(")__time_to_int("); |
|
8722 IN_param_value->accept(*this); |
|
8723 s4o.print(")"); |
|
8724 return NULL; |
|
8725 |
|
8726 } |
|
8727 |
|
8728 ERROR; |
|
8729 } |
|
8730 |
|
8731 }/*function_tod_to_sint*/ |
|
8732 break; |
|
8733 |
|
8734 /**** |
|
8735 *TOD_TO_INT |
|
8736 */ |
|
8737 case function_tod_to_int : |
|
8738 { |
|
8739 symbol_c *last_type_symbol = NULL; |
|
8740 |
|
8741 { |
|
8742 identifier_c param_name("IN"); |
|
8743 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8744 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8745 |
|
8746 /* Get the value from a foo(<param_value>) style call */ |
|
8747 if (IN_param_value == NULL) |
|
8748 IN_param_value = function_call_param_iterator.next(); |
|
8749 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8750 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8751 |
|
8752 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8753 { |
|
8754 |
|
8755 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
8756 s4o.print("("); |
|
8757 return_type_symbol->accept(*this); |
|
8758 s4o.print(")__time_to_int("); |
|
8759 IN_param_value->accept(*this); |
|
8760 s4o.print(")"); |
|
8761 return NULL; |
|
8762 |
|
8763 } |
|
8764 |
|
8765 ERROR; |
|
8766 } |
|
8767 |
|
8768 }/*function_tod_to_int*/ |
|
8769 break; |
|
8770 |
|
8771 /**** |
|
8772 *TOD_TO_DINT |
|
8773 */ |
|
8774 case function_tod_to_dint : |
|
8775 { |
|
8776 symbol_c *last_type_symbol = NULL; |
|
8777 |
|
8778 { |
|
8779 identifier_c param_name("IN"); |
|
8780 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8781 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8782 |
|
8783 /* Get the value from a foo(<param_value>) style call */ |
|
8784 if (IN_param_value == NULL) |
|
8785 IN_param_value = function_call_param_iterator.next(); |
|
8786 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8787 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8788 |
|
8789 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8790 { |
|
8791 |
|
8792 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
8793 s4o.print("("); |
|
8794 return_type_symbol->accept(*this); |
|
8795 s4o.print(")__time_to_int("); |
|
8796 IN_param_value->accept(*this); |
|
8797 s4o.print(")"); |
|
8798 return NULL; |
|
8799 |
|
8800 } |
|
8801 |
|
8802 ERROR; |
|
8803 } |
|
8804 |
|
8805 }/*function_tod_to_dint*/ |
|
8806 break; |
|
8807 |
|
8808 /**** |
|
8809 *TOD_TO_LINT |
|
8810 */ |
|
8811 case function_tod_to_lint : |
|
8812 { |
|
8813 symbol_c *last_type_symbol = NULL; |
|
8814 |
|
8815 { |
|
8816 identifier_c param_name("IN"); |
|
8817 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8818 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8819 |
|
8820 /* Get the value from a foo(<param_value>) style call */ |
|
8821 if (IN_param_value == NULL) |
|
8822 IN_param_value = function_call_param_iterator.next(); |
|
8823 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8824 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8825 |
|
8826 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8827 { |
|
8828 |
|
8829 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
8830 s4o.print("("); |
|
8831 return_type_symbol->accept(*this); |
|
8832 s4o.print(")__time_to_int("); |
|
8833 IN_param_value->accept(*this); |
|
8834 s4o.print(")"); |
|
8835 return NULL; |
|
8836 |
|
8837 } |
|
8838 |
|
8839 ERROR; |
|
8840 } |
|
8841 |
|
8842 }/*function_tod_to_lint*/ |
|
8843 break; |
|
8844 |
|
8845 /**** |
|
8846 *TOD_TO_USINT |
|
8847 */ |
|
8848 case function_tod_to_usint : |
|
8849 { |
|
8850 symbol_c *last_type_symbol = NULL; |
|
8851 |
|
8852 { |
|
8853 identifier_c param_name("IN"); |
|
8854 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8855 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8856 |
|
8857 /* Get the value from a foo(<param_value>) style call */ |
|
8858 if (IN_param_value == NULL) |
|
8859 IN_param_value = function_call_param_iterator.next(); |
|
8860 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8861 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8862 |
|
8863 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8864 { |
|
8865 |
|
8866 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
8867 s4o.print("("); |
|
8868 return_type_symbol->accept(*this); |
|
8869 s4o.print(")__time_to_int("); |
|
8870 IN_param_value->accept(*this); |
|
8871 s4o.print(")"); |
|
8872 return NULL; |
|
8873 |
|
8874 } |
|
8875 |
|
8876 ERROR; |
|
8877 } |
|
8878 |
|
8879 }/*function_tod_to_usint*/ |
|
8880 break; |
|
8881 |
|
8882 /**** |
|
8883 *TOD_TO_UINT |
|
8884 */ |
|
8885 case function_tod_to_uint : |
|
8886 { |
|
8887 symbol_c *last_type_symbol = NULL; |
|
8888 |
|
8889 { |
|
8890 identifier_c param_name("IN"); |
|
8891 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8892 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8893 |
|
8894 /* Get the value from a foo(<param_value>) style call */ |
|
8895 if (IN_param_value == NULL) |
|
8896 IN_param_value = function_call_param_iterator.next(); |
|
8897 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8898 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8899 |
|
8900 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8901 { |
|
8902 |
|
8903 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
8904 s4o.print("("); |
|
8905 return_type_symbol->accept(*this); |
|
8906 s4o.print(")__time_to_int("); |
|
8907 IN_param_value->accept(*this); |
|
8908 s4o.print(")"); |
|
8909 return NULL; |
|
8910 |
|
8911 } |
|
8912 |
|
8913 ERROR; |
|
8914 } |
|
8915 |
|
8916 }/*function_tod_to_uint*/ |
|
8917 break; |
|
8918 |
|
8919 /**** |
|
8920 *TOD_TO_UDINT |
|
8921 */ |
|
8922 case function_tod_to_udint : |
|
8923 { |
|
8924 symbol_c *last_type_symbol = NULL; |
|
8925 |
|
8926 { |
|
8927 identifier_c param_name("IN"); |
|
8928 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8929 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8930 |
|
8931 /* Get the value from a foo(<param_value>) style call */ |
|
8932 if (IN_param_value == NULL) |
|
8933 IN_param_value = function_call_param_iterator.next(); |
|
8934 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8935 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8936 |
|
8937 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8938 { |
|
8939 |
|
8940 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
8941 s4o.print("("); |
|
8942 return_type_symbol->accept(*this); |
|
8943 s4o.print(")__time_to_int("); |
|
8944 IN_param_value->accept(*this); |
|
8945 s4o.print(")"); |
|
8946 return NULL; |
|
8947 |
|
8948 } |
|
8949 |
|
8950 ERROR; |
|
8951 } |
|
8952 |
|
8953 }/*function_tod_to_udint*/ |
|
8954 break; |
|
8955 |
|
8956 /**** |
|
8957 *TOD_TO_ULINT |
|
8958 */ |
|
8959 case function_tod_to_ulint : |
|
8960 { |
|
8961 symbol_c *last_type_symbol = NULL; |
|
8962 |
|
8963 { |
|
8964 identifier_c param_name("IN"); |
|
8965 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8966 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8967 |
|
8968 /* Get the value from a foo(<param_value>) style call */ |
|
8969 if (IN_param_value == NULL) |
|
8970 IN_param_value = function_call_param_iterator.next(); |
|
8971 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8972 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8973 |
|
8974 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8975 { |
|
8976 |
|
8977 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
8978 s4o.print("("); |
|
8979 return_type_symbol->accept(*this); |
|
8980 s4o.print(")__time_to_int("); |
|
8981 IN_param_value->accept(*this); |
|
8982 s4o.print(")"); |
|
8983 return NULL; |
|
8984 |
|
8985 } |
|
8986 |
|
8987 ERROR; |
|
8988 } |
|
8989 |
|
8990 }/*function_tod_to_ulint*/ |
|
8991 break; |
|
8992 |
|
8993 /**** |
|
8994 *TOD_TO_REAL |
|
8995 */ |
|
8996 case function_tod_to_real : |
|
8997 { |
|
8998 symbol_c *last_type_symbol = NULL; |
|
8999 |
|
9000 { |
|
9001 identifier_c param_name("IN"); |
|
9002 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9003 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9004 |
|
9005 /* Get the value from a foo(<param_value>) style call */ |
|
9006 if (IN_param_value == NULL) |
|
9007 IN_param_value = function_call_param_iterator.next(); |
|
9008 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9009 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9010 |
|
9011 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
9012 { |
|
9013 |
|
9014 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
9015 s4o.print("("); |
|
9016 return_type_symbol->accept(*this); |
|
9017 s4o.print(")__time_to_real("); |
|
9018 IN_param_value->accept(*this); |
|
9019 s4o.print(")"); |
|
9020 return NULL; |
|
9021 |
|
9022 } |
|
9023 |
|
9024 ERROR; |
|
9025 } |
|
9026 |
|
9027 }/*function_tod_to_real*/ |
|
9028 break; |
|
9029 |
|
9030 /**** |
|
9031 *TOD_TO_LREAL |
|
9032 */ |
|
9033 case function_tod_to_lreal : |
|
9034 { |
|
9035 symbol_c *last_type_symbol = NULL; |
|
9036 |
|
9037 { |
|
9038 identifier_c param_name("IN"); |
|
9039 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9040 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9041 |
|
9042 /* Get the value from a foo(<param_value>) style call */ |
|
9043 if (IN_param_value == NULL) |
|
9044 IN_param_value = function_call_param_iterator.next(); |
|
9045 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9046 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9047 |
|
9048 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
9049 { |
|
9050 |
|
9051 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
9052 s4o.print("("); |
|
9053 return_type_symbol->accept(*this); |
|
9054 s4o.print(")__time_to_real("); |
|
9055 IN_param_value->accept(*this); |
|
9056 s4o.print(")"); |
|
9057 return NULL; |
|
9058 |
|
9059 } |
|
9060 |
|
9061 ERROR; |
|
9062 } |
|
9063 |
|
9064 }/*function_tod_to_lreal*/ |
|
9065 break; |
|
9066 |
|
9067 /**** |
|
9068 *TOD_TO_STRING |
|
9069 */ |
|
9070 case function_tod_to_string : |
|
9071 { |
|
9072 symbol_c *last_type_symbol = NULL; |
|
9073 |
|
9074 { |
|
9075 identifier_c param_name("IN"); |
|
9076 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9077 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9078 |
|
9079 /* Get the value from a foo(<param_value>) style call */ |
|
9080 if (IN_param_value == NULL) |
|
9081 IN_param_value = function_call_param_iterator.next(); |
|
9082 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9083 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9084 |
|
9085 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
9086 { |
|
9087 |
|
9088 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
9089 s4o.print("("); |
|
9090 return_type_symbol->accept(*this); |
|
9091 s4o.print(")__tod_to_string("); |
|
9092 IN_param_value->accept(*this); |
|
9093 s4o.print(")"); |
|
9094 return NULL; |
|
9095 |
|
9096 } |
|
9097 |
|
9098 ERROR; |
|
9099 } |
|
9100 |
|
9101 }/*function_tod_to_string*/ |
|
9102 break; |
|
9103 |
|
9104 /**** |
|
9105 *TOD_TO_BYTE |
|
9106 */ |
|
9107 case function_tod_to_byte : |
|
9108 { |
|
9109 symbol_c *last_type_symbol = NULL; |
|
9110 |
|
9111 { |
|
9112 identifier_c param_name("IN"); |
|
9113 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9114 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9115 |
|
9116 /* Get the value from a foo(<param_value>) style call */ |
|
9117 if (IN_param_value == NULL) |
|
9118 IN_param_value = function_call_param_iterator.next(); |
|
9119 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9120 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9121 |
|
9122 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
9123 { |
|
9124 |
|
9125 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
9126 s4o.print("("); |
|
9127 return_type_symbol->accept(*this); |
|
9128 s4o.print(")__time_to_int("); |
|
9129 IN_param_value->accept(*this); |
|
9130 s4o.print(")"); |
|
9131 return NULL; |
|
9132 |
|
9133 } |
|
9134 |
|
9135 ERROR; |
|
9136 } |
|
9137 |
|
9138 }/*function_tod_to_byte*/ |
|
9139 break; |
|
9140 |
|
9141 /**** |
|
9142 *TOD_TO_WORD |
|
9143 */ |
|
9144 case function_tod_to_word : |
|
9145 { |
|
9146 symbol_c *last_type_symbol = NULL; |
|
9147 |
|
9148 { |
|
9149 identifier_c param_name("IN"); |
|
9150 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9151 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9152 |
|
9153 /* Get the value from a foo(<param_value>) style call */ |
|
9154 if (IN_param_value == NULL) |
|
9155 IN_param_value = function_call_param_iterator.next(); |
|
9156 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9157 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9158 |
|
9159 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
9160 { |
|
9161 |
|
9162 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
9163 s4o.print("("); |
|
9164 return_type_symbol->accept(*this); |
|
9165 s4o.print(")__time_to_int("); |
|
9166 IN_param_value->accept(*this); |
|
9167 s4o.print(")"); |
|
9168 return NULL; |
|
9169 |
|
9170 } |
|
9171 |
|
9172 ERROR; |
|
9173 } |
|
9174 |
|
9175 }/*function_tod_to_word*/ |
|
9176 break; |
|
9177 |
|
9178 /**** |
|
9179 *TOD_TO_DWORD |
|
9180 */ |
|
9181 case function_tod_to_dword : |
|
9182 { |
|
9183 symbol_c *last_type_symbol = NULL; |
|
9184 |
|
9185 { |
|
9186 identifier_c param_name("IN"); |
|
9187 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9188 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9189 |
|
9190 /* Get the value from a foo(<param_value>) style call */ |
|
9191 if (IN_param_value == NULL) |
|
9192 IN_param_value = function_call_param_iterator.next(); |
|
9193 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9194 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9195 |
|
9196 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
9197 { |
|
9198 |
|
9199 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
9200 s4o.print("("); |
|
9201 return_type_symbol->accept(*this); |
|
9202 s4o.print(")__time_to_int("); |
|
9203 IN_param_value->accept(*this); |
|
9204 s4o.print(")"); |
|
9205 return NULL; |
|
9206 |
|
9207 } |
|
9208 |
|
9209 ERROR; |
|
9210 } |
|
9211 |
|
9212 }/*function_tod_to_dword*/ |
|
9213 break; |
|
9214 |
|
9215 /**** |
|
9216 *TOD_TO_LWORD |
|
9217 */ |
|
9218 case function_tod_to_lword : |
|
9219 { |
|
9220 symbol_c *last_type_symbol = NULL; |
|
9221 |
|
9222 { |
|
9223 identifier_c param_name("IN"); |
|
9224 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9225 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9226 |
|
9227 /* Get the value from a foo(<param_value>) style call */ |
|
9228 if (IN_param_value == NULL) |
|
9229 IN_param_value = function_call_param_iterator.next(); |
|
9230 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9231 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9232 |
|
9233 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
9234 { |
|
9235 |
|
9236 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
9237 s4o.print("("); |
|
9238 return_type_symbol->accept(*this); |
|
9239 s4o.print(")__time_to_int("); |
|
9240 IN_param_value->accept(*this); |
|
9241 s4o.print(")"); |
|
9242 return NULL; |
|
9243 |
|
9244 } |
|
9245 |
|
9246 ERROR; |
|
9247 } |
|
9248 |
|
9249 }/*function_tod_to_lword*/ |
|
9250 break; |
|
9251 |
|
9252 /**** |
|
9253 *DT_TO_SINT |
|
9254 */ |
|
9255 case function_dt_to_sint : |
|
9256 { |
|
9257 symbol_c *last_type_symbol = NULL; |
|
9258 |
|
9259 { |
|
9260 identifier_c param_name("IN"); |
|
9261 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9262 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9263 |
|
9264 /* Get the value from a foo(<param_value>) style call */ |
|
9265 if (IN_param_value == NULL) |
|
9266 IN_param_value = function_call_param_iterator.next(); |
|
9267 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9268 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9269 |
|
9270 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9271 { |
|
9272 |
|
9273 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
9274 s4o.print("("); |
|
9275 return_type_symbol->accept(*this); |
|
9276 s4o.print(")__time_to_int("); |
|
9277 IN_param_value->accept(*this); |
|
9278 s4o.print(")"); |
|
9279 return NULL; |
|
9280 |
|
9281 } |
|
9282 |
|
9283 ERROR; |
|
9284 } |
|
9285 |
|
9286 }/*function_dt_to_sint*/ |
|
9287 break; |
|
9288 |
|
9289 /**** |
|
9290 *DT_TO_INT |
|
9291 */ |
|
9292 case function_dt_to_int : |
|
9293 { |
|
9294 symbol_c *last_type_symbol = NULL; |
|
9295 |
|
9296 { |
|
9297 identifier_c param_name("IN"); |
|
9298 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9299 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9300 |
|
9301 /* Get the value from a foo(<param_value>) style call */ |
|
9302 if (IN_param_value == NULL) |
|
9303 IN_param_value = function_call_param_iterator.next(); |
|
9304 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9305 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9306 |
|
9307 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9308 { |
|
9309 |
|
9310 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
9311 s4o.print("("); |
|
9312 return_type_symbol->accept(*this); |
|
9313 s4o.print(")__time_to_int("); |
|
9314 IN_param_value->accept(*this); |
|
9315 s4o.print(")"); |
|
9316 return NULL; |
|
9317 |
|
9318 } |
|
9319 |
|
9320 ERROR; |
|
9321 } |
|
9322 |
|
9323 }/*function_dt_to_int*/ |
|
9324 break; |
|
9325 |
|
9326 /**** |
|
9327 *DT_TO_DINT |
|
9328 */ |
|
9329 case function_dt_to_dint : |
|
9330 { |
|
9331 symbol_c *last_type_symbol = NULL; |
|
9332 |
|
9333 { |
|
9334 identifier_c param_name("IN"); |
|
9335 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9336 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9337 |
|
9338 /* Get the value from a foo(<param_value>) style call */ |
|
9339 if (IN_param_value == NULL) |
|
9340 IN_param_value = function_call_param_iterator.next(); |
|
9341 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9342 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9343 |
|
9344 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9345 { |
|
9346 |
|
9347 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
9348 s4o.print("("); |
|
9349 return_type_symbol->accept(*this); |
|
9350 s4o.print(")__time_to_int("); |
|
9351 IN_param_value->accept(*this); |
|
9352 s4o.print(")"); |
|
9353 return NULL; |
|
9354 |
|
9355 } |
|
9356 |
|
9357 ERROR; |
|
9358 } |
|
9359 |
|
9360 }/*function_dt_to_dint*/ |
|
9361 break; |
|
9362 |
|
9363 /**** |
|
9364 *DT_TO_LINT |
|
9365 */ |
|
9366 case function_dt_to_lint : |
|
9367 { |
|
9368 symbol_c *last_type_symbol = NULL; |
|
9369 |
|
9370 { |
|
9371 identifier_c param_name("IN"); |
|
9372 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9373 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9374 |
|
9375 /* Get the value from a foo(<param_value>) style call */ |
|
9376 if (IN_param_value == NULL) |
|
9377 IN_param_value = function_call_param_iterator.next(); |
|
9378 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9379 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9380 |
|
9381 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9382 { |
|
9383 |
|
9384 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
9385 s4o.print("("); |
|
9386 return_type_symbol->accept(*this); |
|
9387 s4o.print(")__time_to_int("); |
|
9388 IN_param_value->accept(*this); |
|
9389 s4o.print(")"); |
|
9390 return NULL; |
|
9391 |
|
9392 } |
|
9393 |
|
9394 ERROR; |
|
9395 } |
|
9396 |
|
9397 }/*function_dt_to_lint*/ |
|
9398 break; |
|
9399 |
|
9400 /**** |
|
9401 *DT_TO_USINT |
|
9402 */ |
|
9403 case function_dt_to_usint : |
|
9404 { |
|
9405 symbol_c *last_type_symbol = NULL; |
|
9406 |
|
9407 { |
|
9408 identifier_c param_name("IN"); |
|
9409 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9410 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9411 |
|
9412 /* Get the value from a foo(<param_value>) style call */ |
|
9413 if (IN_param_value == NULL) |
|
9414 IN_param_value = function_call_param_iterator.next(); |
|
9415 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9416 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9417 |
|
9418 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9419 { |
|
9420 |
|
9421 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
9422 s4o.print("("); |
|
9423 return_type_symbol->accept(*this); |
|
9424 s4o.print(")__time_to_int("); |
|
9425 IN_param_value->accept(*this); |
|
9426 s4o.print(")"); |
|
9427 return NULL; |
|
9428 |
|
9429 } |
|
9430 |
|
9431 ERROR; |
|
9432 } |
|
9433 |
|
9434 }/*function_dt_to_usint*/ |
|
9435 break; |
|
9436 |
|
9437 /**** |
|
9438 *DT_TO_UINT |
|
9439 */ |
|
9440 case function_dt_to_uint : |
|
9441 { |
|
9442 symbol_c *last_type_symbol = NULL; |
|
9443 |
|
9444 { |
|
9445 identifier_c param_name("IN"); |
|
9446 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9447 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9448 |
|
9449 /* Get the value from a foo(<param_value>) style call */ |
|
9450 if (IN_param_value == NULL) |
|
9451 IN_param_value = function_call_param_iterator.next(); |
|
9452 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9453 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9454 |
|
9455 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9456 { |
|
9457 |
|
9458 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
9459 s4o.print("("); |
|
9460 return_type_symbol->accept(*this); |
|
9461 s4o.print(")__time_to_int("); |
|
9462 IN_param_value->accept(*this); |
|
9463 s4o.print(")"); |
|
9464 return NULL; |
|
9465 |
|
9466 } |
|
9467 |
|
9468 ERROR; |
|
9469 } |
|
9470 |
|
9471 }/*function_dt_to_uint*/ |
|
9472 break; |
|
9473 |
|
9474 /**** |
|
9475 *DT_TO_UDINT |
|
9476 */ |
|
9477 case function_dt_to_udint : |
|
9478 { |
|
9479 symbol_c *last_type_symbol = NULL; |
|
9480 |
|
9481 { |
|
9482 identifier_c param_name("IN"); |
|
9483 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9484 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9485 |
|
9486 /* Get the value from a foo(<param_value>) style call */ |
|
9487 if (IN_param_value == NULL) |
|
9488 IN_param_value = function_call_param_iterator.next(); |
|
9489 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9490 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9491 |
|
9492 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9493 { |
|
9494 |
|
9495 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
9496 s4o.print("("); |
|
9497 return_type_symbol->accept(*this); |
|
9498 s4o.print(")__time_to_int("); |
|
9499 IN_param_value->accept(*this); |
|
9500 s4o.print(")"); |
|
9501 return NULL; |
|
9502 |
|
9503 } |
|
9504 |
|
9505 ERROR; |
|
9506 } |
|
9507 |
|
9508 }/*function_dt_to_udint*/ |
|
9509 break; |
|
9510 |
|
9511 /**** |
|
9512 *DT_TO_ULINT |
|
9513 */ |
|
9514 case function_dt_to_ulint : |
|
9515 { |
|
9516 symbol_c *last_type_symbol = NULL; |
|
9517 |
|
9518 { |
|
9519 identifier_c param_name("IN"); |
|
9520 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9521 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9522 |
|
9523 /* Get the value from a foo(<param_value>) style call */ |
|
9524 if (IN_param_value == NULL) |
|
9525 IN_param_value = function_call_param_iterator.next(); |
|
9526 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9527 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9528 |
|
9529 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9530 { |
|
9531 |
|
9532 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
9533 s4o.print("("); |
|
9534 return_type_symbol->accept(*this); |
|
9535 s4o.print(")__time_to_int("); |
|
9536 IN_param_value->accept(*this); |
|
9537 s4o.print(")"); |
|
9538 return NULL; |
|
9539 |
|
9540 } |
|
9541 |
|
9542 ERROR; |
|
9543 } |
|
9544 |
|
9545 }/*function_dt_to_ulint*/ |
|
9546 break; |
|
9547 |
|
9548 /**** |
|
9549 *DT_TO_REAL |
|
9550 */ |
|
9551 case function_dt_to_real : |
|
9552 { |
|
9553 symbol_c *last_type_symbol = NULL; |
|
9554 |
|
9555 { |
|
9556 identifier_c param_name("IN"); |
|
9557 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9558 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9559 |
|
9560 /* Get the value from a foo(<param_value>) style call */ |
|
9561 if (IN_param_value == NULL) |
|
9562 IN_param_value = function_call_param_iterator.next(); |
|
9563 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9564 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9565 |
|
9566 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9567 { |
|
9568 |
|
9569 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
9570 s4o.print("("); |
|
9571 return_type_symbol->accept(*this); |
|
9572 s4o.print(")__time_to_real("); |
|
9573 IN_param_value->accept(*this); |
|
9574 s4o.print(")"); |
|
9575 return NULL; |
|
9576 |
|
9577 } |
|
9578 |
|
9579 ERROR; |
|
9580 } |
|
9581 |
|
9582 }/*function_dt_to_real*/ |
|
9583 break; |
|
9584 |
|
9585 /**** |
|
9586 *DT_TO_LREAL |
|
9587 */ |
|
9588 case function_dt_to_lreal : |
|
9589 { |
|
9590 symbol_c *last_type_symbol = NULL; |
|
9591 |
|
9592 { |
|
9593 identifier_c param_name("IN"); |
|
9594 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9595 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9596 |
|
9597 /* Get the value from a foo(<param_value>) style call */ |
|
9598 if (IN_param_value == NULL) |
|
9599 IN_param_value = function_call_param_iterator.next(); |
|
9600 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9601 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9602 |
|
9603 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9604 { |
|
9605 |
|
9606 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
9607 s4o.print("("); |
|
9608 return_type_symbol->accept(*this); |
|
9609 s4o.print(")__time_to_real("); |
|
9610 IN_param_value->accept(*this); |
|
9611 s4o.print(")"); |
|
9612 return NULL; |
|
9613 |
|
9614 } |
|
9615 |
|
9616 ERROR; |
|
9617 } |
|
9618 |
|
9619 }/*function_dt_to_lreal*/ |
|
9620 break; |
|
9621 |
|
9622 /**** |
|
9623 *DT_TO_STRING |
|
9624 */ |
|
9625 case function_dt_to_string : |
|
9626 { |
|
9627 symbol_c *last_type_symbol = NULL; |
|
9628 |
|
9629 { |
|
9630 identifier_c param_name("IN"); |
|
9631 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9632 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9633 |
|
9634 /* Get the value from a foo(<param_value>) style call */ |
|
9635 if (IN_param_value == NULL) |
|
9636 IN_param_value = function_call_param_iterator.next(); |
|
9637 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9638 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9639 |
|
9640 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9641 { |
|
9642 |
|
9643 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
9644 s4o.print("("); |
|
9645 return_type_symbol->accept(*this); |
|
9646 s4o.print(")__dt_to_string("); |
|
9647 IN_param_value->accept(*this); |
|
9648 s4o.print(")"); |
|
9649 return NULL; |
|
9650 |
|
9651 } |
|
9652 |
|
9653 ERROR; |
|
9654 } |
|
9655 |
|
9656 }/*function_dt_to_string*/ |
|
9657 break; |
|
9658 |
|
9659 /**** |
|
9660 *DT_TO_BYTE |
|
9661 */ |
|
9662 case function_dt_to_byte : |
|
9663 { |
|
9664 symbol_c *last_type_symbol = NULL; |
|
9665 |
|
9666 { |
|
9667 identifier_c param_name("IN"); |
|
9668 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9669 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9670 |
|
9671 /* Get the value from a foo(<param_value>) style call */ |
|
9672 if (IN_param_value == NULL) |
|
9673 IN_param_value = function_call_param_iterator.next(); |
|
9674 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9675 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9676 |
|
9677 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9678 { |
|
9679 |
|
9680 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
9681 s4o.print("("); |
|
9682 return_type_symbol->accept(*this); |
|
9683 s4o.print(")__time_to_int("); |
|
9684 IN_param_value->accept(*this); |
|
9685 s4o.print(")"); |
|
9686 return NULL; |
|
9687 |
|
9688 } |
|
9689 |
|
9690 ERROR; |
|
9691 } |
|
9692 |
|
9693 }/*function_dt_to_byte*/ |
|
9694 break; |
|
9695 |
|
9696 /**** |
|
9697 *DT_TO_WORD |
|
9698 */ |
|
9699 case function_dt_to_word : |
|
9700 { |
|
9701 symbol_c *last_type_symbol = NULL; |
|
9702 |
|
9703 { |
|
9704 identifier_c param_name("IN"); |
|
9705 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9706 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9707 |
|
9708 /* Get the value from a foo(<param_value>) style call */ |
|
9709 if (IN_param_value == NULL) |
|
9710 IN_param_value = function_call_param_iterator.next(); |
|
9711 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9712 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9713 |
|
9714 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9715 { |
|
9716 |
|
9717 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
9718 s4o.print("("); |
|
9719 return_type_symbol->accept(*this); |
|
9720 s4o.print(")__time_to_int("); |
|
9721 IN_param_value->accept(*this); |
|
9722 s4o.print(")"); |
|
9723 return NULL; |
|
9724 |
|
9725 } |
|
9726 |
|
9727 ERROR; |
|
9728 } |
|
9729 |
|
9730 }/*function_dt_to_word*/ |
|
9731 break; |
|
9732 |
|
9733 /**** |
|
9734 *DT_TO_DWORD |
|
9735 */ |
|
9736 case function_dt_to_dword : |
|
9737 { |
|
9738 symbol_c *last_type_symbol = NULL; |
|
9739 |
|
9740 { |
|
9741 identifier_c param_name("IN"); |
|
9742 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9743 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9744 |
|
9745 /* Get the value from a foo(<param_value>) style call */ |
|
9746 if (IN_param_value == NULL) |
|
9747 IN_param_value = function_call_param_iterator.next(); |
|
9748 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9749 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9750 |
|
9751 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9752 { |
|
9753 |
|
9754 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
9755 s4o.print("("); |
|
9756 return_type_symbol->accept(*this); |
|
9757 s4o.print(")__time_to_int("); |
|
9758 IN_param_value->accept(*this); |
|
9759 s4o.print(")"); |
|
9760 return NULL; |
|
9761 |
|
9762 } |
|
9763 |
|
9764 ERROR; |
|
9765 } |
|
9766 |
|
9767 }/*function_dt_to_dword*/ |
|
9768 break; |
|
9769 |
|
9770 /**** |
|
9771 *DT_TO_LWORD |
|
9772 */ |
|
9773 case function_dt_to_lword : |
|
9774 { |
|
9775 symbol_c *last_type_symbol = NULL; |
|
9776 |
|
9777 { |
|
9778 identifier_c param_name("IN"); |
|
9779 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9780 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9781 |
|
9782 /* Get the value from a foo(<param_value>) style call */ |
|
9783 if (IN_param_value == NULL) |
|
9784 IN_param_value = function_call_param_iterator.next(); |
|
9785 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9786 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9787 |
|
9788 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
9789 { |
|
9790 |
|
9791 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
9792 s4o.print("("); |
|
9793 return_type_symbol->accept(*this); |
|
9794 s4o.print(")__time_to_int("); |
|
9795 IN_param_value->accept(*this); |
|
9796 s4o.print(")"); |
|
9797 return NULL; |
|
9798 |
|
9799 } |
|
9800 |
|
9801 ERROR; |
|
9802 } |
|
9803 |
|
9804 }/*function_dt_to_lword*/ |
|
9805 break; |
|
9806 |
|
9807 /**** |
|
9808 *STRING_TO_BOOL |
|
9809 */ |
|
9810 case function_string_to_bool : |
|
9811 { |
|
9812 symbol_c *last_type_symbol = NULL; |
|
9813 |
|
9814 { |
|
9815 identifier_c param_name("IN"); |
|
9816 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9817 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9818 |
|
9819 /* Get the value from a foo(<param_value>) style call */ |
|
9820 if (IN_param_value == NULL) |
|
9821 IN_param_value = function_call_param_iterator.next(); |
|
9822 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9823 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9824 |
|
9825 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
7606 { |
9826 { |
7607 |
9827 |
7608 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
9828 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
7609 s4o.print("("); |
9829 s4o.print("("); |
7610 return_type_symbol->accept(*this); |
9830 return_type_symbol->accept(*this); |
7611 s4o.print(")__time_to_int("); |
9831 s4o.print(")__string_to_bool("); |
7612 IN_param_value->accept(*this); |
9832 IN_param_value->accept(*this); |
7613 s4o.print(")"); |
9833 s4o.print(")"); |
7614 return NULL; |
9834 return NULL; |
7615 |
9835 |
7616 } |
9836 } |
7617 |
9837 |
7618 ERROR; |
9838 ERROR; |
7619 } |
9839 } |
7620 |
9840 |
7621 }/*function_time_to_bool*/ |
9841 }/*function_string_to_bool*/ |
7622 break; |
9842 break; |
7623 |
9843 |
7624 /**** |
9844 /**** |
7625 *TIME_TO_SINT |
9845 *STRING_TO_SINT |
7626 */ |
9846 */ |
7627 case function_time_to_sint : |
9847 case function_string_to_sint : |
7628 { |
9848 { |
7629 symbol_c *last_type_symbol = NULL; |
9849 symbol_c *last_type_symbol = NULL; |
7630 |
9850 |
7631 { |
9851 { |
7632 identifier_c param_name("IN"); |
9852 identifier_c param_name("IN"); |
7633 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
9853 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
7634 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
9854 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
7635 |
9855 |
7636 /* Get the value from a foo(<param_value>) style call */ |
9856 /* Get the value from a foo(<param_value>) style call */ |
7637 if (IN_param_value == NULL) |
9857 if (IN_param_value == NULL) |
7638 IN_param_value = function_call_param_iterator.next(); |
9858 IN_param_value = function_call_param_iterator.next(); |
7639 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
9859 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
7640 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
9860 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
7641 |
9861 |
7642 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
9862 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
7643 { |
9863 { |
7644 |
9864 |
7645 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
9865 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
7646 s4o.print("("); |
9866 s4o.print("("); |
7647 return_type_symbol->accept(*this); |
9867 return_type_symbol->accept(*this); |
7648 s4o.print(")__time_to_int("); |
9868 s4o.print(")__string_to_sint("); |
7649 IN_param_value->accept(*this); |
9869 IN_param_value->accept(*this); |
7650 s4o.print(")"); |
9870 s4o.print(")"); |
7651 return NULL; |
9871 return NULL; |
7652 |
9872 |
7653 } |
9873 } |
7654 |
9874 |
7655 ERROR; |
9875 ERROR; |
7656 } |
9876 } |
7657 |
9877 |
7658 }/*function_time_to_sint*/ |
9878 }/*function_string_to_sint*/ |
7659 break; |
9879 break; |
7660 |
9880 |
7661 /**** |
9881 /**** |
7662 *TIME_TO_INT |
9882 *STRING_TO_INT |
7663 */ |
9883 */ |
7664 case function_time_to_int : |
9884 case function_string_to_int : |
7665 { |
9885 { |
7666 symbol_c *last_type_symbol = NULL; |
9886 symbol_c *last_type_symbol = NULL; |
7667 |
9887 |
7668 { |
9888 { |
7669 identifier_c param_name("IN"); |
9889 identifier_c param_name("IN"); |
7670 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
9890 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
7671 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
9891 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
7672 |
9892 |
7673 /* Get the value from a foo(<param_value>) style call */ |
9893 /* Get the value from a foo(<param_value>) style call */ |
7674 if (IN_param_value == NULL) |
9894 if (IN_param_value == NULL) |
7675 IN_param_value = function_call_param_iterator.next(); |
9895 IN_param_value = function_call_param_iterator.next(); |
7676 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
9896 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
7677 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
9897 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
7678 |
9898 |
7679 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
9899 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
7680 { |
9900 { |
7681 |
9901 |
7682 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
9902 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
7683 s4o.print("("); |
9903 s4o.print("("); |
7684 return_type_symbol->accept(*this); |
9904 return_type_symbol->accept(*this); |
7685 s4o.print(")__time_to_int("); |
9905 s4o.print(")__string_to_sint("); |
7686 IN_param_value->accept(*this); |
9906 IN_param_value->accept(*this); |
7687 s4o.print(")"); |
9907 s4o.print(")"); |
7688 return NULL; |
9908 return NULL; |
7689 |
9909 |
7690 } |
9910 } |
7691 |
9911 |
7692 ERROR; |
9912 ERROR; |
7693 } |
9913 } |
7694 |
9914 |
7695 }/*function_time_to_int*/ |
9915 }/*function_string_to_int*/ |
7696 break; |
9916 break; |
7697 |
9917 |
7698 /**** |
9918 /**** |
7699 *TIME_TO_DINT |
9919 *STRING_TO_DINT |
7700 */ |
9920 */ |
7701 case function_time_to_dint : |
9921 case function_string_to_dint : |
7702 { |
9922 { |
7703 symbol_c *last_type_symbol = NULL; |
9923 symbol_c *last_type_symbol = NULL; |
7704 |
9924 |
7705 { |
9925 { |
7706 identifier_c param_name("IN"); |
9926 identifier_c param_name("IN"); |
7707 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
9927 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
7708 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
9928 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
7709 |
9929 |
7710 /* Get the value from a foo(<param_value>) style call */ |
9930 /* Get the value from a foo(<param_value>) style call */ |
7711 if (IN_param_value == NULL) |
9931 if (IN_param_value == NULL) |
7712 IN_param_value = function_call_param_iterator.next(); |
9932 IN_param_value = function_call_param_iterator.next(); |
7713 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
9933 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
7714 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
9934 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
7715 |
9935 |
7716 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
9936 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
7717 { |
9937 { |
7718 |
9938 |
7719 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
9939 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
7720 s4o.print("("); |
9940 s4o.print("("); |
7721 return_type_symbol->accept(*this); |
9941 return_type_symbol->accept(*this); |
7722 s4o.print(")__time_to_int("); |
9942 s4o.print(")__string_to_sint("); |
7723 IN_param_value->accept(*this); |
9943 IN_param_value->accept(*this); |
7724 s4o.print(")"); |
9944 s4o.print(")"); |
7725 return NULL; |
9945 return NULL; |
7726 |
9946 |
7727 } |
9947 } |
7728 |
9948 |
7729 ERROR; |
9949 ERROR; |
7730 } |
9950 } |
7731 |
9951 |
7732 }/*function_time_to_dint*/ |
9952 }/*function_string_to_dint*/ |
7733 break; |
9953 break; |
7734 |
9954 |
7735 /**** |
9955 /**** |
7736 *TIME_TO_LINT |
9956 *STRING_TO_LINT |
7737 */ |
9957 */ |
7738 case function_time_to_lint : |
9958 case function_string_to_lint : |
7739 { |
9959 { |
7740 symbol_c *last_type_symbol = NULL; |
9960 symbol_c *last_type_symbol = NULL; |
7741 |
9961 |
7742 { |
9962 { |
7743 identifier_c param_name("IN"); |
9963 identifier_c param_name("IN"); |
7744 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
9964 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
7745 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
9965 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
7746 |
9966 |
7747 /* Get the value from a foo(<param_value>) style call */ |
9967 /* Get the value from a foo(<param_value>) style call */ |
7748 if (IN_param_value == NULL) |
9968 if (IN_param_value == NULL) |
7749 IN_param_value = function_call_param_iterator.next(); |
9969 IN_param_value = function_call_param_iterator.next(); |
7750 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
9970 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
7751 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
9971 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
7752 |
9972 |
7753 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
9973 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
7754 { |
9974 { |
7755 |
9975 |
7756 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
9976 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
7757 s4o.print("("); |
9977 s4o.print("("); |
7758 return_type_symbol->accept(*this); |
9978 return_type_symbol->accept(*this); |
7759 s4o.print(")__time_to_int("); |
9979 s4o.print(")__string_to_sint("); |
7760 IN_param_value->accept(*this); |
9980 IN_param_value->accept(*this); |
7761 s4o.print(")"); |
9981 s4o.print(")"); |
7762 return NULL; |
9982 return NULL; |
7763 |
9983 |
7764 } |
9984 } |
7765 |
9985 |
7766 ERROR; |
9986 ERROR; |
7767 } |
9987 } |
7768 |
9988 |
7769 }/*function_time_to_lint*/ |
9989 }/*function_string_to_lint*/ |
7770 break; |
9990 break; |
7771 |
9991 |
7772 /**** |
9992 /**** |
7773 *TIME_TO_USINT |
9993 *STRING_TO_USINT |
7774 */ |
9994 */ |
7775 case function_time_to_usint : |
9995 case function_string_to_usint : |
7776 { |
9996 { |
7777 symbol_c *last_type_symbol = NULL; |
9997 symbol_c *last_type_symbol = NULL; |
7778 |
9998 |
7779 { |
9999 { |
7780 identifier_c param_name("IN"); |
10000 identifier_c param_name("IN"); |
7781 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
10001 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
7782 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
10002 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
7783 |
10003 |
7784 /* Get the value from a foo(<param_value>) style call */ |
10004 /* Get the value from a foo(<param_value>) style call */ |
7785 if (IN_param_value == NULL) |
10005 if (IN_param_value == NULL) |
7786 IN_param_value = function_call_param_iterator.next(); |
10006 IN_param_value = function_call_param_iterator.next(); |
7787 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
10007 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
7788 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
10008 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
7789 |
10009 |
7790 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
10010 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
7791 { |
10011 { |
7792 |
10012 |
7793 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
10013 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
7794 s4o.print("("); |
10014 s4o.print("("); |
7795 return_type_symbol->accept(*this); |
10015 return_type_symbol->accept(*this); |
7796 s4o.print(")__time_to_int("); |
10016 s4o.print(")__string_to_uint("); |
7797 IN_param_value->accept(*this); |
10017 IN_param_value->accept(*this); |
7798 s4o.print(")"); |
10018 s4o.print(")"); |
7799 return NULL; |
10019 return NULL; |
7800 |
10020 |
7801 } |
10021 } |
7802 |
10022 |
7803 ERROR; |
10023 ERROR; |
7804 } |
10024 } |
7805 |
10025 |
7806 }/*function_time_to_usint*/ |
10026 }/*function_string_to_usint*/ |
7807 break; |
10027 break; |
7808 |
10028 |
7809 /**** |
10029 /**** |
7810 *TIME_TO_UINT |
10030 *STRING_TO_UINT |
7811 */ |
10031 */ |
7812 case function_time_to_uint : |
10032 case function_string_to_uint : |
7813 { |
10033 { |
7814 symbol_c *last_type_symbol = NULL; |
10034 symbol_c *last_type_symbol = NULL; |
7815 |
10035 |
7816 { |
10036 { |
7817 identifier_c param_name("IN"); |
10037 identifier_c param_name("IN"); |
7818 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
10038 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
7819 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
10039 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
7820 |
10040 |
7821 /* Get the value from a foo(<param_value>) style call */ |
10041 /* Get the value from a foo(<param_value>) style call */ |
7822 if (IN_param_value == NULL) |
10042 if (IN_param_value == NULL) |
7823 IN_param_value = function_call_param_iterator.next(); |
10043 IN_param_value = function_call_param_iterator.next(); |
7824 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
10044 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
7825 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
10045 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
7826 |
10046 |
7827 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
10047 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
7828 { |
10048 { |
7829 |
10049 |
7830 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
10050 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
7831 s4o.print("("); |
10051 s4o.print("("); |
7832 return_type_symbol->accept(*this); |
10052 return_type_symbol->accept(*this); |
7833 s4o.print(")__time_to_int("); |
10053 s4o.print(")__string_to_uint("); |
7834 IN_param_value->accept(*this); |
10054 IN_param_value->accept(*this); |
7835 s4o.print(")"); |
10055 s4o.print(")"); |
7836 return NULL; |
10056 return NULL; |
7837 |
10057 |
7838 } |
10058 } |
7839 |
10059 |
7840 ERROR; |
10060 ERROR; |
7841 } |
10061 } |
7842 |
10062 |
7843 }/*function_time_to_uint*/ |
10063 }/*function_string_to_uint*/ |
7844 break; |
10064 break; |
7845 |
10065 |
7846 /**** |
10066 /**** |
7847 *TIME_TO_UDINT |
10067 *STRING_TO_UDINT |
7848 */ |
10068 */ |
7849 case function_time_to_udint : |
10069 case function_string_to_udint : |
7850 { |
10070 { |
7851 symbol_c *last_type_symbol = NULL; |
10071 symbol_c *last_type_symbol = NULL; |
7852 |
10072 |
7853 { |
10073 { |
7854 identifier_c param_name("IN"); |
10074 identifier_c param_name("IN"); |
7855 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
10075 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
7856 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
10076 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
7857 |
10077 |
7858 /* Get the value from a foo(<param_value>) style call */ |
10078 /* Get the value from a foo(<param_value>) style call */ |
7859 if (IN_param_value == NULL) |
10079 if (IN_param_value == NULL) |
7860 IN_param_value = function_call_param_iterator.next(); |
10080 IN_param_value = function_call_param_iterator.next(); |
7861 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
10081 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
7862 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
10082 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
7863 |
10083 |
7864 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
10084 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
7865 { |
10085 { |
7866 |
10086 |
7867 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
10087 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
7868 s4o.print("("); |
10088 s4o.print("("); |
7869 return_type_symbol->accept(*this); |
10089 return_type_symbol->accept(*this); |
7870 s4o.print(")__time_to_int("); |
10090 s4o.print(")__string_to_uint("); |
7871 IN_param_value->accept(*this); |
10091 IN_param_value->accept(*this); |
7872 s4o.print(")"); |
10092 s4o.print(")"); |
7873 return NULL; |
10093 return NULL; |
7874 |
10094 |
7875 } |
10095 } |
7876 |
10096 |
7877 ERROR; |
10097 ERROR; |
7878 } |
10098 } |
7879 |
10099 |
7880 }/*function_time_to_udint*/ |
10100 }/*function_string_to_udint*/ |
7881 break; |
10101 break; |
7882 |
10102 |
7883 /**** |
10103 /**** |
7884 *TIME_TO_ULINT |
10104 *STRING_TO_ULINT |
7885 */ |
10105 */ |
7886 case function_time_to_ulint : |
10106 case function_string_to_ulint : |
7887 { |
10107 { |
7888 symbol_c *last_type_symbol = NULL; |
10108 symbol_c *last_type_symbol = NULL; |
7889 |
10109 |
7890 { |
10110 { |
7891 identifier_c param_name("IN"); |
10111 identifier_c param_name("IN"); |
7892 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
10112 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
7893 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
10113 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
7894 |
10114 |
7895 /* Get the value from a foo(<param_value>) style call */ |
10115 /* Get the value from a foo(<param_value>) style call */ |
7896 if (IN_param_value == NULL) |
10116 if (IN_param_value == NULL) |
7897 IN_param_value = function_call_param_iterator.next(); |
10117 IN_param_value = function_call_param_iterator.next(); |
7898 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
10118 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
7899 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
10119 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
7900 |
10120 |
7901 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
10121 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
7902 { |
10122 { |
7903 |
10123 |
7904 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
10124 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
7905 s4o.print("("); |
10125 s4o.print("("); |
7906 return_type_symbol->accept(*this); |
10126 return_type_symbol->accept(*this); |
7907 s4o.print(")__time_to_int("); |
10127 s4o.print(")__string_to_uint("); |
7908 IN_param_value->accept(*this); |
10128 IN_param_value->accept(*this); |
7909 s4o.print(")"); |
10129 s4o.print(")"); |
7910 return NULL; |
10130 return NULL; |
7911 |
10131 |
7912 } |
10132 } |
7913 |
10133 |
7914 ERROR; |
10134 ERROR; |
7915 } |
10135 } |
7916 |
10136 |
7917 }/*function_time_to_ulint*/ |
10137 }/*function_string_to_ulint*/ |
7918 break; |
10138 break; |
7919 |
10139 |
7920 /**** |
10140 /**** |
7921 *TIME_TO_REAL |
10141 *STRING_TO_REAL |
7922 */ |
10142 */ |
7923 case function_time_to_real : |
10143 case function_string_to_real : |
7924 { |
10144 { |
7925 symbol_c *last_type_symbol = NULL; |
10145 symbol_c *last_type_symbol = NULL; |
7926 |
10146 |
7927 { |
10147 { |
7928 identifier_c param_name("IN"); |
10148 identifier_c param_name("IN"); |
7929 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
10149 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
7930 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
10150 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
7931 |
10151 |
7932 /* Get the value from a foo(<param_value>) style call */ |
10152 /* Get the value from a foo(<param_value>) style call */ |
7933 if (IN_param_value == NULL) |
10153 if (IN_param_value == NULL) |
7934 IN_param_value = function_call_param_iterator.next(); |
10154 IN_param_value = function_call_param_iterator.next(); |
7935 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
10155 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
7936 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
10156 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
7937 |
10157 |
7938 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
10158 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
7939 { |
10159 { |
7940 |
10160 |
7941 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
10161 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
7942 s4o.print("("); |
10162 s4o.print("("); |
7943 return_type_symbol->accept(*this); |
10163 return_type_symbol->accept(*this); |
7944 s4o.print(")__time_to_real("); |
10164 s4o.print(")__string_to_real("); |
7945 IN_param_value->accept(*this); |
10165 IN_param_value->accept(*this); |
7946 s4o.print(")"); |
10166 s4o.print(")"); |
7947 return NULL; |
10167 return NULL; |
7948 |
10168 |
7949 } |
10169 } |
7950 |
10170 |
7951 ERROR; |
10171 ERROR; |
7952 } |
10172 } |
7953 |
10173 |
7954 }/*function_time_to_real*/ |
10174 }/*function_string_to_real*/ |
7955 break; |
10175 break; |
7956 |
10176 |
7957 /**** |
10177 /**** |
7958 *TIME_TO_LREAL |
10178 *STRING_TO_LREAL |
7959 */ |
10179 */ |
7960 case function_time_to_lreal : |
10180 case function_string_to_lreal : |
7961 { |
10181 { |
7962 symbol_c *last_type_symbol = NULL; |
10182 symbol_c *last_type_symbol = NULL; |
7963 |
10183 |
7964 { |
10184 { |
7965 identifier_c param_name("IN"); |
10185 identifier_c param_name("IN"); |
7966 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
10186 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
7967 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
10187 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
7968 |
10188 |
7969 /* Get the value from a foo(<param_value>) style call */ |
10189 /* Get the value from a foo(<param_value>) style call */ |
7970 if (IN_param_value == NULL) |
10190 if (IN_param_value == NULL) |
7971 IN_param_value = function_call_param_iterator.next(); |
10191 IN_param_value = function_call_param_iterator.next(); |
7972 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
10192 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
7973 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
10193 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
7974 |
10194 |
7975 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
10195 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
7976 { |
10196 { |
7977 |
10197 |
7978 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
10198 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
7979 s4o.print("("); |
10199 s4o.print("("); |
7980 return_type_symbol->accept(*this); |
10200 return_type_symbol->accept(*this); |
7981 s4o.print(")__time_to_real("); |
10201 s4o.print(")__string_to_real("); |
7982 IN_param_value->accept(*this); |
10202 IN_param_value->accept(*this); |
7983 s4o.print(")"); |
10203 s4o.print(")"); |
7984 return NULL; |
10204 return NULL; |
7985 |
10205 |
7986 } |
10206 } |
7987 |
10207 |
7988 ERROR; |
10208 ERROR; |
7989 } |
10209 } |
7990 |
10210 |
7991 }/*function_time_to_lreal*/ |
10211 }/*function_string_to_lreal*/ |
7992 break; |
10212 break; |
7993 |
10213 |
7994 /**** |
10214 /**** |
7995 *TIME_TO_STRING |
10215 *STRING_TO_TIME |
7996 */ |
10216 */ |
7997 case function_time_to_string : |
10217 case function_string_to_time : |
7998 { |
10218 { |
7999 symbol_c *last_type_symbol = NULL; |
10219 symbol_c *last_type_symbol = NULL; |
8000 |
10220 |
8001 { |
10221 { |
8002 identifier_c param_name("IN"); |
10222 identifier_c param_name("IN"); |
8003 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
10223 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8004 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
10224 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8005 |
10225 |
8006 /* Get the value from a foo(<param_value>) style call */ |
10226 /* Get the value from a foo(<param_value>) style call */ |
8007 if (IN_param_value == NULL) |
10227 if (IN_param_value == NULL) |
8008 IN_param_value = function_call_param_iterator.next(); |
10228 IN_param_value = function_call_param_iterator.next(); |
8009 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
10229 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8010 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
10230 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8011 |
10231 |
8012 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
10232 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
10233 { |
|
10234 |
|
10235 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
10236 s4o.print("("); |
|
10237 return_type_symbol->accept(*this); |
|
10238 s4o.print(")__string_to_time("); |
|
10239 IN_param_value->accept(*this); |
|
10240 s4o.print(")"); |
|
10241 return NULL; |
|
10242 |
|
10243 } |
|
10244 |
|
10245 ERROR; |
|
10246 } |
|
10247 |
|
10248 }/*function_string_to_time*/ |
|
10249 break; |
|
10250 |
|
10251 /**** |
|
10252 *STRING_TO_DATE |
|
10253 */ |
|
10254 case function_string_to_date : |
|
10255 { |
|
10256 symbol_c *last_type_symbol = NULL; |
|
10257 |
|
10258 { |
|
10259 identifier_c param_name("IN"); |
|
10260 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10261 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10262 |
|
10263 /* Get the value from a foo(<param_value>) style call */ |
|
10264 if (IN_param_value == NULL) |
|
10265 IN_param_value = function_call_param_iterator.next(); |
|
10266 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10267 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10268 |
|
10269 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
10270 { |
|
10271 |
|
10272 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
10273 s4o.print("("); |
|
10274 return_type_symbol->accept(*this); |
|
10275 s4o.print(")__string_to_time("); |
|
10276 IN_param_value->accept(*this); |
|
10277 s4o.print(")"); |
|
10278 return NULL; |
|
10279 |
|
10280 } |
|
10281 |
|
10282 ERROR; |
|
10283 } |
|
10284 |
|
10285 }/*function_string_to_date*/ |
|
10286 break; |
|
10287 |
|
10288 /**** |
|
10289 *STRING_TO_TOD |
|
10290 */ |
|
10291 case function_string_to_tod : |
|
10292 { |
|
10293 symbol_c *last_type_symbol = NULL; |
|
10294 |
|
10295 { |
|
10296 identifier_c param_name("IN"); |
|
10297 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10298 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10299 |
|
10300 /* Get the value from a foo(<param_value>) style call */ |
|
10301 if (IN_param_value == NULL) |
|
10302 IN_param_value = function_call_param_iterator.next(); |
|
10303 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10304 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10305 |
|
10306 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
10307 { |
|
10308 |
|
10309 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
10310 s4o.print("("); |
|
10311 return_type_symbol->accept(*this); |
|
10312 s4o.print(")__string_to_time("); |
|
10313 IN_param_value->accept(*this); |
|
10314 s4o.print(")"); |
|
10315 return NULL; |
|
10316 |
|
10317 } |
|
10318 |
|
10319 ERROR; |
|
10320 } |
|
10321 |
|
10322 }/*function_string_to_tod*/ |
|
10323 break; |
|
10324 |
|
10325 /**** |
|
10326 *STRING_TO_DT |
|
10327 */ |
|
10328 case function_string_to_dt : |
|
10329 { |
|
10330 symbol_c *last_type_symbol = NULL; |
|
10331 |
|
10332 { |
|
10333 identifier_c param_name("IN"); |
|
10334 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10335 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10336 |
|
10337 /* Get the value from a foo(<param_value>) style call */ |
|
10338 if (IN_param_value == NULL) |
|
10339 IN_param_value = function_call_param_iterator.next(); |
|
10340 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10341 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10342 |
|
10343 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
10344 { |
|
10345 |
|
10346 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
10347 s4o.print("("); |
|
10348 return_type_symbol->accept(*this); |
|
10349 s4o.print(")__string_to_time("); |
|
10350 IN_param_value->accept(*this); |
|
10351 s4o.print(")"); |
|
10352 return NULL; |
|
10353 |
|
10354 } |
|
10355 |
|
10356 ERROR; |
|
10357 } |
|
10358 |
|
10359 }/*function_string_to_dt*/ |
|
10360 break; |
|
10361 |
|
10362 /**** |
|
10363 *STRING_TO_BYTE |
|
10364 */ |
|
10365 case function_string_to_byte : |
|
10366 { |
|
10367 symbol_c *last_type_symbol = NULL; |
|
10368 |
|
10369 { |
|
10370 identifier_c param_name("IN"); |
|
10371 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10372 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10373 |
|
10374 /* Get the value from a foo(<param_value>) style call */ |
|
10375 if (IN_param_value == NULL) |
|
10376 IN_param_value = function_call_param_iterator.next(); |
|
10377 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10378 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10379 |
|
10380 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
10381 { |
|
10382 |
|
10383 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
10384 s4o.print("("); |
|
10385 return_type_symbol->accept(*this); |
|
10386 s4o.print(")__string_to_bit("); |
|
10387 IN_param_value->accept(*this); |
|
10388 s4o.print(")"); |
|
10389 return NULL; |
|
10390 |
|
10391 } |
|
10392 |
|
10393 ERROR; |
|
10394 } |
|
10395 |
|
10396 }/*function_string_to_byte*/ |
|
10397 break; |
|
10398 |
|
10399 /**** |
|
10400 *STRING_TO_WORD |
|
10401 */ |
|
10402 case function_string_to_word : |
|
10403 { |
|
10404 symbol_c *last_type_symbol = NULL; |
|
10405 |
|
10406 { |
|
10407 identifier_c param_name("IN"); |
|
10408 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10409 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10410 |
|
10411 /* Get the value from a foo(<param_value>) style call */ |
|
10412 if (IN_param_value == NULL) |
|
10413 IN_param_value = function_call_param_iterator.next(); |
|
10414 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10415 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10416 |
|
10417 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
10418 { |
|
10419 |
|
10420 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
10421 s4o.print("("); |
|
10422 return_type_symbol->accept(*this); |
|
10423 s4o.print(")__string_to_bit("); |
|
10424 IN_param_value->accept(*this); |
|
10425 s4o.print(")"); |
|
10426 return NULL; |
|
10427 |
|
10428 } |
|
10429 |
|
10430 ERROR; |
|
10431 } |
|
10432 |
|
10433 }/*function_string_to_word*/ |
|
10434 break; |
|
10435 |
|
10436 /**** |
|
10437 *STRING_TO_DWORD |
|
10438 */ |
|
10439 case function_string_to_dword : |
|
10440 { |
|
10441 symbol_c *last_type_symbol = NULL; |
|
10442 |
|
10443 { |
|
10444 identifier_c param_name("IN"); |
|
10445 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10446 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10447 |
|
10448 /* Get the value from a foo(<param_value>) style call */ |
|
10449 if (IN_param_value == NULL) |
|
10450 IN_param_value = function_call_param_iterator.next(); |
|
10451 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10452 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10453 |
|
10454 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
10455 { |
|
10456 |
|
10457 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
10458 s4o.print("("); |
|
10459 return_type_symbol->accept(*this); |
|
10460 s4o.print(")__string_to_bit("); |
|
10461 IN_param_value->accept(*this); |
|
10462 s4o.print(")"); |
|
10463 return NULL; |
|
10464 |
|
10465 } |
|
10466 |
|
10467 ERROR; |
|
10468 } |
|
10469 |
|
10470 }/*function_string_to_dword*/ |
|
10471 break; |
|
10472 |
|
10473 /**** |
|
10474 *STRING_TO_LWORD |
|
10475 */ |
|
10476 case function_string_to_lword : |
|
10477 { |
|
10478 symbol_c *last_type_symbol = NULL; |
|
10479 |
|
10480 { |
|
10481 identifier_c param_name("IN"); |
|
10482 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10483 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10484 |
|
10485 /* Get the value from a foo(<param_value>) style call */ |
|
10486 if (IN_param_value == NULL) |
|
10487 IN_param_value = function_call_param_iterator.next(); |
|
10488 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10489 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10490 |
|
10491 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
10492 { |
|
10493 |
|
10494 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
10495 s4o.print("("); |
|
10496 return_type_symbol->accept(*this); |
|
10497 s4o.print(")__string_to_bit("); |
|
10498 IN_param_value->accept(*this); |
|
10499 s4o.print(")"); |
|
10500 return NULL; |
|
10501 |
|
10502 } |
|
10503 |
|
10504 ERROR; |
|
10505 } |
|
10506 |
|
10507 }/*function_string_to_lword*/ |
|
10508 break; |
|
10509 |
|
10510 /**** |
|
10511 *BYTE_TO_BOOL |
|
10512 */ |
|
10513 case function_byte_to_bool : |
|
10514 { |
|
10515 symbol_c *last_type_symbol = NULL; |
|
10516 |
|
10517 { |
|
10518 identifier_c param_name("IN"); |
|
10519 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10520 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10521 |
|
10522 /* Get the value from a foo(<param_value>) style call */ |
|
10523 if (IN_param_value == NULL) |
|
10524 IN_param_value = function_call_param_iterator.next(); |
|
10525 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10526 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10527 |
|
10528 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
10529 { |
|
10530 |
|
10531 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
10532 s4o.print("("); |
|
10533 return_type_symbol->accept(*this); |
|
10534 s4o.print(")"); |
|
10535 IN_param_value->accept(*this); |
|
10536 return NULL; |
|
10537 |
|
10538 } |
|
10539 |
|
10540 ERROR; |
|
10541 } |
|
10542 |
|
10543 }/*function_byte_to_bool*/ |
|
10544 break; |
|
10545 |
|
10546 /**** |
|
10547 *BYTE_TO_SINT |
|
10548 */ |
|
10549 case function_byte_to_sint : |
|
10550 { |
|
10551 symbol_c *last_type_symbol = NULL; |
|
10552 |
|
10553 { |
|
10554 identifier_c param_name("IN"); |
|
10555 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10556 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10557 |
|
10558 /* Get the value from a foo(<param_value>) style call */ |
|
10559 if (IN_param_value == NULL) |
|
10560 IN_param_value = function_call_param_iterator.next(); |
|
10561 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10562 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10563 |
|
10564 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
10565 { |
|
10566 |
|
10567 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
10568 s4o.print("("); |
|
10569 return_type_symbol->accept(*this); |
|
10570 s4o.print(")"); |
|
10571 IN_param_value->accept(*this); |
|
10572 return NULL; |
|
10573 |
|
10574 } |
|
10575 |
|
10576 ERROR; |
|
10577 } |
|
10578 |
|
10579 }/*function_byte_to_sint*/ |
|
10580 break; |
|
10581 |
|
10582 /**** |
|
10583 *BYTE_TO_INT |
|
10584 */ |
|
10585 case function_byte_to_int : |
|
10586 { |
|
10587 symbol_c *last_type_symbol = NULL; |
|
10588 |
|
10589 { |
|
10590 identifier_c param_name("IN"); |
|
10591 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10592 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10593 |
|
10594 /* Get the value from a foo(<param_value>) style call */ |
|
10595 if (IN_param_value == NULL) |
|
10596 IN_param_value = function_call_param_iterator.next(); |
|
10597 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10598 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10599 |
|
10600 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
10601 { |
|
10602 |
|
10603 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
10604 s4o.print("("); |
|
10605 return_type_symbol->accept(*this); |
|
10606 s4o.print(")"); |
|
10607 IN_param_value->accept(*this); |
|
10608 return NULL; |
|
10609 |
|
10610 } |
|
10611 |
|
10612 ERROR; |
|
10613 } |
|
10614 |
|
10615 }/*function_byte_to_int*/ |
|
10616 break; |
|
10617 |
|
10618 /**** |
|
10619 *BYTE_TO_DINT |
|
10620 */ |
|
10621 case function_byte_to_dint : |
|
10622 { |
|
10623 symbol_c *last_type_symbol = NULL; |
|
10624 |
|
10625 { |
|
10626 identifier_c param_name("IN"); |
|
10627 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10628 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10629 |
|
10630 /* Get the value from a foo(<param_value>) style call */ |
|
10631 if (IN_param_value == NULL) |
|
10632 IN_param_value = function_call_param_iterator.next(); |
|
10633 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10634 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10635 |
|
10636 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
10637 { |
|
10638 |
|
10639 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
10640 s4o.print("("); |
|
10641 return_type_symbol->accept(*this); |
|
10642 s4o.print(")"); |
|
10643 IN_param_value->accept(*this); |
|
10644 return NULL; |
|
10645 |
|
10646 } |
|
10647 |
|
10648 ERROR; |
|
10649 } |
|
10650 |
|
10651 }/*function_byte_to_dint*/ |
|
10652 break; |
|
10653 |
|
10654 /**** |
|
10655 *BYTE_TO_LINT |
|
10656 */ |
|
10657 case function_byte_to_lint : |
|
10658 { |
|
10659 symbol_c *last_type_symbol = NULL; |
|
10660 |
|
10661 { |
|
10662 identifier_c param_name("IN"); |
|
10663 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10664 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10665 |
|
10666 /* Get the value from a foo(<param_value>) style call */ |
|
10667 if (IN_param_value == NULL) |
|
10668 IN_param_value = function_call_param_iterator.next(); |
|
10669 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10670 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10671 |
|
10672 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
10673 { |
|
10674 |
|
10675 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
10676 s4o.print("("); |
|
10677 return_type_symbol->accept(*this); |
|
10678 s4o.print(")"); |
|
10679 IN_param_value->accept(*this); |
|
10680 return NULL; |
|
10681 |
|
10682 } |
|
10683 |
|
10684 ERROR; |
|
10685 } |
|
10686 |
|
10687 }/*function_byte_to_lint*/ |
|
10688 break; |
|
10689 |
|
10690 /**** |
|
10691 *BYTE_TO_USINT |
|
10692 */ |
|
10693 case function_byte_to_usint : |
|
10694 { |
|
10695 symbol_c *last_type_symbol = NULL; |
|
10696 |
|
10697 { |
|
10698 identifier_c param_name("IN"); |
|
10699 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10700 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10701 |
|
10702 /* Get the value from a foo(<param_value>) style call */ |
|
10703 if (IN_param_value == NULL) |
|
10704 IN_param_value = function_call_param_iterator.next(); |
|
10705 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10706 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10707 |
|
10708 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
10709 { |
|
10710 |
|
10711 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
10712 s4o.print("("); |
|
10713 return_type_symbol->accept(*this); |
|
10714 s4o.print(")"); |
|
10715 IN_param_value->accept(*this); |
|
10716 return NULL; |
|
10717 |
|
10718 } |
|
10719 |
|
10720 ERROR; |
|
10721 } |
|
10722 |
|
10723 }/*function_byte_to_usint*/ |
|
10724 break; |
|
10725 |
|
10726 /**** |
|
10727 *BYTE_TO_UINT |
|
10728 */ |
|
10729 case function_byte_to_uint : |
|
10730 { |
|
10731 symbol_c *last_type_symbol = NULL; |
|
10732 |
|
10733 { |
|
10734 identifier_c param_name("IN"); |
|
10735 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10736 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10737 |
|
10738 /* Get the value from a foo(<param_value>) style call */ |
|
10739 if (IN_param_value == NULL) |
|
10740 IN_param_value = function_call_param_iterator.next(); |
|
10741 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10742 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10743 |
|
10744 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
10745 { |
|
10746 |
|
10747 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
10748 s4o.print("("); |
|
10749 return_type_symbol->accept(*this); |
|
10750 s4o.print(")"); |
|
10751 IN_param_value->accept(*this); |
|
10752 return NULL; |
|
10753 |
|
10754 } |
|
10755 |
|
10756 ERROR; |
|
10757 } |
|
10758 |
|
10759 }/*function_byte_to_uint*/ |
|
10760 break; |
|
10761 |
|
10762 /**** |
|
10763 *BYTE_TO_UDINT |
|
10764 */ |
|
10765 case function_byte_to_udint : |
|
10766 { |
|
10767 symbol_c *last_type_symbol = NULL; |
|
10768 |
|
10769 { |
|
10770 identifier_c param_name("IN"); |
|
10771 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10772 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10773 |
|
10774 /* Get the value from a foo(<param_value>) style call */ |
|
10775 if (IN_param_value == NULL) |
|
10776 IN_param_value = function_call_param_iterator.next(); |
|
10777 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10778 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10779 |
|
10780 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
10781 { |
|
10782 |
|
10783 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
10784 s4o.print("("); |
|
10785 return_type_symbol->accept(*this); |
|
10786 s4o.print(")"); |
|
10787 IN_param_value->accept(*this); |
|
10788 return NULL; |
|
10789 |
|
10790 } |
|
10791 |
|
10792 ERROR; |
|
10793 } |
|
10794 |
|
10795 }/*function_byte_to_udint*/ |
|
10796 break; |
|
10797 |
|
10798 /**** |
|
10799 *BYTE_TO_ULINT |
|
10800 */ |
|
10801 case function_byte_to_ulint : |
|
10802 { |
|
10803 symbol_c *last_type_symbol = NULL; |
|
10804 |
|
10805 { |
|
10806 identifier_c param_name("IN"); |
|
10807 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10808 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10809 |
|
10810 /* Get the value from a foo(<param_value>) style call */ |
|
10811 if (IN_param_value == NULL) |
|
10812 IN_param_value = function_call_param_iterator.next(); |
|
10813 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10814 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10815 |
|
10816 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
10817 { |
|
10818 |
|
10819 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
10820 s4o.print("("); |
|
10821 return_type_symbol->accept(*this); |
|
10822 s4o.print(")"); |
|
10823 IN_param_value->accept(*this); |
|
10824 return NULL; |
|
10825 |
|
10826 } |
|
10827 |
|
10828 ERROR; |
|
10829 } |
|
10830 |
|
10831 }/*function_byte_to_ulint*/ |
|
10832 break; |
|
10833 |
|
10834 /**** |
|
10835 *BYTE_TO_REAL |
|
10836 */ |
|
10837 case function_byte_to_real : |
|
10838 { |
|
10839 symbol_c *last_type_symbol = NULL; |
|
10840 |
|
10841 { |
|
10842 identifier_c param_name("IN"); |
|
10843 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10844 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10845 |
|
10846 /* Get the value from a foo(<param_value>) style call */ |
|
10847 if (IN_param_value == NULL) |
|
10848 IN_param_value = function_call_param_iterator.next(); |
|
10849 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10850 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10851 |
|
10852 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
10853 { |
|
10854 |
|
10855 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
10856 s4o.print("("); |
|
10857 return_type_symbol->accept(*this); |
|
10858 s4o.print(")"); |
|
10859 IN_param_value->accept(*this); |
|
10860 return NULL; |
|
10861 |
|
10862 } |
|
10863 |
|
10864 ERROR; |
|
10865 } |
|
10866 |
|
10867 }/*function_byte_to_real*/ |
|
10868 break; |
|
10869 |
|
10870 /**** |
|
10871 *BYTE_TO_LREAL |
|
10872 */ |
|
10873 case function_byte_to_lreal : |
|
10874 { |
|
10875 symbol_c *last_type_symbol = NULL; |
|
10876 |
|
10877 { |
|
10878 identifier_c param_name("IN"); |
|
10879 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10880 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10881 |
|
10882 /* Get the value from a foo(<param_value>) style call */ |
|
10883 if (IN_param_value == NULL) |
|
10884 IN_param_value = function_call_param_iterator.next(); |
|
10885 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10886 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10887 |
|
10888 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
10889 { |
|
10890 |
|
10891 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
10892 s4o.print("("); |
|
10893 return_type_symbol->accept(*this); |
|
10894 s4o.print(")"); |
|
10895 IN_param_value->accept(*this); |
|
10896 return NULL; |
|
10897 |
|
10898 } |
|
10899 |
|
10900 ERROR; |
|
10901 } |
|
10902 |
|
10903 }/*function_byte_to_lreal*/ |
|
10904 break; |
|
10905 |
|
10906 /**** |
|
10907 *BYTE_TO_TIME |
|
10908 */ |
|
10909 case function_byte_to_time : |
|
10910 { |
|
10911 symbol_c *last_type_symbol = NULL; |
|
10912 |
|
10913 { |
|
10914 identifier_c param_name("IN"); |
|
10915 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10916 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10917 |
|
10918 /* Get the value from a foo(<param_value>) style call */ |
|
10919 if (IN_param_value == NULL) |
|
10920 IN_param_value = function_call_param_iterator.next(); |
|
10921 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10922 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10923 |
|
10924 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
10925 { |
|
10926 |
|
10927 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
10928 s4o.print("("); |
|
10929 return_type_symbol->accept(*this); |
|
10930 s4o.print(")__int_to_time("); |
|
10931 IN_param_value->accept(*this); |
|
10932 s4o.print(")"); |
|
10933 return NULL; |
|
10934 |
|
10935 } |
|
10936 |
|
10937 ERROR; |
|
10938 } |
|
10939 |
|
10940 }/*function_byte_to_time*/ |
|
10941 break; |
|
10942 |
|
10943 /**** |
|
10944 *BYTE_TO_DATE |
|
10945 */ |
|
10946 case function_byte_to_date : |
|
10947 { |
|
10948 symbol_c *last_type_symbol = NULL; |
|
10949 |
|
10950 { |
|
10951 identifier_c param_name("IN"); |
|
10952 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10953 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10954 |
|
10955 /* Get the value from a foo(<param_value>) style call */ |
|
10956 if (IN_param_value == NULL) |
|
10957 IN_param_value = function_call_param_iterator.next(); |
|
10958 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10959 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10960 |
|
10961 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
10962 { |
|
10963 |
|
10964 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
10965 s4o.print("("); |
|
10966 return_type_symbol->accept(*this); |
|
10967 s4o.print(")__int_to_time("); |
|
10968 IN_param_value->accept(*this); |
|
10969 s4o.print(")"); |
|
10970 return NULL; |
|
10971 |
|
10972 } |
|
10973 |
|
10974 ERROR; |
|
10975 } |
|
10976 |
|
10977 }/*function_byte_to_date*/ |
|
10978 break; |
|
10979 |
|
10980 /**** |
|
10981 *BYTE_TO_TOD |
|
10982 */ |
|
10983 case function_byte_to_tod : |
|
10984 { |
|
10985 symbol_c *last_type_symbol = NULL; |
|
10986 |
|
10987 { |
|
10988 identifier_c param_name("IN"); |
|
10989 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10990 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10991 |
|
10992 /* Get the value from a foo(<param_value>) style call */ |
|
10993 if (IN_param_value == NULL) |
|
10994 IN_param_value = function_call_param_iterator.next(); |
|
10995 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10996 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10997 |
|
10998 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
10999 { |
|
11000 |
|
11001 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
11002 s4o.print("("); |
|
11003 return_type_symbol->accept(*this); |
|
11004 s4o.print(")__int_to_time("); |
|
11005 IN_param_value->accept(*this); |
|
11006 s4o.print(")"); |
|
11007 return NULL; |
|
11008 |
|
11009 } |
|
11010 |
|
11011 ERROR; |
|
11012 } |
|
11013 |
|
11014 }/*function_byte_to_tod*/ |
|
11015 break; |
|
11016 |
|
11017 /**** |
|
11018 *BYTE_TO_DT |
|
11019 */ |
|
11020 case function_byte_to_dt : |
|
11021 { |
|
11022 symbol_c *last_type_symbol = NULL; |
|
11023 |
|
11024 { |
|
11025 identifier_c param_name("IN"); |
|
11026 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11027 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11028 |
|
11029 /* Get the value from a foo(<param_value>) style call */ |
|
11030 if (IN_param_value == NULL) |
|
11031 IN_param_value = function_call_param_iterator.next(); |
|
11032 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11033 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11034 |
|
11035 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
11036 { |
|
11037 |
|
11038 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
11039 s4o.print("("); |
|
11040 return_type_symbol->accept(*this); |
|
11041 s4o.print(")__int_to_time("); |
|
11042 IN_param_value->accept(*this); |
|
11043 s4o.print(")"); |
|
11044 return NULL; |
|
11045 |
|
11046 } |
|
11047 |
|
11048 ERROR; |
|
11049 } |
|
11050 |
|
11051 }/*function_byte_to_dt*/ |
|
11052 break; |
|
11053 |
|
11054 /**** |
|
11055 *BYTE_TO_STRING |
|
11056 */ |
|
11057 case function_byte_to_string : |
|
11058 { |
|
11059 symbol_c *last_type_symbol = NULL; |
|
11060 |
|
11061 { |
|
11062 identifier_c param_name("IN"); |
|
11063 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11064 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11065 |
|
11066 /* Get the value from a foo(<param_value>) style call */ |
|
11067 if (IN_param_value == NULL) |
|
11068 IN_param_value = function_call_param_iterator.next(); |
|
11069 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11070 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11071 |
|
11072 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
8013 { |
11073 { |
8014 |
11074 |
8015 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
11075 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
8016 s4o.print("("); |
11076 s4o.print("("); |
8017 return_type_symbol->accept(*this); |
11077 return_type_symbol->accept(*this); |
8018 s4o.print(")__time_to_string("); |
11078 s4o.print(")__bit_to_string("); |
8019 IN_param_value->accept(*this); |
11079 IN_param_value->accept(*this); |
8020 s4o.print(")"); |
11080 s4o.print(")"); |
8021 return NULL; |
11081 return NULL; |
8022 |
11082 |
8023 } |
11083 } |
8024 |
11084 |
8025 ERROR; |
11085 ERROR; |
8026 } |
11086 } |
8027 |
11087 |
8028 }/*function_time_to_string*/ |
11088 }/*function_byte_to_string*/ |
8029 break; |
11089 break; |
8030 |
11090 |
8031 /**** |
11091 /**** |
8032 *TIME_TO_BYTE |
11092 *BYTE_TO_WORD |
8033 */ |
11093 */ |
8034 case function_time_to_byte : |
11094 case function_byte_to_word : |
8035 { |
11095 { |
8036 symbol_c *last_type_symbol = NULL; |
11096 symbol_c *last_type_symbol = NULL; |
8037 |
11097 |
8038 { |
11098 { |
8039 identifier_c param_name("IN"); |
11099 identifier_c param_name("IN"); |
8040 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
11100 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8041 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
11101 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8042 |
11102 |
8043 /* Get the value from a foo(<param_value>) style call */ |
11103 /* Get the value from a foo(<param_value>) style call */ |
8044 if (IN_param_value == NULL) |
11104 if (IN_param_value == NULL) |
8045 IN_param_value = function_call_param_iterator.next(); |
11105 IN_param_value = function_call_param_iterator.next(); |
8046 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
11106 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8047 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
11107 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8048 |
11108 |
8049 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
11109 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
11110 { |
|
11111 |
|
11112 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
11113 s4o.print("("); |
|
11114 return_type_symbol->accept(*this); |
|
11115 s4o.print(")"); |
|
11116 IN_param_value->accept(*this); |
|
11117 return NULL; |
|
11118 |
|
11119 } |
|
11120 |
|
11121 ERROR; |
|
11122 } |
|
11123 |
|
11124 }/*function_byte_to_word*/ |
|
11125 break; |
|
11126 |
|
11127 /**** |
|
11128 *BYTE_TO_DWORD |
|
11129 */ |
|
11130 case function_byte_to_dword : |
|
11131 { |
|
11132 symbol_c *last_type_symbol = NULL; |
|
11133 |
|
11134 { |
|
11135 identifier_c param_name("IN"); |
|
11136 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11137 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11138 |
|
11139 /* Get the value from a foo(<param_value>) style call */ |
|
11140 if (IN_param_value == NULL) |
|
11141 IN_param_value = function_call_param_iterator.next(); |
|
11142 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11143 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11144 |
|
11145 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
11146 { |
|
11147 |
|
11148 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
11149 s4o.print("("); |
|
11150 return_type_symbol->accept(*this); |
|
11151 s4o.print(")"); |
|
11152 IN_param_value->accept(*this); |
|
11153 return NULL; |
|
11154 |
|
11155 } |
|
11156 |
|
11157 ERROR; |
|
11158 } |
|
11159 |
|
11160 }/*function_byte_to_dword*/ |
|
11161 break; |
|
11162 |
|
11163 /**** |
|
11164 *BYTE_TO_LWORD |
|
11165 */ |
|
11166 case function_byte_to_lword : |
|
11167 { |
|
11168 symbol_c *last_type_symbol = NULL; |
|
11169 |
|
11170 { |
|
11171 identifier_c param_name("IN"); |
|
11172 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11173 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11174 |
|
11175 /* Get the value from a foo(<param_value>) style call */ |
|
11176 if (IN_param_value == NULL) |
|
11177 IN_param_value = function_call_param_iterator.next(); |
|
11178 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11179 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11180 |
|
11181 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
11182 { |
|
11183 |
|
11184 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
11185 s4o.print("("); |
|
11186 return_type_symbol->accept(*this); |
|
11187 s4o.print(")"); |
|
11188 IN_param_value->accept(*this); |
|
11189 return NULL; |
|
11190 |
|
11191 } |
|
11192 |
|
11193 ERROR; |
|
11194 } |
|
11195 |
|
11196 }/*function_byte_to_lword*/ |
|
11197 break; |
|
11198 |
|
11199 /**** |
|
11200 *WORD_TO_BOOL |
|
11201 */ |
|
11202 case function_word_to_bool : |
|
11203 { |
|
11204 symbol_c *last_type_symbol = NULL; |
|
11205 |
|
11206 { |
|
11207 identifier_c param_name("IN"); |
|
11208 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11209 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11210 |
|
11211 /* Get the value from a foo(<param_value>) style call */ |
|
11212 if (IN_param_value == NULL) |
|
11213 IN_param_value = function_call_param_iterator.next(); |
|
11214 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11215 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11216 |
|
11217 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11218 { |
|
11219 |
|
11220 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
11221 s4o.print("("); |
|
11222 return_type_symbol->accept(*this); |
|
11223 s4o.print(")"); |
|
11224 IN_param_value->accept(*this); |
|
11225 return NULL; |
|
11226 |
|
11227 } |
|
11228 |
|
11229 ERROR; |
|
11230 } |
|
11231 |
|
11232 }/*function_word_to_bool*/ |
|
11233 break; |
|
11234 |
|
11235 /**** |
|
11236 *WORD_TO_SINT |
|
11237 */ |
|
11238 case function_word_to_sint : |
|
11239 { |
|
11240 symbol_c *last_type_symbol = NULL; |
|
11241 |
|
11242 { |
|
11243 identifier_c param_name("IN"); |
|
11244 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11245 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11246 |
|
11247 /* Get the value from a foo(<param_value>) style call */ |
|
11248 if (IN_param_value == NULL) |
|
11249 IN_param_value = function_call_param_iterator.next(); |
|
11250 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11251 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11252 |
|
11253 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11254 { |
|
11255 |
|
11256 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
11257 s4o.print("("); |
|
11258 return_type_symbol->accept(*this); |
|
11259 s4o.print(")"); |
|
11260 IN_param_value->accept(*this); |
|
11261 return NULL; |
|
11262 |
|
11263 } |
|
11264 |
|
11265 ERROR; |
|
11266 } |
|
11267 |
|
11268 }/*function_word_to_sint*/ |
|
11269 break; |
|
11270 |
|
11271 /**** |
|
11272 *WORD_TO_INT |
|
11273 */ |
|
11274 case function_word_to_int : |
|
11275 { |
|
11276 symbol_c *last_type_symbol = NULL; |
|
11277 |
|
11278 { |
|
11279 identifier_c param_name("IN"); |
|
11280 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11281 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11282 |
|
11283 /* Get the value from a foo(<param_value>) style call */ |
|
11284 if (IN_param_value == NULL) |
|
11285 IN_param_value = function_call_param_iterator.next(); |
|
11286 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11287 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11288 |
|
11289 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11290 { |
|
11291 |
|
11292 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
11293 s4o.print("("); |
|
11294 return_type_symbol->accept(*this); |
|
11295 s4o.print(")"); |
|
11296 IN_param_value->accept(*this); |
|
11297 return NULL; |
|
11298 |
|
11299 } |
|
11300 |
|
11301 ERROR; |
|
11302 } |
|
11303 |
|
11304 }/*function_word_to_int*/ |
|
11305 break; |
|
11306 |
|
11307 /**** |
|
11308 *WORD_TO_DINT |
|
11309 */ |
|
11310 case function_word_to_dint : |
|
11311 { |
|
11312 symbol_c *last_type_symbol = NULL; |
|
11313 |
|
11314 { |
|
11315 identifier_c param_name("IN"); |
|
11316 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11317 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11318 |
|
11319 /* Get the value from a foo(<param_value>) style call */ |
|
11320 if (IN_param_value == NULL) |
|
11321 IN_param_value = function_call_param_iterator.next(); |
|
11322 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11323 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11324 |
|
11325 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11326 { |
|
11327 |
|
11328 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
11329 s4o.print("("); |
|
11330 return_type_symbol->accept(*this); |
|
11331 s4o.print(")"); |
|
11332 IN_param_value->accept(*this); |
|
11333 return NULL; |
|
11334 |
|
11335 } |
|
11336 |
|
11337 ERROR; |
|
11338 } |
|
11339 |
|
11340 }/*function_word_to_dint*/ |
|
11341 break; |
|
11342 |
|
11343 /**** |
|
11344 *WORD_TO_LINT |
|
11345 */ |
|
11346 case function_word_to_lint : |
|
11347 { |
|
11348 symbol_c *last_type_symbol = NULL; |
|
11349 |
|
11350 { |
|
11351 identifier_c param_name("IN"); |
|
11352 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11353 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11354 |
|
11355 /* Get the value from a foo(<param_value>) style call */ |
|
11356 if (IN_param_value == NULL) |
|
11357 IN_param_value = function_call_param_iterator.next(); |
|
11358 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11359 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11360 |
|
11361 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11362 { |
|
11363 |
|
11364 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
11365 s4o.print("("); |
|
11366 return_type_symbol->accept(*this); |
|
11367 s4o.print(")"); |
|
11368 IN_param_value->accept(*this); |
|
11369 return NULL; |
|
11370 |
|
11371 } |
|
11372 |
|
11373 ERROR; |
|
11374 } |
|
11375 |
|
11376 }/*function_word_to_lint*/ |
|
11377 break; |
|
11378 |
|
11379 /**** |
|
11380 *WORD_TO_USINT |
|
11381 */ |
|
11382 case function_word_to_usint : |
|
11383 { |
|
11384 symbol_c *last_type_symbol = NULL; |
|
11385 |
|
11386 { |
|
11387 identifier_c param_name("IN"); |
|
11388 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11389 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11390 |
|
11391 /* Get the value from a foo(<param_value>) style call */ |
|
11392 if (IN_param_value == NULL) |
|
11393 IN_param_value = function_call_param_iterator.next(); |
|
11394 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11395 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11396 |
|
11397 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11398 { |
|
11399 |
|
11400 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
11401 s4o.print("("); |
|
11402 return_type_symbol->accept(*this); |
|
11403 s4o.print(")"); |
|
11404 IN_param_value->accept(*this); |
|
11405 return NULL; |
|
11406 |
|
11407 } |
|
11408 |
|
11409 ERROR; |
|
11410 } |
|
11411 |
|
11412 }/*function_word_to_usint*/ |
|
11413 break; |
|
11414 |
|
11415 /**** |
|
11416 *WORD_TO_UINT |
|
11417 */ |
|
11418 case function_word_to_uint : |
|
11419 { |
|
11420 symbol_c *last_type_symbol = NULL; |
|
11421 |
|
11422 { |
|
11423 identifier_c param_name("IN"); |
|
11424 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11425 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11426 |
|
11427 /* Get the value from a foo(<param_value>) style call */ |
|
11428 if (IN_param_value == NULL) |
|
11429 IN_param_value = function_call_param_iterator.next(); |
|
11430 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11431 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11432 |
|
11433 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11434 { |
|
11435 |
|
11436 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
11437 s4o.print("("); |
|
11438 return_type_symbol->accept(*this); |
|
11439 s4o.print(")"); |
|
11440 IN_param_value->accept(*this); |
|
11441 return NULL; |
|
11442 |
|
11443 } |
|
11444 |
|
11445 ERROR; |
|
11446 } |
|
11447 |
|
11448 }/*function_word_to_uint*/ |
|
11449 break; |
|
11450 |
|
11451 /**** |
|
11452 *WORD_TO_UDINT |
|
11453 */ |
|
11454 case function_word_to_udint : |
|
11455 { |
|
11456 symbol_c *last_type_symbol = NULL; |
|
11457 |
|
11458 { |
|
11459 identifier_c param_name("IN"); |
|
11460 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11461 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11462 |
|
11463 /* Get the value from a foo(<param_value>) style call */ |
|
11464 if (IN_param_value == NULL) |
|
11465 IN_param_value = function_call_param_iterator.next(); |
|
11466 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11467 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11468 |
|
11469 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11470 { |
|
11471 |
|
11472 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
11473 s4o.print("("); |
|
11474 return_type_symbol->accept(*this); |
|
11475 s4o.print(")"); |
|
11476 IN_param_value->accept(*this); |
|
11477 return NULL; |
|
11478 |
|
11479 } |
|
11480 |
|
11481 ERROR; |
|
11482 } |
|
11483 |
|
11484 }/*function_word_to_udint*/ |
|
11485 break; |
|
11486 |
|
11487 /**** |
|
11488 *WORD_TO_ULINT |
|
11489 */ |
|
11490 case function_word_to_ulint : |
|
11491 { |
|
11492 symbol_c *last_type_symbol = NULL; |
|
11493 |
|
11494 { |
|
11495 identifier_c param_name("IN"); |
|
11496 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11497 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11498 |
|
11499 /* Get the value from a foo(<param_value>) style call */ |
|
11500 if (IN_param_value == NULL) |
|
11501 IN_param_value = function_call_param_iterator.next(); |
|
11502 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11503 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11504 |
|
11505 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11506 { |
|
11507 |
|
11508 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
11509 s4o.print("("); |
|
11510 return_type_symbol->accept(*this); |
|
11511 s4o.print(")"); |
|
11512 IN_param_value->accept(*this); |
|
11513 return NULL; |
|
11514 |
|
11515 } |
|
11516 |
|
11517 ERROR; |
|
11518 } |
|
11519 |
|
11520 }/*function_word_to_ulint*/ |
|
11521 break; |
|
11522 |
|
11523 /**** |
|
11524 *WORD_TO_REAL |
|
11525 */ |
|
11526 case function_word_to_real : |
|
11527 { |
|
11528 symbol_c *last_type_symbol = NULL; |
|
11529 |
|
11530 { |
|
11531 identifier_c param_name("IN"); |
|
11532 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11533 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11534 |
|
11535 /* Get the value from a foo(<param_value>) style call */ |
|
11536 if (IN_param_value == NULL) |
|
11537 IN_param_value = function_call_param_iterator.next(); |
|
11538 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11539 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11540 |
|
11541 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11542 { |
|
11543 |
|
11544 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
11545 s4o.print("("); |
|
11546 return_type_symbol->accept(*this); |
|
11547 s4o.print(")"); |
|
11548 IN_param_value->accept(*this); |
|
11549 return NULL; |
|
11550 |
|
11551 } |
|
11552 |
|
11553 ERROR; |
|
11554 } |
|
11555 |
|
11556 }/*function_word_to_real*/ |
|
11557 break; |
|
11558 |
|
11559 /**** |
|
11560 *WORD_TO_LREAL |
|
11561 */ |
|
11562 case function_word_to_lreal : |
|
11563 { |
|
11564 symbol_c *last_type_symbol = NULL; |
|
11565 |
|
11566 { |
|
11567 identifier_c param_name("IN"); |
|
11568 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11569 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11570 |
|
11571 /* Get the value from a foo(<param_value>) style call */ |
|
11572 if (IN_param_value == NULL) |
|
11573 IN_param_value = function_call_param_iterator.next(); |
|
11574 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11575 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11576 |
|
11577 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11578 { |
|
11579 |
|
11580 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
11581 s4o.print("("); |
|
11582 return_type_symbol->accept(*this); |
|
11583 s4o.print(")"); |
|
11584 IN_param_value->accept(*this); |
|
11585 return NULL; |
|
11586 |
|
11587 } |
|
11588 |
|
11589 ERROR; |
|
11590 } |
|
11591 |
|
11592 }/*function_word_to_lreal*/ |
|
11593 break; |
|
11594 |
|
11595 /**** |
|
11596 *WORD_TO_TIME |
|
11597 */ |
|
11598 case function_word_to_time : |
|
11599 { |
|
11600 symbol_c *last_type_symbol = NULL; |
|
11601 |
|
11602 { |
|
11603 identifier_c param_name("IN"); |
|
11604 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11605 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11606 |
|
11607 /* Get the value from a foo(<param_value>) style call */ |
|
11608 if (IN_param_value == NULL) |
|
11609 IN_param_value = function_call_param_iterator.next(); |
|
11610 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11611 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11612 |
|
11613 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11614 { |
|
11615 |
|
11616 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
11617 s4o.print("("); |
|
11618 return_type_symbol->accept(*this); |
|
11619 s4o.print(")__int_to_time("); |
|
11620 IN_param_value->accept(*this); |
|
11621 s4o.print(")"); |
|
11622 return NULL; |
|
11623 |
|
11624 } |
|
11625 |
|
11626 ERROR; |
|
11627 } |
|
11628 |
|
11629 }/*function_word_to_time*/ |
|
11630 break; |
|
11631 |
|
11632 /**** |
|
11633 *WORD_TO_DATE |
|
11634 */ |
|
11635 case function_word_to_date : |
|
11636 { |
|
11637 symbol_c *last_type_symbol = NULL; |
|
11638 |
|
11639 { |
|
11640 identifier_c param_name("IN"); |
|
11641 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11642 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11643 |
|
11644 /* Get the value from a foo(<param_value>) style call */ |
|
11645 if (IN_param_value == NULL) |
|
11646 IN_param_value = function_call_param_iterator.next(); |
|
11647 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11648 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11649 |
|
11650 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11651 { |
|
11652 |
|
11653 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
11654 s4o.print("("); |
|
11655 return_type_symbol->accept(*this); |
|
11656 s4o.print(")__int_to_time("); |
|
11657 IN_param_value->accept(*this); |
|
11658 s4o.print(")"); |
|
11659 return NULL; |
|
11660 |
|
11661 } |
|
11662 |
|
11663 ERROR; |
|
11664 } |
|
11665 |
|
11666 }/*function_word_to_date*/ |
|
11667 break; |
|
11668 |
|
11669 /**** |
|
11670 *WORD_TO_TOD |
|
11671 */ |
|
11672 case function_word_to_tod : |
|
11673 { |
|
11674 symbol_c *last_type_symbol = NULL; |
|
11675 |
|
11676 { |
|
11677 identifier_c param_name("IN"); |
|
11678 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11679 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11680 |
|
11681 /* Get the value from a foo(<param_value>) style call */ |
|
11682 if (IN_param_value == NULL) |
|
11683 IN_param_value = function_call_param_iterator.next(); |
|
11684 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11685 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11686 |
|
11687 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11688 { |
|
11689 |
|
11690 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
11691 s4o.print("("); |
|
11692 return_type_symbol->accept(*this); |
|
11693 s4o.print(")__int_to_time("); |
|
11694 IN_param_value->accept(*this); |
|
11695 s4o.print(")"); |
|
11696 return NULL; |
|
11697 |
|
11698 } |
|
11699 |
|
11700 ERROR; |
|
11701 } |
|
11702 |
|
11703 }/*function_word_to_tod*/ |
|
11704 break; |
|
11705 |
|
11706 /**** |
|
11707 *WORD_TO_DT |
|
11708 */ |
|
11709 case function_word_to_dt : |
|
11710 { |
|
11711 symbol_c *last_type_symbol = NULL; |
|
11712 |
|
11713 { |
|
11714 identifier_c param_name("IN"); |
|
11715 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11716 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11717 |
|
11718 /* Get the value from a foo(<param_value>) style call */ |
|
11719 if (IN_param_value == NULL) |
|
11720 IN_param_value = function_call_param_iterator.next(); |
|
11721 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11722 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11723 |
|
11724 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11725 { |
|
11726 |
|
11727 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
11728 s4o.print("("); |
|
11729 return_type_symbol->accept(*this); |
|
11730 s4o.print(")__int_to_time("); |
|
11731 IN_param_value->accept(*this); |
|
11732 s4o.print(")"); |
|
11733 return NULL; |
|
11734 |
|
11735 } |
|
11736 |
|
11737 ERROR; |
|
11738 } |
|
11739 |
|
11740 }/*function_word_to_dt*/ |
|
11741 break; |
|
11742 |
|
11743 /**** |
|
11744 *WORD_TO_STRING |
|
11745 */ |
|
11746 case function_word_to_string : |
|
11747 { |
|
11748 symbol_c *last_type_symbol = NULL; |
|
11749 |
|
11750 { |
|
11751 identifier_c param_name("IN"); |
|
11752 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11753 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11754 |
|
11755 /* Get the value from a foo(<param_value>) style call */ |
|
11756 if (IN_param_value == NULL) |
|
11757 IN_param_value = function_call_param_iterator.next(); |
|
11758 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11759 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11760 |
|
11761 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11762 { |
|
11763 |
|
11764 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
11765 s4o.print("("); |
|
11766 return_type_symbol->accept(*this); |
|
11767 s4o.print(")__bit_to_string("); |
|
11768 IN_param_value->accept(*this); |
|
11769 s4o.print(")"); |
|
11770 return NULL; |
|
11771 |
|
11772 } |
|
11773 |
|
11774 ERROR; |
|
11775 } |
|
11776 |
|
11777 }/*function_word_to_string*/ |
|
11778 break; |
|
11779 |
|
11780 /**** |
|
11781 *WORD_TO_BYTE |
|
11782 */ |
|
11783 case function_word_to_byte : |
|
11784 { |
|
11785 symbol_c *last_type_symbol = NULL; |
|
11786 |
|
11787 { |
|
11788 identifier_c param_name("IN"); |
|
11789 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11790 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11791 |
|
11792 /* Get the value from a foo(<param_value>) style call */ |
|
11793 if (IN_param_value == NULL) |
|
11794 IN_param_value = function_call_param_iterator.next(); |
|
11795 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11796 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11797 |
|
11798 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
8050 { |
11799 { |
8051 |
11800 |
8052 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
11801 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
8053 s4o.print("("); |
11802 s4o.print("("); |
8054 return_type_symbol->accept(*this); |
11803 return_type_symbol->accept(*this); |
8055 s4o.print(")__time_to_int("); |
11804 s4o.print(")"); |
8056 IN_param_value->accept(*this); |
11805 IN_param_value->accept(*this); |
8057 s4o.print(")"); |
11806 return NULL; |
8058 return NULL; |
11807 |
8059 |
11808 } |
8060 } |
11809 |
8061 |
11810 ERROR; |
8062 ERROR; |
11811 } |
8063 } |
11812 |
8064 |
11813 }/*function_word_to_byte*/ |
8065 }/*function_time_to_byte*/ |
11814 break; |
8066 break; |
11815 |
8067 |
11816 /**** |
8068 /**** |
11817 *WORD_TO_DWORD |
8069 *TIME_TO_WORD |
11818 */ |
8070 */ |
11819 case function_word_to_dword : |
8071 case function_time_to_word : |
11820 { |
8072 { |
11821 symbol_c *last_type_symbol = NULL; |
8073 symbol_c *last_type_symbol = NULL; |
11822 |
8074 |
11823 { |
8075 { |
11824 identifier_c param_name("IN"); |
8076 identifier_c param_name("IN"); |
11825 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8077 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
11826 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8078 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
11827 |
8079 |
11828 /* Get the value from a foo(<param_value>) style call */ |
8080 /* Get the value from a foo(<param_value>) style call */ |
11829 if (IN_param_value == NULL) |
8081 if (IN_param_value == NULL) |
11830 IN_param_value = function_call_param_iterator.next(); |
8082 IN_param_value = function_call_param_iterator.next(); |
11831 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8083 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
11832 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8084 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
11833 |
8085 |
11834 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
8086 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
11835 { |
|
11836 |
|
11837 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
11838 s4o.print("("); |
|
11839 return_type_symbol->accept(*this); |
|
11840 s4o.print(")"); |
|
11841 IN_param_value->accept(*this); |
|
11842 return NULL; |
|
11843 |
|
11844 } |
|
11845 |
|
11846 ERROR; |
|
11847 } |
|
11848 |
|
11849 }/*function_word_to_dword*/ |
|
11850 break; |
|
11851 |
|
11852 /**** |
|
11853 *WORD_TO_LWORD |
|
11854 */ |
|
11855 case function_word_to_lword : |
|
11856 { |
|
11857 symbol_c *last_type_symbol = NULL; |
|
11858 |
|
11859 { |
|
11860 identifier_c param_name("IN"); |
|
11861 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11862 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11863 |
|
11864 /* Get the value from a foo(<param_value>) style call */ |
|
11865 if (IN_param_value == NULL) |
|
11866 IN_param_value = function_call_param_iterator.next(); |
|
11867 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11868 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11869 |
|
11870 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11871 { |
|
11872 |
|
11873 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
11874 s4o.print("("); |
|
11875 return_type_symbol->accept(*this); |
|
11876 s4o.print(")"); |
|
11877 IN_param_value->accept(*this); |
|
11878 return NULL; |
|
11879 |
|
11880 } |
|
11881 |
|
11882 ERROR; |
|
11883 } |
|
11884 |
|
11885 }/*function_word_to_lword*/ |
|
11886 break; |
|
11887 |
|
11888 /**** |
|
11889 *DWORD_TO_BOOL |
|
11890 */ |
|
11891 case function_dword_to_bool : |
|
11892 { |
|
11893 symbol_c *last_type_symbol = NULL; |
|
11894 |
|
11895 { |
|
11896 identifier_c param_name("IN"); |
|
11897 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11898 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11899 |
|
11900 /* Get the value from a foo(<param_value>) style call */ |
|
11901 if (IN_param_value == NULL) |
|
11902 IN_param_value = function_call_param_iterator.next(); |
|
11903 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11904 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11905 |
|
11906 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
11907 { |
|
11908 |
|
11909 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
11910 s4o.print("("); |
|
11911 return_type_symbol->accept(*this); |
|
11912 s4o.print(")"); |
|
11913 IN_param_value->accept(*this); |
|
11914 return NULL; |
|
11915 |
|
11916 } |
|
11917 |
|
11918 ERROR; |
|
11919 } |
|
11920 |
|
11921 }/*function_dword_to_bool*/ |
|
11922 break; |
|
11923 |
|
11924 /**** |
|
11925 *DWORD_TO_SINT |
|
11926 */ |
|
11927 case function_dword_to_sint : |
|
11928 { |
|
11929 symbol_c *last_type_symbol = NULL; |
|
11930 |
|
11931 { |
|
11932 identifier_c param_name("IN"); |
|
11933 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11934 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11935 |
|
11936 /* Get the value from a foo(<param_value>) style call */ |
|
11937 if (IN_param_value == NULL) |
|
11938 IN_param_value = function_call_param_iterator.next(); |
|
11939 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11940 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11941 |
|
11942 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
11943 { |
|
11944 |
|
11945 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
11946 s4o.print("("); |
|
11947 return_type_symbol->accept(*this); |
|
11948 s4o.print(")"); |
|
11949 IN_param_value->accept(*this); |
|
11950 return NULL; |
|
11951 |
|
11952 } |
|
11953 |
|
11954 ERROR; |
|
11955 } |
|
11956 |
|
11957 }/*function_dword_to_sint*/ |
|
11958 break; |
|
11959 |
|
11960 /**** |
|
11961 *DWORD_TO_INT |
|
11962 */ |
|
11963 case function_dword_to_int : |
|
11964 { |
|
11965 symbol_c *last_type_symbol = NULL; |
|
11966 |
|
11967 { |
|
11968 identifier_c param_name("IN"); |
|
11969 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11970 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11971 |
|
11972 /* Get the value from a foo(<param_value>) style call */ |
|
11973 if (IN_param_value == NULL) |
|
11974 IN_param_value = function_call_param_iterator.next(); |
|
11975 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11976 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11977 |
|
11978 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
11979 { |
|
11980 |
|
11981 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
11982 s4o.print("("); |
|
11983 return_type_symbol->accept(*this); |
|
11984 s4o.print(")"); |
|
11985 IN_param_value->accept(*this); |
|
11986 return NULL; |
|
11987 |
|
11988 } |
|
11989 |
|
11990 ERROR; |
|
11991 } |
|
11992 |
|
11993 }/*function_dword_to_int*/ |
|
11994 break; |
|
11995 |
|
11996 /**** |
|
11997 *DWORD_TO_DINT |
|
11998 */ |
|
11999 case function_dword_to_dint : |
|
12000 { |
|
12001 symbol_c *last_type_symbol = NULL; |
|
12002 |
|
12003 { |
|
12004 identifier_c param_name("IN"); |
|
12005 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12006 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12007 |
|
12008 /* Get the value from a foo(<param_value>) style call */ |
|
12009 if (IN_param_value == NULL) |
|
12010 IN_param_value = function_call_param_iterator.next(); |
|
12011 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12012 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12013 |
|
12014 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
12015 { |
|
12016 |
|
12017 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
12018 s4o.print("("); |
|
12019 return_type_symbol->accept(*this); |
|
12020 s4o.print(")"); |
|
12021 IN_param_value->accept(*this); |
|
12022 return NULL; |
|
12023 |
|
12024 } |
|
12025 |
|
12026 ERROR; |
|
12027 } |
|
12028 |
|
12029 }/*function_dword_to_dint*/ |
|
12030 break; |
|
12031 |
|
12032 /**** |
|
12033 *DWORD_TO_LINT |
|
12034 */ |
|
12035 case function_dword_to_lint : |
|
12036 { |
|
12037 symbol_c *last_type_symbol = NULL; |
|
12038 |
|
12039 { |
|
12040 identifier_c param_name("IN"); |
|
12041 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12042 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12043 |
|
12044 /* Get the value from a foo(<param_value>) style call */ |
|
12045 if (IN_param_value == NULL) |
|
12046 IN_param_value = function_call_param_iterator.next(); |
|
12047 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12048 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12049 |
|
12050 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
12051 { |
|
12052 |
|
12053 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
12054 s4o.print("("); |
|
12055 return_type_symbol->accept(*this); |
|
12056 s4o.print(")"); |
|
12057 IN_param_value->accept(*this); |
|
12058 return NULL; |
|
12059 |
|
12060 } |
|
12061 |
|
12062 ERROR; |
|
12063 } |
|
12064 |
|
12065 }/*function_dword_to_lint*/ |
|
12066 break; |
|
12067 |
|
12068 /**** |
|
12069 *DWORD_TO_USINT |
|
12070 */ |
|
12071 case function_dword_to_usint : |
|
12072 { |
|
12073 symbol_c *last_type_symbol = NULL; |
|
12074 |
|
12075 { |
|
12076 identifier_c param_name("IN"); |
|
12077 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12078 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12079 |
|
12080 /* Get the value from a foo(<param_value>) style call */ |
|
12081 if (IN_param_value == NULL) |
|
12082 IN_param_value = function_call_param_iterator.next(); |
|
12083 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12084 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12085 |
|
12086 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
12087 { |
|
12088 |
|
12089 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
12090 s4o.print("("); |
|
12091 return_type_symbol->accept(*this); |
|
12092 s4o.print(")"); |
|
12093 IN_param_value->accept(*this); |
|
12094 return NULL; |
|
12095 |
|
12096 } |
|
12097 |
|
12098 ERROR; |
|
12099 } |
|
12100 |
|
12101 }/*function_dword_to_usint*/ |
|
12102 break; |
|
12103 |
|
12104 /**** |
|
12105 *DWORD_TO_UINT |
|
12106 */ |
|
12107 case function_dword_to_uint : |
|
12108 { |
|
12109 symbol_c *last_type_symbol = NULL; |
|
12110 |
|
12111 { |
|
12112 identifier_c param_name("IN"); |
|
12113 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12114 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12115 |
|
12116 /* Get the value from a foo(<param_value>) style call */ |
|
12117 if (IN_param_value == NULL) |
|
12118 IN_param_value = function_call_param_iterator.next(); |
|
12119 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12120 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12121 |
|
12122 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
12123 { |
|
12124 |
|
12125 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
12126 s4o.print("("); |
|
12127 return_type_symbol->accept(*this); |
|
12128 s4o.print(")"); |
|
12129 IN_param_value->accept(*this); |
|
12130 return NULL; |
|
12131 |
|
12132 } |
|
12133 |
|
12134 ERROR; |
|
12135 } |
|
12136 |
|
12137 }/*function_dword_to_uint*/ |
|
12138 break; |
|
12139 |
|
12140 /**** |
|
12141 *DWORD_TO_UDINT |
|
12142 */ |
|
12143 case function_dword_to_udint : |
|
12144 { |
|
12145 symbol_c *last_type_symbol = NULL; |
|
12146 |
|
12147 { |
|
12148 identifier_c param_name("IN"); |
|
12149 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12150 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12151 |
|
12152 /* Get the value from a foo(<param_value>) style call */ |
|
12153 if (IN_param_value == NULL) |
|
12154 IN_param_value = function_call_param_iterator.next(); |
|
12155 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12156 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12157 |
|
12158 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
12159 { |
|
12160 |
|
12161 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
12162 s4o.print("("); |
|
12163 return_type_symbol->accept(*this); |
|
12164 s4o.print(")"); |
|
12165 IN_param_value->accept(*this); |
|
12166 return NULL; |
|
12167 |
|
12168 } |
|
12169 |
|
12170 ERROR; |
|
12171 } |
|
12172 |
|
12173 }/*function_dword_to_udint*/ |
|
12174 break; |
|
12175 |
|
12176 /**** |
|
12177 *DWORD_TO_ULINT |
|
12178 */ |
|
12179 case function_dword_to_ulint : |
|
12180 { |
|
12181 symbol_c *last_type_symbol = NULL; |
|
12182 |
|
12183 { |
|
12184 identifier_c param_name("IN"); |
|
12185 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12186 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12187 |
|
12188 /* Get the value from a foo(<param_value>) style call */ |
|
12189 if (IN_param_value == NULL) |
|
12190 IN_param_value = function_call_param_iterator.next(); |
|
12191 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12192 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12193 |
|
12194 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
12195 { |
|
12196 |
|
12197 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
12198 s4o.print("("); |
|
12199 return_type_symbol->accept(*this); |
|
12200 s4o.print(")"); |
|
12201 IN_param_value->accept(*this); |
|
12202 return NULL; |
|
12203 |
|
12204 } |
|
12205 |
|
12206 ERROR; |
|
12207 } |
|
12208 |
|
12209 }/*function_dword_to_ulint*/ |
|
12210 break; |
|
12211 |
|
12212 /**** |
|
12213 *DWORD_TO_REAL |
|
12214 */ |
|
12215 case function_dword_to_real : |
|
12216 { |
|
12217 symbol_c *last_type_symbol = NULL; |
|
12218 |
|
12219 { |
|
12220 identifier_c param_name("IN"); |
|
12221 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12222 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12223 |
|
12224 /* Get the value from a foo(<param_value>) style call */ |
|
12225 if (IN_param_value == NULL) |
|
12226 IN_param_value = function_call_param_iterator.next(); |
|
12227 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12228 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12229 |
|
12230 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
12231 { |
|
12232 |
|
12233 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
12234 s4o.print("("); |
|
12235 return_type_symbol->accept(*this); |
|
12236 s4o.print(")"); |
|
12237 IN_param_value->accept(*this); |
|
12238 return NULL; |
|
12239 |
|
12240 } |
|
12241 |
|
12242 ERROR; |
|
12243 } |
|
12244 |
|
12245 }/*function_dword_to_real*/ |
|
12246 break; |
|
12247 |
|
12248 /**** |
|
12249 *DWORD_TO_LREAL |
|
12250 */ |
|
12251 case function_dword_to_lreal : |
|
12252 { |
|
12253 symbol_c *last_type_symbol = NULL; |
|
12254 |
|
12255 { |
|
12256 identifier_c param_name("IN"); |
|
12257 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12258 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12259 |
|
12260 /* Get the value from a foo(<param_value>) style call */ |
|
12261 if (IN_param_value == NULL) |
|
12262 IN_param_value = function_call_param_iterator.next(); |
|
12263 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12264 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12265 |
|
12266 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
12267 { |
|
12268 |
|
12269 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
12270 s4o.print("("); |
|
12271 return_type_symbol->accept(*this); |
|
12272 s4o.print(")"); |
|
12273 IN_param_value->accept(*this); |
|
12274 return NULL; |
|
12275 |
|
12276 } |
|
12277 |
|
12278 ERROR; |
|
12279 } |
|
12280 |
|
12281 }/*function_dword_to_lreal*/ |
|
12282 break; |
|
12283 |
|
12284 /**** |
|
12285 *DWORD_TO_TIME |
|
12286 */ |
|
12287 case function_dword_to_time : |
|
12288 { |
|
12289 symbol_c *last_type_symbol = NULL; |
|
12290 |
|
12291 { |
|
12292 identifier_c param_name("IN"); |
|
12293 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12294 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12295 |
|
12296 /* Get the value from a foo(<param_value>) style call */ |
|
12297 if (IN_param_value == NULL) |
|
12298 IN_param_value = function_call_param_iterator.next(); |
|
12299 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12300 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12301 |
|
12302 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
12303 { |
|
12304 |
|
12305 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
12306 s4o.print("("); |
|
12307 return_type_symbol->accept(*this); |
|
12308 s4o.print(")__int_to_time("); |
|
12309 IN_param_value->accept(*this); |
|
12310 s4o.print(")"); |
|
12311 return NULL; |
|
12312 |
|
12313 } |
|
12314 |
|
12315 ERROR; |
|
12316 } |
|
12317 |
|
12318 }/*function_dword_to_time*/ |
|
12319 break; |
|
12320 |
|
12321 /**** |
|
12322 *DWORD_TO_DATE |
|
12323 */ |
|
12324 case function_dword_to_date : |
|
12325 { |
|
12326 symbol_c *last_type_symbol = NULL; |
|
12327 |
|
12328 { |
|
12329 identifier_c param_name("IN"); |
|
12330 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12331 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12332 |
|
12333 /* Get the value from a foo(<param_value>) style call */ |
|
12334 if (IN_param_value == NULL) |
|
12335 IN_param_value = function_call_param_iterator.next(); |
|
12336 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12337 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12338 |
|
12339 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
12340 { |
|
12341 |
|
12342 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
12343 s4o.print("("); |
|
12344 return_type_symbol->accept(*this); |
|
12345 s4o.print(")__int_to_time("); |
|
12346 IN_param_value->accept(*this); |
|
12347 s4o.print(")"); |
|
12348 return NULL; |
|
12349 |
|
12350 } |
|
12351 |
|
12352 ERROR; |
|
12353 } |
|
12354 |
|
12355 }/*function_dword_to_date*/ |
|
12356 break; |
|
12357 |
|
12358 /**** |
|
12359 *DWORD_TO_TOD |
|
12360 */ |
|
12361 case function_dword_to_tod : |
|
12362 { |
|
12363 symbol_c *last_type_symbol = NULL; |
|
12364 |
|
12365 { |
|
12366 identifier_c param_name("IN"); |
|
12367 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12368 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12369 |
|
12370 /* Get the value from a foo(<param_value>) style call */ |
|
12371 if (IN_param_value == NULL) |
|
12372 IN_param_value = function_call_param_iterator.next(); |
|
12373 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12374 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12375 |
|
12376 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
12377 { |
|
12378 |
|
12379 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
12380 s4o.print("("); |
|
12381 return_type_symbol->accept(*this); |
|
12382 s4o.print(")__int_to_time("); |
|
12383 IN_param_value->accept(*this); |
|
12384 s4o.print(")"); |
|
12385 return NULL; |
|
12386 |
|
12387 } |
|
12388 |
|
12389 ERROR; |
|
12390 } |
|
12391 |
|
12392 }/*function_dword_to_tod*/ |
|
12393 break; |
|
12394 |
|
12395 /**** |
|
12396 *DWORD_TO_DT |
|
12397 */ |
|
12398 case function_dword_to_dt : |
|
12399 { |
|
12400 symbol_c *last_type_symbol = NULL; |
|
12401 |
|
12402 { |
|
12403 identifier_c param_name("IN"); |
|
12404 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12405 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12406 |
|
12407 /* Get the value from a foo(<param_value>) style call */ |
|
12408 if (IN_param_value == NULL) |
|
12409 IN_param_value = function_call_param_iterator.next(); |
|
12410 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12411 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12412 |
|
12413 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
12414 { |
|
12415 |
|
12416 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
12417 s4o.print("("); |
|
12418 return_type_symbol->accept(*this); |
|
12419 s4o.print(")__int_to_time("); |
|
12420 IN_param_value->accept(*this); |
|
12421 s4o.print(")"); |
|
12422 return NULL; |
|
12423 |
|
12424 } |
|
12425 |
|
12426 ERROR; |
|
12427 } |
|
12428 |
|
12429 }/*function_dword_to_dt*/ |
|
12430 break; |
|
12431 |
|
12432 /**** |
|
12433 *DWORD_TO_STRING |
|
12434 */ |
|
12435 case function_dword_to_string : |
|
12436 { |
|
12437 symbol_c *last_type_symbol = NULL; |
|
12438 |
|
12439 { |
|
12440 identifier_c param_name("IN"); |
|
12441 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12442 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12443 |
|
12444 /* Get the value from a foo(<param_value>) style call */ |
|
12445 if (IN_param_value == NULL) |
|
12446 IN_param_value = function_call_param_iterator.next(); |
|
12447 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12448 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12449 |
|
12450 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
12451 { |
|
12452 |
|
12453 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
12454 s4o.print("("); |
|
12455 return_type_symbol->accept(*this); |
|
12456 s4o.print(")__bit_to_string("); |
|
12457 IN_param_value->accept(*this); |
|
12458 s4o.print(")"); |
|
12459 return NULL; |
|
12460 |
|
12461 } |
|
12462 |
|
12463 ERROR; |
|
12464 } |
|
12465 |
|
12466 }/*function_dword_to_string*/ |
|
12467 break; |
|
12468 |
|
12469 /**** |
|
12470 *DWORD_TO_BYTE |
|
12471 */ |
|
12472 case function_dword_to_byte : |
|
12473 { |
|
12474 symbol_c *last_type_symbol = NULL; |
|
12475 |
|
12476 { |
|
12477 identifier_c param_name("IN"); |
|
12478 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12479 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12480 |
|
12481 /* Get the value from a foo(<param_value>) style call */ |
|
12482 if (IN_param_value == NULL) |
|
12483 IN_param_value = function_call_param_iterator.next(); |
|
12484 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12485 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12486 |
|
12487 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
12488 { |
|
12489 |
|
12490 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
12491 s4o.print("("); |
|
12492 return_type_symbol->accept(*this); |
|
12493 s4o.print(")"); |
|
12494 IN_param_value->accept(*this); |
|
12495 return NULL; |
|
12496 |
|
12497 } |
|
12498 |
|
12499 ERROR; |
|
12500 } |
|
12501 |
|
12502 }/*function_dword_to_byte*/ |
|
12503 break; |
|
12504 |
|
12505 /**** |
|
12506 *DWORD_TO_WORD |
|
12507 */ |
|
12508 case function_dword_to_word : |
|
12509 { |
|
12510 symbol_c *last_type_symbol = NULL; |
|
12511 |
|
12512 { |
|
12513 identifier_c param_name("IN"); |
|
12514 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12515 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12516 |
|
12517 /* Get the value from a foo(<param_value>) style call */ |
|
12518 if (IN_param_value == NULL) |
|
12519 IN_param_value = function_call_param_iterator.next(); |
|
12520 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12521 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12522 |
|
12523 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
8087 { |
12524 { |
8088 |
12525 |
8089 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
12526 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
8090 s4o.print("("); |
12527 s4o.print("("); |
8091 return_type_symbol->accept(*this); |
12528 return_type_symbol->accept(*this); |
8092 s4o.print(")__time_to_int("); |
12529 s4o.print(")"); |
8093 IN_param_value->accept(*this); |
12530 IN_param_value->accept(*this); |
8094 s4o.print(")"); |
12531 return NULL; |
8095 return NULL; |
12532 |
8096 |
12533 } |
8097 } |
12534 |
8098 |
12535 ERROR; |
8099 ERROR; |
12536 } |
8100 } |
12537 |
8101 |
12538 }/*function_dword_to_word*/ |
8102 }/*function_time_to_word*/ |
12539 break; |
8103 break; |
12540 |
8104 |
12541 /**** |
8105 /**** |
12542 *DWORD_TO_LWORD |
8106 *TIME_TO_DWORD |
12543 */ |
8107 */ |
12544 case function_dword_to_lword : |
8108 case function_time_to_dword : |
12545 { |
8109 { |
12546 symbol_c *last_type_symbol = NULL; |
8110 symbol_c *last_type_symbol = NULL; |
12547 |
8111 |
12548 { |
8112 { |
12549 identifier_c param_name("IN"); |
8113 identifier_c param_name("IN"); |
12550 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8114 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
12551 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8115 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
12552 |
8116 |
12553 /* Get the value from a foo(<param_value>) style call */ |
8117 /* Get the value from a foo(<param_value>) style call */ |
12554 if (IN_param_value == NULL) |
8118 if (IN_param_value == NULL) |
12555 IN_param_value = function_call_param_iterator.next(); |
8119 IN_param_value = function_call_param_iterator.next(); |
12556 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8120 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
12557 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8121 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
12558 |
8122 |
12559 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
8123 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
8124 { |
|
8125 |
|
8126 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
8127 s4o.print("("); |
|
8128 return_type_symbol->accept(*this); |
|
8129 s4o.print(")__time_to_int("); |
|
8130 IN_param_value->accept(*this); |
|
8131 s4o.print(")"); |
|
8132 return NULL; |
|
8133 |
|
8134 } |
|
8135 |
|
8136 ERROR; |
|
8137 } |
|
8138 |
|
8139 }/*function_time_to_dword*/ |
|
8140 break; |
|
8141 |
|
8142 /**** |
|
8143 *TIME_TO_LWORD |
|
8144 */ |
|
8145 case function_time_to_lword : |
|
8146 { |
|
8147 symbol_c *last_type_symbol = NULL; |
|
8148 |
|
8149 { |
|
8150 identifier_c param_name("IN"); |
|
8151 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8152 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8153 |
|
8154 /* Get the value from a foo(<param_value>) style call */ |
|
8155 if (IN_param_value == NULL) |
|
8156 IN_param_value = function_call_param_iterator.next(); |
|
8157 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8158 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8159 |
|
8160 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
8161 { |
12560 { |
8162 |
12561 |
8163 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
12562 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
8164 s4o.print("("); |
12563 s4o.print("("); |
8165 return_type_symbol->accept(*this); |
12564 return_type_symbol->accept(*this); |
8166 s4o.print(")__time_to_int("); |
12565 s4o.print(")"); |
8167 IN_param_value->accept(*this); |
12566 IN_param_value->accept(*this); |
8168 s4o.print(")"); |
12567 return NULL; |
8169 return NULL; |
12568 |
8170 |
12569 } |
8171 } |
12570 |
8172 |
12571 ERROR; |
8173 ERROR; |
12572 } |
8174 } |
12573 |
8175 |
12574 }/*function_dword_to_lword*/ |
8176 }/*function_time_to_lword*/ |
12575 break; |
8177 break; |
12576 |
8178 |
12577 /**** |
8179 /**** |
12578 *LWORD_TO_BOOL |
8180 *DATE_TO_BOOL |
12579 */ |
8181 */ |
12580 case function_lword_to_bool : |
8182 case function_date_to_bool : |
12581 { |
8183 { |
12582 symbol_c *last_type_symbol = NULL; |
8184 symbol_c *last_type_symbol = NULL; |
12583 |
8185 |
12584 { |
8186 { |
12585 identifier_c param_name("IN"); |
8187 identifier_c param_name("IN"); |
12586 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8188 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
12587 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8189 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
12588 |
8190 |
12589 /* Get the value from a foo(<param_value>) style call */ |
8191 /* Get the value from a foo(<param_value>) style call */ |
12590 if (IN_param_value == NULL) |
8192 if (IN_param_value == NULL) |
12591 IN_param_value = function_call_param_iterator.next(); |
8193 IN_param_value = function_call_param_iterator.next(); |
12592 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8194 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
12593 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8195 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
12594 |
8196 |
12595 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8197 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
8198 { |
12596 { |
8199 |
12597 |
8200 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
12598 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
8201 s4o.print("("); |
12599 s4o.print("("); |
8202 return_type_symbol->accept(*this); |
12600 return_type_symbol->accept(*this); |
8203 s4o.print(")__time_to_int("); |
12601 s4o.print(")"); |
8204 IN_param_value->accept(*this); |
12602 IN_param_value->accept(*this); |
8205 s4o.print(")"); |
12603 return NULL; |
8206 return NULL; |
12604 |
8207 |
12605 } |
8208 } |
12606 |
8209 |
12607 ERROR; |
8210 ERROR; |
12608 } |
8211 } |
12609 |
8212 |
12610 }/*function_lword_to_bool*/ |
8213 }/*function_date_to_bool*/ |
12611 break; |
8214 break; |
12612 |
8215 |
12613 /**** |
8216 /**** |
12614 *LWORD_TO_SINT |
8217 *DATE_TO_SINT |
12615 */ |
8218 */ |
12616 case function_lword_to_sint : |
8219 case function_date_to_sint : |
12617 { |
8220 { |
12618 symbol_c *last_type_symbol = NULL; |
8221 symbol_c *last_type_symbol = NULL; |
12619 |
8222 |
12620 { |
8223 { |
12621 identifier_c param_name("IN"); |
8224 identifier_c param_name("IN"); |
12622 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8225 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
12623 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8226 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
12624 |
8227 |
12625 /* Get the value from a foo(<param_value>) style call */ |
8228 /* Get the value from a foo(<param_value>) style call */ |
12626 if (IN_param_value == NULL) |
8229 if (IN_param_value == NULL) |
12627 IN_param_value = function_call_param_iterator.next(); |
8230 IN_param_value = function_call_param_iterator.next(); |
12628 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8231 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
12629 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8232 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
12630 |
8233 |
12631 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8234 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
8235 { |
12632 { |
8236 |
12633 |
8237 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
12634 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
8238 s4o.print("("); |
12635 s4o.print("("); |
8239 return_type_symbol->accept(*this); |
12636 return_type_symbol->accept(*this); |
8240 s4o.print(")__time_to_int("); |
12637 s4o.print(")"); |
8241 IN_param_value->accept(*this); |
12638 IN_param_value->accept(*this); |
8242 s4o.print(")"); |
12639 return NULL; |
8243 return NULL; |
12640 |
8244 |
12641 } |
8245 } |
12642 |
8246 |
12643 ERROR; |
8247 ERROR; |
12644 } |
8248 } |
12645 |
8249 |
12646 }/*function_lword_to_sint*/ |
8250 }/*function_date_to_sint*/ |
12647 break; |
8251 break; |
12648 |
8252 |
12649 /**** |
8253 /**** |
12650 *LWORD_TO_INT |
8254 *DATE_TO_INT |
12651 */ |
8255 */ |
12652 case function_lword_to_int : |
8256 case function_date_to_int : |
12653 { |
8257 { |
12654 symbol_c *last_type_symbol = NULL; |
8258 symbol_c *last_type_symbol = NULL; |
12655 |
8259 |
12656 { |
8260 { |
12657 identifier_c param_name("IN"); |
8261 identifier_c param_name("IN"); |
12658 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8262 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
12659 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8263 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
12660 |
8264 |
12661 /* Get the value from a foo(<param_value>) style call */ |
8265 /* Get the value from a foo(<param_value>) style call */ |
12662 if (IN_param_value == NULL) |
8266 if (IN_param_value == NULL) |
12663 IN_param_value = function_call_param_iterator.next(); |
8267 IN_param_value = function_call_param_iterator.next(); |
12664 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8268 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
12665 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8269 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
12666 |
8270 |
12667 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8271 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
8272 { |
12668 { |
8273 |
12669 |
8274 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
12670 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
8275 s4o.print("("); |
12671 s4o.print("("); |
8276 return_type_symbol->accept(*this); |
12672 return_type_symbol->accept(*this); |
8277 s4o.print(")__time_to_int("); |
12673 s4o.print(")"); |
8278 IN_param_value->accept(*this); |
12674 IN_param_value->accept(*this); |
8279 s4o.print(")"); |
12675 return NULL; |
8280 return NULL; |
12676 |
8281 |
12677 } |
8282 } |
12678 |
8283 |
12679 ERROR; |
8284 ERROR; |
12680 } |
8285 } |
12681 |
8286 |
12682 }/*function_lword_to_int*/ |
8287 }/*function_date_to_int*/ |
12683 break; |
8288 break; |
12684 |
8289 |
12685 /**** |
8290 /**** |
12686 *LWORD_TO_DINT |
8291 *DATE_TO_DINT |
12687 */ |
8292 */ |
12688 case function_lword_to_dint : |
8293 case function_date_to_dint : |
12689 { |
8294 { |
12690 symbol_c *last_type_symbol = NULL; |
8295 symbol_c *last_type_symbol = NULL; |
12691 |
8296 |
12692 { |
8297 { |
12693 identifier_c param_name("IN"); |
8298 identifier_c param_name("IN"); |
12694 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8299 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
12695 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8300 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
12696 |
8301 |
12697 /* Get the value from a foo(<param_value>) style call */ |
8302 /* Get the value from a foo(<param_value>) style call */ |
12698 if (IN_param_value == NULL) |
8303 if (IN_param_value == NULL) |
12699 IN_param_value = function_call_param_iterator.next(); |
8304 IN_param_value = function_call_param_iterator.next(); |
12700 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8305 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
12701 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8306 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
12702 |
8307 |
12703 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8308 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
8309 { |
12704 { |
8310 |
12705 |
8311 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
12706 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
8312 s4o.print("("); |
12707 s4o.print("("); |
8313 return_type_symbol->accept(*this); |
12708 return_type_symbol->accept(*this); |
8314 s4o.print(")__time_to_int("); |
12709 s4o.print(")"); |
8315 IN_param_value->accept(*this); |
12710 IN_param_value->accept(*this); |
8316 s4o.print(")"); |
12711 return NULL; |
8317 return NULL; |
12712 |
8318 |
12713 } |
8319 } |
12714 |
8320 |
12715 ERROR; |
8321 ERROR; |
12716 } |
8322 } |
12717 |
8323 |
12718 }/*function_lword_to_dint*/ |
8324 }/*function_date_to_dint*/ |
12719 break; |
8325 break; |
12720 |
8326 |
12721 /**** |
8327 /**** |
12722 *LWORD_TO_LINT |
8328 *DATE_TO_LINT |
12723 */ |
8329 */ |
12724 case function_lword_to_lint : |
8330 case function_date_to_lint : |
12725 { |
8331 { |
12726 symbol_c *last_type_symbol = NULL; |
8332 symbol_c *last_type_symbol = NULL; |
12727 |
8333 |
12728 { |
8334 { |
12729 identifier_c param_name("IN"); |
8335 identifier_c param_name("IN"); |
12730 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8336 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
12731 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8337 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
12732 |
8338 |
12733 /* Get the value from a foo(<param_value>) style call */ |
8339 /* Get the value from a foo(<param_value>) style call */ |
12734 if (IN_param_value == NULL) |
8340 if (IN_param_value == NULL) |
12735 IN_param_value = function_call_param_iterator.next(); |
8341 IN_param_value = function_call_param_iterator.next(); |
12736 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8342 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
12737 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8343 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
12738 |
8344 |
12739 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8345 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
8346 { |
12740 { |
8347 |
12741 |
8348 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
12742 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
8349 s4o.print("("); |
12743 s4o.print("("); |
8350 return_type_symbol->accept(*this); |
12744 return_type_symbol->accept(*this); |
8351 s4o.print(")__time_to_int("); |
12745 s4o.print(")"); |
8352 IN_param_value->accept(*this); |
12746 IN_param_value->accept(*this); |
8353 s4o.print(")"); |
12747 return NULL; |
8354 return NULL; |
12748 |
8355 |
12749 } |
8356 } |
12750 |
8357 |
12751 ERROR; |
8358 ERROR; |
12752 } |
8359 } |
12753 |
8360 |
12754 }/*function_lword_to_lint*/ |
8361 }/*function_date_to_lint*/ |
12755 break; |
8362 break; |
12756 |
8363 |
12757 /**** |
8364 /**** |
12758 *LWORD_TO_USINT |
8365 *DATE_TO_USINT |
12759 */ |
8366 */ |
12760 case function_lword_to_usint : |
8367 case function_date_to_usint : |
12761 { |
8368 { |
12762 symbol_c *last_type_symbol = NULL; |
8369 symbol_c *last_type_symbol = NULL; |
12763 |
8370 |
12764 { |
8371 { |
12765 identifier_c param_name("IN"); |
8372 identifier_c param_name("IN"); |
12766 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8373 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
12767 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8374 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
12768 |
8375 |
12769 /* Get the value from a foo(<param_value>) style call */ |
8376 /* Get the value from a foo(<param_value>) style call */ |
12770 if (IN_param_value == NULL) |
8377 if (IN_param_value == NULL) |
12771 IN_param_value = function_call_param_iterator.next(); |
8378 IN_param_value = function_call_param_iterator.next(); |
12772 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8379 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
12773 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8380 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
12774 |
8381 |
12775 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8382 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
8383 { |
12776 { |
8384 |
12777 |
8385 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
12778 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
8386 s4o.print("("); |
12779 s4o.print("("); |
8387 return_type_symbol->accept(*this); |
12780 return_type_symbol->accept(*this); |
8388 s4o.print(")__time_to_int("); |
12781 s4o.print(")"); |
8389 IN_param_value->accept(*this); |
12782 IN_param_value->accept(*this); |
8390 s4o.print(")"); |
12783 return NULL; |
8391 return NULL; |
12784 |
8392 |
12785 } |
8393 } |
12786 |
8394 |
12787 ERROR; |
8395 ERROR; |
12788 } |
8396 } |
12789 |
8397 |
12790 }/*function_lword_to_usint*/ |
8398 }/*function_date_to_usint*/ |
12791 break; |
8399 break; |
12792 |
8400 |
12793 /**** |
8401 /**** |
12794 *LWORD_TO_UINT |
8402 *DATE_TO_UINT |
12795 */ |
8403 */ |
12796 case function_lword_to_uint : |
8404 case function_date_to_uint : |
12797 { |
8405 { |
12798 symbol_c *last_type_symbol = NULL; |
8406 symbol_c *last_type_symbol = NULL; |
12799 |
8407 |
12800 { |
8408 { |
12801 identifier_c param_name("IN"); |
8409 identifier_c param_name("IN"); |
12802 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8410 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
12803 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8411 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
12804 |
8412 |
12805 /* Get the value from a foo(<param_value>) style call */ |
8413 /* Get the value from a foo(<param_value>) style call */ |
12806 if (IN_param_value == NULL) |
8414 if (IN_param_value == NULL) |
12807 IN_param_value = function_call_param_iterator.next(); |
8415 IN_param_value = function_call_param_iterator.next(); |
12808 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8416 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
12809 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8417 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
12810 |
8418 |
12811 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8419 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
8420 { |
12812 { |
8421 |
12813 |
8422 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
12814 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
8423 s4o.print("("); |
12815 s4o.print("("); |
8424 return_type_symbol->accept(*this); |
12816 return_type_symbol->accept(*this); |
8425 s4o.print(")__time_to_int("); |
12817 s4o.print(")"); |
8426 IN_param_value->accept(*this); |
12818 IN_param_value->accept(*this); |
8427 s4o.print(")"); |
12819 return NULL; |
8428 return NULL; |
12820 |
8429 |
12821 } |
8430 } |
12822 |
8431 |
12823 ERROR; |
8432 ERROR; |
12824 } |
8433 } |
12825 |
8434 |
12826 }/*function_lword_to_uint*/ |
8435 }/*function_date_to_uint*/ |
12827 break; |
8436 break; |
12828 |
8437 |
12829 /**** |
8438 /**** |
12830 *LWORD_TO_UDINT |
8439 *DATE_TO_UDINT |
12831 */ |
8440 */ |
12832 case function_lword_to_udint : |
8441 case function_date_to_udint : |
12833 { |
8442 { |
12834 symbol_c *last_type_symbol = NULL; |
8443 symbol_c *last_type_symbol = NULL; |
12835 |
8444 |
12836 { |
8445 { |
12837 identifier_c param_name("IN"); |
8446 identifier_c param_name("IN"); |
12838 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8447 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
12839 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8448 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
12840 |
8449 |
12841 /* Get the value from a foo(<param_value>) style call */ |
8450 /* Get the value from a foo(<param_value>) style call */ |
12842 if (IN_param_value == NULL) |
8451 if (IN_param_value == NULL) |
12843 IN_param_value = function_call_param_iterator.next(); |
8452 IN_param_value = function_call_param_iterator.next(); |
12844 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8453 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
12845 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8454 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
12846 |
8455 |
12847 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8456 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
8457 { |
12848 { |
8458 |
12849 |
8459 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
12850 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
8460 s4o.print("("); |
12851 s4o.print("("); |
8461 return_type_symbol->accept(*this); |
12852 return_type_symbol->accept(*this); |
8462 s4o.print(")__time_to_int("); |
12853 s4o.print(")"); |
8463 IN_param_value->accept(*this); |
12854 IN_param_value->accept(*this); |
8464 s4o.print(")"); |
12855 return NULL; |
8465 return NULL; |
12856 |
8466 |
12857 } |
8467 } |
12858 |
8468 |
12859 ERROR; |
8469 ERROR; |
12860 } |
8470 } |
12861 |
8471 |
12862 }/*function_lword_to_udint*/ |
8472 }/*function_date_to_udint*/ |
12863 break; |
8473 break; |
12864 |
8474 |
12865 /**** |
8475 /**** |
12866 *LWORD_TO_ULINT |
8476 *DATE_TO_ULINT |
12867 */ |
8477 */ |
12868 case function_lword_to_ulint : |
8478 case function_date_to_ulint : |
12869 { |
8479 { |
12870 symbol_c *last_type_symbol = NULL; |
8480 symbol_c *last_type_symbol = NULL; |
12871 |
8481 |
12872 { |
8482 { |
12873 identifier_c param_name("IN"); |
8483 identifier_c param_name("IN"); |
12874 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8484 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
12875 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8485 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
12876 |
8486 |
12877 /* Get the value from a foo(<param_value>) style call */ |
8487 /* Get the value from a foo(<param_value>) style call */ |
12878 if (IN_param_value == NULL) |
8488 if (IN_param_value == NULL) |
12879 IN_param_value = function_call_param_iterator.next(); |
8489 IN_param_value = function_call_param_iterator.next(); |
12880 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8490 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
12881 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8491 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
12882 |
8492 |
12883 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8493 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
8494 { |
12884 { |
8495 |
12885 |
8496 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
12886 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
8497 s4o.print("("); |
12887 s4o.print("("); |
8498 return_type_symbol->accept(*this); |
12888 return_type_symbol->accept(*this); |
8499 s4o.print(")__time_to_int("); |
12889 s4o.print(")"); |
8500 IN_param_value->accept(*this); |
12890 IN_param_value->accept(*this); |
8501 s4o.print(")"); |
12891 return NULL; |
8502 return NULL; |
12892 |
8503 |
12893 } |
8504 } |
12894 |
8505 |
12895 ERROR; |
8506 ERROR; |
12896 } |
8507 } |
12897 |
8508 |
12898 }/*function_lword_to_ulint*/ |
8509 }/*function_date_to_ulint*/ |
12899 break; |
8510 break; |
12900 |
8511 |
12901 /**** |
8512 /**** |
12902 *LWORD_TO_REAL |
8513 *DATE_TO_REAL |
12903 */ |
8514 */ |
12904 case function_lword_to_real : |
8515 case function_date_to_real : |
12905 { |
8516 { |
12906 symbol_c *last_type_symbol = NULL; |
8517 symbol_c *last_type_symbol = NULL; |
12907 |
8518 |
12908 { |
8519 { |
12909 identifier_c param_name("IN"); |
8520 identifier_c param_name("IN"); |
12910 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8521 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
12911 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8522 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
12912 |
8523 |
12913 /* Get the value from a foo(<param_value>) style call */ |
8524 /* Get the value from a foo(<param_value>) style call */ |
12914 if (IN_param_value == NULL) |
8525 if (IN_param_value == NULL) |
12915 IN_param_value = function_call_param_iterator.next(); |
8526 IN_param_value = function_call_param_iterator.next(); |
12916 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8527 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
12917 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8528 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
12918 |
8529 |
12919 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8530 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
8531 { |
12920 { |
8532 |
12921 |
8533 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
12922 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
8534 s4o.print("("); |
12923 s4o.print("("); |
8535 return_type_symbol->accept(*this); |
12924 return_type_symbol->accept(*this); |
8536 s4o.print(")__time_to_real("); |
12925 s4o.print(")"); |
8537 IN_param_value->accept(*this); |
12926 IN_param_value->accept(*this); |
8538 s4o.print(")"); |
12927 return NULL; |
8539 return NULL; |
12928 |
8540 |
12929 } |
8541 } |
12930 |
8542 |
12931 ERROR; |
8543 ERROR; |
12932 } |
8544 } |
12933 |
8545 |
12934 }/*function_lword_to_real*/ |
8546 }/*function_date_to_real*/ |
12935 break; |
8547 break; |
12936 |
8548 |
12937 /**** |
8549 /**** |
12938 *LWORD_TO_LREAL |
8550 *DATE_TO_LREAL |
12939 */ |
8551 */ |
12940 case function_lword_to_lreal : |
8552 case function_date_to_lreal : |
12941 { |
8553 { |
12942 symbol_c *last_type_symbol = NULL; |
8554 symbol_c *last_type_symbol = NULL; |
12943 |
8555 |
12944 { |
8556 { |
12945 identifier_c param_name("IN"); |
8557 identifier_c param_name("IN"); |
12946 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8558 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
12947 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8559 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
12948 |
8560 |
12949 /* Get the value from a foo(<param_value>) style call */ |
8561 /* Get the value from a foo(<param_value>) style call */ |
12950 if (IN_param_value == NULL) |
8562 if (IN_param_value == NULL) |
12951 IN_param_value = function_call_param_iterator.next(); |
8563 IN_param_value = function_call_param_iterator.next(); |
12952 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8564 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
12953 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8565 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
12954 |
8566 |
12955 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8567 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
8568 { |
12956 { |
8569 |
12957 |
8570 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
12958 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
8571 s4o.print("("); |
12959 s4o.print("("); |
8572 return_type_symbol->accept(*this); |
12960 return_type_symbol->accept(*this); |
8573 s4o.print(")__time_to_real("); |
12961 s4o.print(")"); |
8574 IN_param_value->accept(*this); |
12962 IN_param_value->accept(*this); |
8575 s4o.print(")"); |
12963 return NULL; |
8576 return NULL; |
12964 |
8577 |
12965 } |
8578 } |
12966 |
8579 |
12967 ERROR; |
8580 ERROR; |
12968 } |
8581 } |
12969 |
8582 |
12970 }/*function_lword_to_lreal*/ |
8583 }/*function_date_to_lreal*/ |
12971 break; |
8584 break; |
12972 |
8585 |
12973 /**** |
8586 /**** |
12974 *LWORD_TO_TIME |
8587 *DATE_TO_STRING |
12975 */ |
8588 */ |
12976 case function_lword_to_time : |
8589 case function_date_to_string : |
12977 { |
8590 { |
12978 symbol_c *last_type_symbol = NULL; |
8591 symbol_c *last_type_symbol = NULL; |
12979 |
8592 |
12980 { |
8593 { |
12981 identifier_c param_name("IN"); |
8594 identifier_c param_name("IN"); |
12982 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8595 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
12983 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8596 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
12984 |
8597 |
12985 /* Get the value from a foo(<param_value>) style call */ |
8598 /* Get the value from a foo(<param_value>) style call */ |
12986 if (IN_param_value == NULL) |
8599 if (IN_param_value == NULL) |
12987 IN_param_value = function_call_param_iterator.next(); |
8600 IN_param_value = function_call_param_iterator.next(); |
12988 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8601 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
12989 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8602 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
12990 |
8603 |
12991 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8604 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
12992 { |
|
12993 |
|
12994 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
12995 s4o.print("("); |
|
12996 return_type_symbol->accept(*this); |
|
12997 s4o.print(")__int_to_time("); |
|
12998 IN_param_value->accept(*this); |
|
12999 s4o.print(")"); |
|
13000 return NULL; |
|
13001 |
|
13002 } |
|
13003 |
|
13004 ERROR; |
|
13005 } |
|
13006 |
|
13007 }/*function_lword_to_time*/ |
|
13008 break; |
|
13009 |
|
13010 /**** |
|
13011 *LWORD_TO_DATE |
|
13012 */ |
|
13013 case function_lword_to_date : |
|
13014 { |
|
13015 symbol_c *last_type_symbol = NULL; |
|
13016 |
|
13017 { |
|
13018 identifier_c param_name("IN"); |
|
13019 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13020 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13021 |
|
13022 /* Get the value from a foo(<param_value>) style call */ |
|
13023 if (IN_param_value == NULL) |
|
13024 IN_param_value = function_call_param_iterator.next(); |
|
13025 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13026 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13027 |
|
13028 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
13029 { |
|
13030 |
|
13031 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
13032 s4o.print("("); |
|
13033 return_type_symbol->accept(*this); |
|
13034 s4o.print(")__int_to_time("); |
|
13035 IN_param_value->accept(*this); |
|
13036 s4o.print(")"); |
|
13037 return NULL; |
|
13038 |
|
13039 } |
|
13040 |
|
13041 ERROR; |
|
13042 } |
|
13043 |
|
13044 }/*function_lword_to_date*/ |
|
13045 break; |
|
13046 |
|
13047 /**** |
|
13048 *LWORD_TO_TOD |
|
13049 */ |
|
13050 case function_lword_to_tod : |
|
13051 { |
|
13052 symbol_c *last_type_symbol = NULL; |
|
13053 |
|
13054 { |
|
13055 identifier_c param_name("IN"); |
|
13056 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13057 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13058 |
|
13059 /* Get the value from a foo(<param_value>) style call */ |
|
13060 if (IN_param_value == NULL) |
|
13061 IN_param_value = function_call_param_iterator.next(); |
|
13062 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13063 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13064 |
|
13065 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
13066 { |
|
13067 |
|
13068 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
13069 s4o.print("("); |
|
13070 return_type_symbol->accept(*this); |
|
13071 s4o.print(")__int_to_time("); |
|
13072 IN_param_value->accept(*this); |
|
13073 s4o.print(")"); |
|
13074 return NULL; |
|
13075 |
|
13076 } |
|
13077 |
|
13078 ERROR; |
|
13079 } |
|
13080 |
|
13081 }/*function_lword_to_tod*/ |
|
13082 break; |
|
13083 |
|
13084 /**** |
|
13085 *LWORD_TO_DT |
|
13086 */ |
|
13087 case function_lword_to_dt : |
|
13088 { |
|
13089 symbol_c *last_type_symbol = NULL; |
|
13090 |
|
13091 { |
|
13092 identifier_c param_name("IN"); |
|
13093 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13094 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13095 |
|
13096 /* Get the value from a foo(<param_value>) style call */ |
|
13097 if (IN_param_value == NULL) |
|
13098 IN_param_value = function_call_param_iterator.next(); |
|
13099 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13100 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13101 |
|
13102 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
13103 { |
|
13104 |
|
13105 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
13106 s4o.print("("); |
|
13107 return_type_symbol->accept(*this); |
|
13108 s4o.print(")__int_to_time("); |
|
13109 IN_param_value->accept(*this); |
|
13110 s4o.print(")"); |
|
13111 return NULL; |
|
13112 |
|
13113 } |
|
13114 |
|
13115 ERROR; |
|
13116 } |
|
13117 |
|
13118 }/*function_lword_to_dt*/ |
|
13119 break; |
|
13120 |
|
13121 /**** |
|
13122 *LWORD_TO_STRING |
|
13123 */ |
|
13124 case function_lword_to_string : |
|
13125 { |
|
13126 symbol_c *last_type_symbol = NULL; |
|
13127 |
|
13128 { |
|
13129 identifier_c param_name("IN"); |
|
13130 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13131 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13132 |
|
13133 /* Get the value from a foo(<param_value>) style call */ |
|
13134 if (IN_param_value == NULL) |
|
13135 IN_param_value = function_call_param_iterator.next(); |
|
13136 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13137 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13138 |
|
13139 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8605 { |
13140 { |
8606 |
13141 |
8607 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
13142 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
8608 s4o.print("("); |
13143 s4o.print("("); |
8609 return_type_symbol->accept(*this); |
13144 return_type_symbol->accept(*this); |
8610 s4o.print(")__date_to_string("); |
13145 s4o.print(")__bit_to_string("); |
8611 IN_param_value->accept(*this); |
13146 IN_param_value->accept(*this); |
8612 s4o.print(")"); |
13147 s4o.print(")"); |
8613 return NULL; |
13148 return NULL; |
8614 |
13149 |
8615 } |
13150 } |
8616 |
13151 |
8617 ERROR; |
13152 ERROR; |
8618 } |
13153 } |
8619 |
13154 |
8620 }/*function_date_to_string*/ |
13155 }/*function_lword_to_string*/ |
8621 break; |
13156 break; |
8622 |
13157 |
8623 /**** |
13158 /**** |
8624 *DATE_TO_BYTE |
13159 *LWORD_TO_BYTE |
8625 */ |
13160 */ |
8626 case function_date_to_byte : |
13161 case function_lword_to_byte : |
8627 { |
13162 { |
8628 symbol_c *last_type_symbol = NULL; |
13163 symbol_c *last_type_symbol = NULL; |
8629 |
13164 |
8630 { |
13165 { |
8631 identifier_c param_name("IN"); |
13166 identifier_c param_name("IN"); |
8632 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
13167 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8633 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
13168 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8634 |
13169 |
8635 /* Get the value from a foo(<param_value>) style call */ |
13170 /* Get the value from a foo(<param_value>) style call */ |
8636 if (IN_param_value == NULL) |
13171 if (IN_param_value == NULL) |
8637 IN_param_value = function_call_param_iterator.next(); |
13172 IN_param_value = function_call_param_iterator.next(); |
8638 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
13173 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8639 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
13174 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8640 |
13175 |
8641 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
13176 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8642 { |
13177 { |
8643 |
13178 |
8644 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
13179 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
8645 s4o.print("("); |
13180 s4o.print("("); |
8646 return_type_symbol->accept(*this); |
13181 return_type_symbol->accept(*this); |
8647 s4o.print(")__time_to_int("); |
13182 s4o.print(")"); |
8648 IN_param_value->accept(*this); |
13183 IN_param_value->accept(*this); |
8649 s4o.print(")"); |
13184 return NULL; |
8650 return NULL; |
13185 |
8651 |
13186 } |
8652 } |
13187 |
8653 |
13188 ERROR; |
8654 ERROR; |
13189 } |
8655 } |
13190 |
8656 |
13191 }/*function_lword_to_byte*/ |
8657 }/*function_date_to_byte*/ |
13192 break; |
8658 break; |
13193 |
8659 |
13194 /**** |
8660 /**** |
13195 *LWORD_TO_WORD |
8661 *DATE_TO_WORD |
13196 */ |
8662 */ |
13197 case function_lword_to_word : |
8663 case function_date_to_word : |
13198 { |
8664 { |
13199 symbol_c *last_type_symbol = NULL; |
8665 symbol_c *last_type_symbol = NULL; |
13200 |
8666 |
13201 { |
8667 { |
13202 identifier_c param_name("IN"); |
8668 identifier_c param_name("IN"); |
13203 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
8669 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
13204 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
8670 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
13205 |
8671 |
13206 /* Get the value from a foo(<param_value>) style call */ |
8672 /* Get the value from a foo(<param_value>) style call */ |
13207 if (IN_param_value == NULL) |
8673 if (IN_param_value == NULL) |
13208 IN_param_value = function_call_param_iterator.next(); |
8674 IN_param_value = function_call_param_iterator.next(); |
13209 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
8675 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
13210 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
8676 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
13211 |
8677 |
13212 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
8678 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
8679 { |
13213 { |
8680 |
13214 |
8681 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
13215 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
8682 s4o.print("("); |
13216 s4o.print("("); |
8683 return_type_symbol->accept(*this); |
13217 return_type_symbol->accept(*this); |
8684 s4o.print(")__time_to_int("); |
|
8685 IN_param_value->accept(*this); |
|
8686 s4o.print(")"); |
|
8687 return NULL; |
|
8688 |
|
8689 } |
|
8690 |
|
8691 ERROR; |
|
8692 } |
|
8693 |
|
8694 }/*function_date_to_word*/ |
|
8695 break; |
|
8696 |
|
8697 /**** |
|
8698 *DATE_TO_DWORD |
|
8699 */ |
|
8700 case function_date_to_dword : |
|
8701 { |
|
8702 symbol_c *last_type_symbol = NULL; |
|
8703 |
|
8704 { |
|
8705 identifier_c param_name("IN"); |
|
8706 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8707 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8708 |
|
8709 /* Get the value from a foo(<param_value>) style call */ |
|
8710 if (IN_param_value == NULL) |
|
8711 IN_param_value = function_call_param_iterator.next(); |
|
8712 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8713 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8714 |
|
8715 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
8716 { |
|
8717 |
|
8718 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
8719 s4o.print("("); |
|
8720 return_type_symbol->accept(*this); |
|
8721 s4o.print(")__time_to_int("); |
|
8722 IN_param_value->accept(*this); |
|
8723 s4o.print(")"); |
|
8724 return NULL; |
|
8725 |
|
8726 } |
|
8727 |
|
8728 ERROR; |
|
8729 } |
|
8730 |
|
8731 }/*function_date_to_dword*/ |
|
8732 break; |
|
8733 |
|
8734 /**** |
|
8735 *DATE_TO_LWORD |
|
8736 */ |
|
8737 case function_date_to_lword : |
|
8738 { |
|
8739 symbol_c *last_type_symbol = NULL; |
|
8740 |
|
8741 { |
|
8742 identifier_c param_name("IN"); |
|
8743 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8744 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8745 |
|
8746 /* Get the value from a foo(<param_value>) style call */ |
|
8747 if (IN_param_value == NULL) |
|
8748 IN_param_value = function_call_param_iterator.next(); |
|
8749 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8750 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8751 |
|
8752 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
8753 { |
|
8754 |
|
8755 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
8756 s4o.print("("); |
|
8757 return_type_symbol->accept(*this); |
|
8758 s4o.print(")__time_to_int("); |
|
8759 IN_param_value->accept(*this); |
|
8760 s4o.print(")"); |
|
8761 return NULL; |
|
8762 |
|
8763 } |
|
8764 |
|
8765 ERROR; |
|
8766 } |
|
8767 |
|
8768 }/*function_date_to_lword*/ |
|
8769 break; |
|
8770 |
|
8771 /**** |
|
8772 *TOD_TO_BOOL |
|
8773 */ |
|
8774 case function_tod_to_bool : |
|
8775 { |
|
8776 symbol_c *last_type_symbol = NULL; |
|
8777 |
|
8778 { |
|
8779 identifier_c param_name("IN"); |
|
8780 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8781 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8782 |
|
8783 /* Get the value from a foo(<param_value>) style call */ |
|
8784 if (IN_param_value == NULL) |
|
8785 IN_param_value = function_call_param_iterator.next(); |
|
8786 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8787 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8788 |
|
8789 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
8790 { |
|
8791 |
|
8792 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
8793 s4o.print("("); |
|
8794 return_type_symbol->accept(*this); |
|
8795 s4o.print(")__time_to_int("); |
|
8796 IN_param_value->accept(*this); |
|
8797 s4o.print(")"); |
|
8798 return NULL; |
|
8799 |
|
8800 } |
|
8801 |
|
8802 ERROR; |
|
8803 } |
|
8804 |
|
8805 }/*function_tod_to_bool*/ |
|
8806 break; |
|
8807 |
|
8808 /**** |
|
8809 *TOD_TO_SINT |
|
8810 */ |
|
8811 case function_tod_to_sint : |
|
8812 { |
|
8813 symbol_c *last_type_symbol = NULL; |
|
8814 |
|
8815 { |
|
8816 identifier_c param_name("IN"); |
|
8817 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8818 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8819 |
|
8820 /* Get the value from a foo(<param_value>) style call */ |
|
8821 if (IN_param_value == NULL) |
|
8822 IN_param_value = function_call_param_iterator.next(); |
|
8823 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8824 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8825 |
|
8826 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
8827 { |
|
8828 |
|
8829 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
8830 s4o.print("("); |
|
8831 return_type_symbol->accept(*this); |
|
8832 s4o.print(")__time_to_int("); |
|
8833 IN_param_value->accept(*this); |
|
8834 s4o.print(")"); |
|
8835 return NULL; |
|
8836 |
|
8837 } |
|
8838 |
|
8839 ERROR; |
|
8840 } |
|
8841 |
|
8842 }/*function_tod_to_sint*/ |
|
8843 break; |
|
8844 |
|
8845 /**** |
|
8846 *TOD_TO_INT |
|
8847 */ |
|
8848 case function_tod_to_int : |
|
8849 { |
|
8850 symbol_c *last_type_symbol = NULL; |
|
8851 |
|
8852 { |
|
8853 identifier_c param_name("IN"); |
|
8854 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8855 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8856 |
|
8857 /* Get the value from a foo(<param_value>) style call */ |
|
8858 if (IN_param_value == NULL) |
|
8859 IN_param_value = function_call_param_iterator.next(); |
|
8860 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8861 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8862 |
|
8863 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
8864 { |
|
8865 |
|
8866 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
8867 s4o.print("("); |
|
8868 return_type_symbol->accept(*this); |
|
8869 s4o.print(")__time_to_int("); |
|
8870 IN_param_value->accept(*this); |
|
8871 s4o.print(")"); |
|
8872 return NULL; |
|
8873 |
|
8874 } |
|
8875 |
|
8876 ERROR; |
|
8877 } |
|
8878 |
|
8879 }/*function_tod_to_int*/ |
|
8880 break; |
|
8881 |
|
8882 /**** |
|
8883 *TOD_TO_DINT |
|
8884 */ |
|
8885 case function_tod_to_dint : |
|
8886 { |
|
8887 symbol_c *last_type_symbol = NULL; |
|
8888 |
|
8889 { |
|
8890 identifier_c param_name("IN"); |
|
8891 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8892 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8893 |
|
8894 /* Get the value from a foo(<param_value>) style call */ |
|
8895 if (IN_param_value == NULL) |
|
8896 IN_param_value = function_call_param_iterator.next(); |
|
8897 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8898 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8899 |
|
8900 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
8901 { |
|
8902 |
|
8903 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
8904 s4o.print("("); |
|
8905 return_type_symbol->accept(*this); |
|
8906 s4o.print(")__time_to_int("); |
|
8907 IN_param_value->accept(*this); |
|
8908 s4o.print(")"); |
|
8909 return NULL; |
|
8910 |
|
8911 } |
|
8912 |
|
8913 ERROR; |
|
8914 } |
|
8915 |
|
8916 }/*function_tod_to_dint*/ |
|
8917 break; |
|
8918 |
|
8919 /**** |
|
8920 *TOD_TO_LINT |
|
8921 */ |
|
8922 case function_tod_to_lint : |
|
8923 { |
|
8924 symbol_c *last_type_symbol = NULL; |
|
8925 |
|
8926 { |
|
8927 identifier_c param_name("IN"); |
|
8928 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8929 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8930 |
|
8931 /* Get the value from a foo(<param_value>) style call */ |
|
8932 if (IN_param_value == NULL) |
|
8933 IN_param_value = function_call_param_iterator.next(); |
|
8934 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8935 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8936 |
|
8937 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
8938 { |
|
8939 |
|
8940 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
8941 s4o.print("("); |
|
8942 return_type_symbol->accept(*this); |
|
8943 s4o.print(")__time_to_int("); |
|
8944 IN_param_value->accept(*this); |
|
8945 s4o.print(")"); |
|
8946 return NULL; |
|
8947 |
|
8948 } |
|
8949 |
|
8950 ERROR; |
|
8951 } |
|
8952 |
|
8953 }/*function_tod_to_lint*/ |
|
8954 break; |
|
8955 |
|
8956 /**** |
|
8957 *TOD_TO_USINT |
|
8958 */ |
|
8959 case function_tod_to_usint : |
|
8960 { |
|
8961 symbol_c *last_type_symbol = NULL; |
|
8962 |
|
8963 { |
|
8964 identifier_c param_name("IN"); |
|
8965 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8966 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8967 |
|
8968 /* Get the value from a foo(<param_value>) style call */ |
|
8969 if (IN_param_value == NULL) |
|
8970 IN_param_value = function_call_param_iterator.next(); |
|
8971 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8972 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8973 |
|
8974 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
8975 { |
|
8976 |
|
8977 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
8978 s4o.print("("); |
|
8979 return_type_symbol->accept(*this); |
|
8980 s4o.print(")__time_to_int("); |
|
8981 IN_param_value->accept(*this); |
|
8982 s4o.print(")"); |
|
8983 return NULL; |
|
8984 |
|
8985 } |
|
8986 |
|
8987 ERROR; |
|
8988 } |
|
8989 |
|
8990 }/*function_tod_to_usint*/ |
|
8991 break; |
|
8992 |
|
8993 /**** |
|
8994 *TOD_TO_UINT |
|
8995 */ |
|
8996 case function_tod_to_uint : |
|
8997 { |
|
8998 symbol_c *last_type_symbol = NULL; |
|
8999 |
|
9000 { |
|
9001 identifier_c param_name("IN"); |
|
9002 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9003 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9004 |
|
9005 /* Get the value from a foo(<param_value>) style call */ |
|
9006 if (IN_param_value == NULL) |
|
9007 IN_param_value = function_call_param_iterator.next(); |
|
9008 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9009 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9010 |
|
9011 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
9012 { |
|
9013 |
|
9014 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
9015 s4o.print("("); |
|
9016 return_type_symbol->accept(*this); |
|
9017 s4o.print(")__time_to_int("); |
|
9018 IN_param_value->accept(*this); |
|
9019 s4o.print(")"); |
|
9020 return NULL; |
|
9021 |
|
9022 } |
|
9023 |
|
9024 ERROR; |
|
9025 } |
|
9026 |
|
9027 }/*function_tod_to_uint*/ |
|
9028 break; |
|
9029 |
|
9030 /**** |
|
9031 *TOD_TO_UDINT |
|
9032 */ |
|
9033 case function_tod_to_udint : |
|
9034 { |
|
9035 symbol_c *last_type_symbol = NULL; |
|
9036 |
|
9037 { |
|
9038 identifier_c param_name("IN"); |
|
9039 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9040 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9041 |
|
9042 /* Get the value from a foo(<param_value>) style call */ |
|
9043 if (IN_param_value == NULL) |
|
9044 IN_param_value = function_call_param_iterator.next(); |
|
9045 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9046 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9047 |
|
9048 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
9049 { |
|
9050 |
|
9051 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
9052 s4o.print("("); |
|
9053 return_type_symbol->accept(*this); |
|
9054 s4o.print(")__time_to_int("); |
|
9055 IN_param_value->accept(*this); |
|
9056 s4o.print(")"); |
|
9057 return NULL; |
|
9058 |
|
9059 } |
|
9060 |
|
9061 ERROR; |
|
9062 } |
|
9063 |
|
9064 }/*function_tod_to_udint*/ |
|
9065 break; |
|
9066 |
|
9067 /**** |
|
9068 *TOD_TO_ULINT |
|
9069 */ |
|
9070 case function_tod_to_ulint : |
|
9071 { |
|
9072 symbol_c *last_type_symbol = NULL; |
|
9073 |
|
9074 { |
|
9075 identifier_c param_name("IN"); |
|
9076 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9077 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9078 |
|
9079 /* Get the value from a foo(<param_value>) style call */ |
|
9080 if (IN_param_value == NULL) |
|
9081 IN_param_value = function_call_param_iterator.next(); |
|
9082 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9083 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9084 |
|
9085 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
9086 { |
|
9087 |
|
9088 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
9089 s4o.print("("); |
|
9090 return_type_symbol->accept(*this); |
|
9091 s4o.print(")__time_to_int("); |
|
9092 IN_param_value->accept(*this); |
|
9093 s4o.print(")"); |
|
9094 return NULL; |
|
9095 |
|
9096 } |
|
9097 |
|
9098 ERROR; |
|
9099 } |
|
9100 |
|
9101 }/*function_tod_to_ulint*/ |
|
9102 break; |
|
9103 |
|
9104 /**** |
|
9105 *TOD_TO_REAL |
|
9106 */ |
|
9107 case function_tod_to_real : |
|
9108 { |
|
9109 symbol_c *last_type_symbol = NULL; |
|
9110 |
|
9111 { |
|
9112 identifier_c param_name("IN"); |
|
9113 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9114 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9115 |
|
9116 /* Get the value from a foo(<param_value>) style call */ |
|
9117 if (IN_param_value == NULL) |
|
9118 IN_param_value = function_call_param_iterator.next(); |
|
9119 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9120 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9121 |
|
9122 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
9123 { |
|
9124 |
|
9125 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
9126 s4o.print("("); |
|
9127 return_type_symbol->accept(*this); |
|
9128 s4o.print(")__time_to_real("); |
|
9129 IN_param_value->accept(*this); |
|
9130 s4o.print(")"); |
|
9131 return NULL; |
|
9132 |
|
9133 } |
|
9134 |
|
9135 ERROR; |
|
9136 } |
|
9137 |
|
9138 }/*function_tod_to_real*/ |
|
9139 break; |
|
9140 |
|
9141 /**** |
|
9142 *TOD_TO_LREAL |
|
9143 */ |
|
9144 case function_tod_to_lreal : |
|
9145 { |
|
9146 symbol_c *last_type_symbol = NULL; |
|
9147 |
|
9148 { |
|
9149 identifier_c param_name("IN"); |
|
9150 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9151 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9152 |
|
9153 /* Get the value from a foo(<param_value>) style call */ |
|
9154 if (IN_param_value == NULL) |
|
9155 IN_param_value = function_call_param_iterator.next(); |
|
9156 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9157 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9158 |
|
9159 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
9160 { |
|
9161 |
|
9162 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
9163 s4o.print("("); |
|
9164 return_type_symbol->accept(*this); |
|
9165 s4o.print(")__time_to_real("); |
|
9166 IN_param_value->accept(*this); |
|
9167 s4o.print(")"); |
|
9168 return NULL; |
|
9169 |
|
9170 } |
|
9171 |
|
9172 ERROR; |
|
9173 } |
|
9174 |
|
9175 }/*function_tod_to_lreal*/ |
|
9176 break; |
|
9177 |
|
9178 /**** |
|
9179 *TOD_TO_STRING |
|
9180 */ |
|
9181 case function_tod_to_string : |
|
9182 { |
|
9183 symbol_c *last_type_symbol = NULL; |
|
9184 |
|
9185 { |
|
9186 identifier_c param_name("IN"); |
|
9187 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9188 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9189 |
|
9190 /* Get the value from a foo(<param_value>) style call */ |
|
9191 if (IN_param_value == NULL) |
|
9192 IN_param_value = function_call_param_iterator.next(); |
|
9193 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9194 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9195 |
|
9196 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
9197 { |
|
9198 |
|
9199 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
9200 s4o.print("("); |
|
9201 return_type_symbol->accept(*this); |
|
9202 s4o.print(")__tod_to_string("); |
|
9203 IN_param_value->accept(*this); |
|
9204 s4o.print(")"); |
|
9205 return NULL; |
|
9206 |
|
9207 } |
|
9208 |
|
9209 ERROR; |
|
9210 } |
|
9211 |
|
9212 }/*function_tod_to_string*/ |
|
9213 break; |
|
9214 |
|
9215 /**** |
|
9216 *TOD_TO_BYTE |
|
9217 */ |
|
9218 case function_tod_to_byte : |
|
9219 { |
|
9220 symbol_c *last_type_symbol = NULL; |
|
9221 |
|
9222 { |
|
9223 identifier_c param_name("IN"); |
|
9224 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9225 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9226 |
|
9227 /* Get the value from a foo(<param_value>) style call */ |
|
9228 if (IN_param_value == NULL) |
|
9229 IN_param_value = function_call_param_iterator.next(); |
|
9230 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9231 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9232 |
|
9233 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
9234 { |
|
9235 |
|
9236 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
9237 s4o.print("("); |
|
9238 return_type_symbol->accept(*this); |
|
9239 s4o.print(")__time_to_int("); |
|
9240 IN_param_value->accept(*this); |
|
9241 s4o.print(")"); |
|
9242 return NULL; |
|
9243 |
|
9244 } |
|
9245 |
|
9246 ERROR; |
|
9247 } |
|
9248 |
|
9249 }/*function_tod_to_byte*/ |
|
9250 break; |
|
9251 |
|
9252 /**** |
|
9253 *TOD_TO_WORD |
|
9254 */ |
|
9255 case function_tod_to_word : |
|
9256 { |
|
9257 symbol_c *last_type_symbol = NULL; |
|
9258 |
|
9259 { |
|
9260 identifier_c param_name("IN"); |
|
9261 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9262 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9263 |
|
9264 /* Get the value from a foo(<param_value>) style call */ |
|
9265 if (IN_param_value == NULL) |
|
9266 IN_param_value = function_call_param_iterator.next(); |
|
9267 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9268 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9269 |
|
9270 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
9271 { |
|
9272 |
|
9273 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
9274 s4o.print("("); |
|
9275 return_type_symbol->accept(*this); |
|
9276 s4o.print(")__time_to_int("); |
|
9277 IN_param_value->accept(*this); |
|
9278 s4o.print(")"); |
|
9279 return NULL; |
|
9280 |
|
9281 } |
|
9282 |
|
9283 ERROR; |
|
9284 } |
|
9285 |
|
9286 }/*function_tod_to_word*/ |
|
9287 break; |
|
9288 |
|
9289 /**** |
|
9290 *TOD_TO_DWORD |
|
9291 */ |
|
9292 case function_tod_to_dword : |
|
9293 { |
|
9294 symbol_c *last_type_symbol = NULL; |
|
9295 |
|
9296 { |
|
9297 identifier_c param_name("IN"); |
|
9298 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9299 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9300 |
|
9301 /* Get the value from a foo(<param_value>) style call */ |
|
9302 if (IN_param_value == NULL) |
|
9303 IN_param_value = function_call_param_iterator.next(); |
|
9304 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9305 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9306 |
|
9307 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
9308 { |
|
9309 |
|
9310 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
9311 s4o.print("("); |
|
9312 return_type_symbol->accept(*this); |
|
9313 s4o.print(")__time_to_int("); |
|
9314 IN_param_value->accept(*this); |
|
9315 s4o.print(")"); |
|
9316 return NULL; |
|
9317 |
|
9318 } |
|
9319 |
|
9320 ERROR; |
|
9321 } |
|
9322 |
|
9323 }/*function_tod_to_dword*/ |
|
9324 break; |
|
9325 |
|
9326 /**** |
|
9327 *TOD_TO_LWORD |
|
9328 */ |
|
9329 case function_tod_to_lword : |
|
9330 { |
|
9331 symbol_c *last_type_symbol = NULL; |
|
9332 |
|
9333 { |
|
9334 identifier_c param_name("IN"); |
|
9335 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9336 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9337 |
|
9338 /* Get the value from a foo(<param_value>) style call */ |
|
9339 if (IN_param_value == NULL) |
|
9340 IN_param_value = function_call_param_iterator.next(); |
|
9341 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9342 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9343 |
|
9344 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
9345 { |
|
9346 |
|
9347 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
9348 s4o.print("("); |
|
9349 return_type_symbol->accept(*this); |
|
9350 s4o.print(")__time_to_int("); |
|
9351 IN_param_value->accept(*this); |
|
9352 s4o.print(")"); |
|
9353 return NULL; |
|
9354 |
|
9355 } |
|
9356 |
|
9357 ERROR; |
|
9358 } |
|
9359 |
|
9360 }/*function_tod_to_lword*/ |
|
9361 break; |
|
9362 |
|
9363 /**** |
|
9364 *DT_TO_BOOL |
|
9365 */ |
|
9366 case function_dt_to_bool : |
|
9367 { |
|
9368 symbol_c *last_type_symbol = NULL; |
|
9369 |
|
9370 { |
|
9371 identifier_c param_name("IN"); |
|
9372 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9373 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9374 |
|
9375 /* Get the value from a foo(<param_value>) style call */ |
|
9376 if (IN_param_value == NULL) |
|
9377 IN_param_value = function_call_param_iterator.next(); |
|
9378 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9379 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9380 |
|
9381 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9382 { |
|
9383 |
|
9384 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
9385 s4o.print("("); |
|
9386 return_type_symbol->accept(*this); |
|
9387 s4o.print(")__time_to_int("); |
|
9388 IN_param_value->accept(*this); |
|
9389 s4o.print(")"); |
|
9390 return NULL; |
|
9391 |
|
9392 } |
|
9393 |
|
9394 ERROR; |
|
9395 } |
|
9396 |
|
9397 }/*function_dt_to_bool*/ |
|
9398 break; |
|
9399 |
|
9400 /**** |
|
9401 *DT_TO_SINT |
|
9402 */ |
|
9403 case function_dt_to_sint : |
|
9404 { |
|
9405 symbol_c *last_type_symbol = NULL; |
|
9406 |
|
9407 { |
|
9408 identifier_c param_name("IN"); |
|
9409 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9410 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9411 |
|
9412 /* Get the value from a foo(<param_value>) style call */ |
|
9413 if (IN_param_value == NULL) |
|
9414 IN_param_value = function_call_param_iterator.next(); |
|
9415 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9416 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9417 |
|
9418 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9419 { |
|
9420 |
|
9421 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
9422 s4o.print("("); |
|
9423 return_type_symbol->accept(*this); |
|
9424 s4o.print(")__time_to_int("); |
|
9425 IN_param_value->accept(*this); |
|
9426 s4o.print(")"); |
|
9427 return NULL; |
|
9428 |
|
9429 } |
|
9430 |
|
9431 ERROR; |
|
9432 } |
|
9433 |
|
9434 }/*function_dt_to_sint*/ |
|
9435 break; |
|
9436 |
|
9437 /**** |
|
9438 *DT_TO_INT |
|
9439 */ |
|
9440 case function_dt_to_int : |
|
9441 { |
|
9442 symbol_c *last_type_symbol = NULL; |
|
9443 |
|
9444 { |
|
9445 identifier_c param_name("IN"); |
|
9446 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9447 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9448 |
|
9449 /* Get the value from a foo(<param_value>) style call */ |
|
9450 if (IN_param_value == NULL) |
|
9451 IN_param_value = function_call_param_iterator.next(); |
|
9452 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9453 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9454 |
|
9455 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9456 { |
|
9457 |
|
9458 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
9459 s4o.print("("); |
|
9460 return_type_symbol->accept(*this); |
|
9461 s4o.print(")__time_to_int("); |
|
9462 IN_param_value->accept(*this); |
|
9463 s4o.print(")"); |
|
9464 return NULL; |
|
9465 |
|
9466 } |
|
9467 |
|
9468 ERROR; |
|
9469 } |
|
9470 |
|
9471 }/*function_dt_to_int*/ |
|
9472 break; |
|
9473 |
|
9474 /**** |
|
9475 *DT_TO_DINT |
|
9476 */ |
|
9477 case function_dt_to_dint : |
|
9478 { |
|
9479 symbol_c *last_type_symbol = NULL; |
|
9480 |
|
9481 { |
|
9482 identifier_c param_name("IN"); |
|
9483 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9484 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9485 |
|
9486 /* Get the value from a foo(<param_value>) style call */ |
|
9487 if (IN_param_value == NULL) |
|
9488 IN_param_value = function_call_param_iterator.next(); |
|
9489 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9490 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9491 |
|
9492 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9493 { |
|
9494 |
|
9495 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
9496 s4o.print("("); |
|
9497 return_type_symbol->accept(*this); |
|
9498 s4o.print(")__time_to_int("); |
|
9499 IN_param_value->accept(*this); |
|
9500 s4o.print(")"); |
|
9501 return NULL; |
|
9502 |
|
9503 } |
|
9504 |
|
9505 ERROR; |
|
9506 } |
|
9507 |
|
9508 }/*function_dt_to_dint*/ |
|
9509 break; |
|
9510 |
|
9511 /**** |
|
9512 *DT_TO_LINT |
|
9513 */ |
|
9514 case function_dt_to_lint : |
|
9515 { |
|
9516 symbol_c *last_type_symbol = NULL; |
|
9517 |
|
9518 { |
|
9519 identifier_c param_name("IN"); |
|
9520 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9521 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9522 |
|
9523 /* Get the value from a foo(<param_value>) style call */ |
|
9524 if (IN_param_value == NULL) |
|
9525 IN_param_value = function_call_param_iterator.next(); |
|
9526 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9527 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9528 |
|
9529 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9530 { |
|
9531 |
|
9532 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
9533 s4o.print("("); |
|
9534 return_type_symbol->accept(*this); |
|
9535 s4o.print(")__time_to_int("); |
|
9536 IN_param_value->accept(*this); |
|
9537 s4o.print(")"); |
|
9538 return NULL; |
|
9539 |
|
9540 } |
|
9541 |
|
9542 ERROR; |
|
9543 } |
|
9544 |
|
9545 }/*function_dt_to_lint*/ |
|
9546 break; |
|
9547 |
|
9548 /**** |
|
9549 *DT_TO_USINT |
|
9550 */ |
|
9551 case function_dt_to_usint : |
|
9552 { |
|
9553 symbol_c *last_type_symbol = NULL; |
|
9554 |
|
9555 { |
|
9556 identifier_c param_name("IN"); |
|
9557 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9558 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9559 |
|
9560 /* Get the value from a foo(<param_value>) style call */ |
|
9561 if (IN_param_value == NULL) |
|
9562 IN_param_value = function_call_param_iterator.next(); |
|
9563 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9564 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9565 |
|
9566 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9567 { |
|
9568 |
|
9569 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
9570 s4o.print("("); |
|
9571 return_type_symbol->accept(*this); |
|
9572 s4o.print(")__time_to_int("); |
|
9573 IN_param_value->accept(*this); |
|
9574 s4o.print(")"); |
|
9575 return NULL; |
|
9576 |
|
9577 } |
|
9578 |
|
9579 ERROR; |
|
9580 } |
|
9581 |
|
9582 }/*function_dt_to_usint*/ |
|
9583 break; |
|
9584 |
|
9585 /**** |
|
9586 *DT_TO_UINT |
|
9587 */ |
|
9588 case function_dt_to_uint : |
|
9589 { |
|
9590 symbol_c *last_type_symbol = NULL; |
|
9591 |
|
9592 { |
|
9593 identifier_c param_name("IN"); |
|
9594 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9595 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9596 |
|
9597 /* Get the value from a foo(<param_value>) style call */ |
|
9598 if (IN_param_value == NULL) |
|
9599 IN_param_value = function_call_param_iterator.next(); |
|
9600 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9601 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9602 |
|
9603 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9604 { |
|
9605 |
|
9606 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
9607 s4o.print("("); |
|
9608 return_type_symbol->accept(*this); |
|
9609 s4o.print(")__time_to_int("); |
|
9610 IN_param_value->accept(*this); |
|
9611 s4o.print(")"); |
|
9612 return NULL; |
|
9613 |
|
9614 } |
|
9615 |
|
9616 ERROR; |
|
9617 } |
|
9618 |
|
9619 }/*function_dt_to_uint*/ |
|
9620 break; |
|
9621 |
|
9622 /**** |
|
9623 *DT_TO_UDINT |
|
9624 */ |
|
9625 case function_dt_to_udint : |
|
9626 { |
|
9627 symbol_c *last_type_symbol = NULL; |
|
9628 |
|
9629 { |
|
9630 identifier_c param_name("IN"); |
|
9631 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9632 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9633 |
|
9634 /* Get the value from a foo(<param_value>) style call */ |
|
9635 if (IN_param_value == NULL) |
|
9636 IN_param_value = function_call_param_iterator.next(); |
|
9637 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9638 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9639 |
|
9640 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9641 { |
|
9642 |
|
9643 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
9644 s4o.print("("); |
|
9645 return_type_symbol->accept(*this); |
|
9646 s4o.print(")__time_to_int("); |
|
9647 IN_param_value->accept(*this); |
|
9648 s4o.print(")"); |
|
9649 return NULL; |
|
9650 |
|
9651 } |
|
9652 |
|
9653 ERROR; |
|
9654 } |
|
9655 |
|
9656 }/*function_dt_to_udint*/ |
|
9657 break; |
|
9658 |
|
9659 /**** |
|
9660 *DT_TO_ULINT |
|
9661 */ |
|
9662 case function_dt_to_ulint : |
|
9663 { |
|
9664 symbol_c *last_type_symbol = NULL; |
|
9665 |
|
9666 { |
|
9667 identifier_c param_name("IN"); |
|
9668 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9669 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9670 |
|
9671 /* Get the value from a foo(<param_value>) style call */ |
|
9672 if (IN_param_value == NULL) |
|
9673 IN_param_value = function_call_param_iterator.next(); |
|
9674 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9675 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9676 |
|
9677 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9678 { |
|
9679 |
|
9680 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
9681 s4o.print("("); |
|
9682 return_type_symbol->accept(*this); |
|
9683 s4o.print(")__time_to_int("); |
|
9684 IN_param_value->accept(*this); |
|
9685 s4o.print(")"); |
|
9686 return NULL; |
|
9687 |
|
9688 } |
|
9689 |
|
9690 ERROR; |
|
9691 } |
|
9692 |
|
9693 }/*function_dt_to_ulint*/ |
|
9694 break; |
|
9695 |
|
9696 /**** |
|
9697 *DT_TO_REAL |
|
9698 */ |
|
9699 case function_dt_to_real : |
|
9700 { |
|
9701 symbol_c *last_type_symbol = NULL; |
|
9702 |
|
9703 { |
|
9704 identifier_c param_name("IN"); |
|
9705 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9706 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9707 |
|
9708 /* Get the value from a foo(<param_value>) style call */ |
|
9709 if (IN_param_value == NULL) |
|
9710 IN_param_value = function_call_param_iterator.next(); |
|
9711 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9712 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9713 |
|
9714 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9715 { |
|
9716 |
|
9717 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
9718 s4o.print("("); |
|
9719 return_type_symbol->accept(*this); |
|
9720 s4o.print(")__time_to_real("); |
|
9721 IN_param_value->accept(*this); |
|
9722 s4o.print(")"); |
|
9723 return NULL; |
|
9724 |
|
9725 } |
|
9726 |
|
9727 ERROR; |
|
9728 } |
|
9729 |
|
9730 }/*function_dt_to_real*/ |
|
9731 break; |
|
9732 |
|
9733 /**** |
|
9734 *DT_TO_LREAL |
|
9735 */ |
|
9736 case function_dt_to_lreal : |
|
9737 { |
|
9738 symbol_c *last_type_symbol = NULL; |
|
9739 |
|
9740 { |
|
9741 identifier_c param_name("IN"); |
|
9742 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9743 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9744 |
|
9745 /* Get the value from a foo(<param_value>) style call */ |
|
9746 if (IN_param_value == NULL) |
|
9747 IN_param_value = function_call_param_iterator.next(); |
|
9748 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9749 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9750 |
|
9751 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9752 { |
|
9753 |
|
9754 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
9755 s4o.print("("); |
|
9756 return_type_symbol->accept(*this); |
|
9757 s4o.print(")__time_to_real("); |
|
9758 IN_param_value->accept(*this); |
|
9759 s4o.print(")"); |
|
9760 return NULL; |
|
9761 |
|
9762 } |
|
9763 |
|
9764 ERROR; |
|
9765 } |
|
9766 |
|
9767 }/*function_dt_to_lreal*/ |
|
9768 break; |
|
9769 |
|
9770 /**** |
|
9771 *DT_TO_STRING |
|
9772 */ |
|
9773 case function_dt_to_string : |
|
9774 { |
|
9775 symbol_c *last_type_symbol = NULL; |
|
9776 |
|
9777 { |
|
9778 identifier_c param_name("IN"); |
|
9779 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9780 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9781 |
|
9782 /* Get the value from a foo(<param_value>) style call */ |
|
9783 if (IN_param_value == NULL) |
|
9784 IN_param_value = function_call_param_iterator.next(); |
|
9785 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9786 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9787 |
|
9788 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9789 { |
|
9790 |
|
9791 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
9792 s4o.print("("); |
|
9793 return_type_symbol->accept(*this); |
|
9794 s4o.print(")__dt_to_string("); |
|
9795 IN_param_value->accept(*this); |
|
9796 s4o.print(")"); |
|
9797 return NULL; |
|
9798 |
|
9799 } |
|
9800 |
|
9801 ERROR; |
|
9802 } |
|
9803 |
|
9804 }/*function_dt_to_string*/ |
|
9805 break; |
|
9806 |
|
9807 /**** |
|
9808 *DT_TO_BYTE |
|
9809 */ |
|
9810 case function_dt_to_byte : |
|
9811 { |
|
9812 symbol_c *last_type_symbol = NULL; |
|
9813 |
|
9814 { |
|
9815 identifier_c param_name("IN"); |
|
9816 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9817 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9818 |
|
9819 /* Get the value from a foo(<param_value>) style call */ |
|
9820 if (IN_param_value == NULL) |
|
9821 IN_param_value = function_call_param_iterator.next(); |
|
9822 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9823 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9824 |
|
9825 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9826 { |
|
9827 |
|
9828 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
9829 s4o.print("("); |
|
9830 return_type_symbol->accept(*this); |
|
9831 s4o.print(")__time_to_int("); |
|
9832 IN_param_value->accept(*this); |
|
9833 s4o.print(")"); |
|
9834 return NULL; |
|
9835 |
|
9836 } |
|
9837 |
|
9838 ERROR; |
|
9839 } |
|
9840 |
|
9841 }/*function_dt_to_byte*/ |
|
9842 break; |
|
9843 |
|
9844 /**** |
|
9845 *DT_TO_WORD |
|
9846 */ |
|
9847 case function_dt_to_word : |
|
9848 { |
|
9849 symbol_c *last_type_symbol = NULL; |
|
9850 |
|
9851 { |
|
9852 identifier_c param_name("IN"); |
|
9853 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9854 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9855 |
|
9856 /* Get the value from a foo(<param_value>) style call */ |
|
9857 if (IN_param_value == NULL) |
|
9858 IN_param_value = function_call_param_iterator.next(); |
|
9859 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9860 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9861 |
|
9862 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9863 { |
|
9864 |
|
9865 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
9866 s4o.print("("); |
|
9867 return_type_symbol->accept(*this); |
|
9868 s4o.print(")__time_to_int("); |
|
9869 IN_param_value->accept(*this); |
|
9870 s4o.print(")"); |
|
9871 return NULL; |
|
9872 |
|
9873 } |
|
9874 |
|
9875 ERROR; |
|
9876 } |
|
9877 |
|
9878 }/*function_dt_to_word*/ |
|
9879 break; |
|
9880 |
|
9881 /**** |
|
9882 *DT_TO_DWORD |
|
9883 */ |
|
9884 case function_dt_to_dword : |
|
9885 { |
|
9886 symbol_c *last_type_symbol = NULL; |
|
9887 |
|
9888 { |
|
9889 identifier_c param_name("IN"); |
|
9890 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9891 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9892 |
|
9893 /* Get the value from a foo(<param_value>) style call */ |
|
9894 if (IN_param_value == NULL) |
|
9895 IN_param_value = function_call_param_iterator.next(); |
|
9896 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9897 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9898 |
|
9899 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9900 { |
|
9901 |
|
9902 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
9903 s4o.print("("); |
|
9904 return_type_symbol->accept(*this); |
|
9905 s4o.print(")__time_to_int("); |
|
9906 IN_param_value->accept(*this); |
|
9907 s4o.print(")"); |
|
9908 return NULL; |
|
9909 |
|
9910 } |
|
9911 |
|
9912 ERROR; |
|
9913 } |
|
9914 |
|
9915 }/*function_dt_to_dword*/ |
|
9916 break; |
|
9917 |
|
9918 /**** |
|
9919 *DT_TO_LWORD |
|
9920 */ |
|
9921 case function_dt_to_lword : |
|
9922 { |
|
9923 symbol_c *last_type_symbol = NULL; |
|
9924 |
|
9925 { |
|
9926 identifier_c param_name("IN"); |
|
9927 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9928 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9929 |
|
9930 /* Get the value from a foo(<param_value>) style call */ |
|
9931 if (IN_param_value == NULL) |
|
9932 IN_param_value = function_call_param_iterator.next(); |
|
9933 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9934 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9935 |
|
9936 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
9937 { |
|
9938 |
|
9939 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
9940 s4o.print("("); |
|
9941 return_type_symbol->accept(*this); |
|
9942 s4o.print(")__time_to_int("); |
|
9943 IN_param_value->accept(*this); |
|
9944 s4o.print(")"); |
|
9945 return NULL; |
|
9946 |
|
9947 } |
|
9948 |
|
9949 ERROR; |
|
9950 } |
|
9951 |
|
9952 }/*function_dt_to_lword*/ |
|
9953 break; |
|
9954 |
|
9955 /**** |
|
9956 *STRING_TO_BOOL |
|
9957 */ |
|
9958 case function_string_to_bool : |
|
9959 { |
|
9960 symbol_c *last_type_symbol = NULL; |
|
9961 |
|
9962 { |
|
9963 identifier_c param_name("IN"); |
|
9964 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9965 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9966 |
|
9967 /* Get the value from a foo(<param_value>) style call */ |
|
9968 if (IN_param_value == NULL) |
|
9969 IN_param_value = function_call_param_iterator.next(); |
|
9970 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9971 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9972 |
|
9973 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
9974 { |
|
9975 |
|
9976 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
9977 s4o.print("("); |
|
9978 return_type_symbol->accept(*this); |
|
9979 s4o.print(")__string_to_bool("); |
|
9980 IN_param_value->accept(*this); |
|
9981 s4o.print(")"); |
|
9982 return NULL; |
|
9983 |
|
9984 } |
|
9985 |
|
9986 ERROR; |
|
9987 } |
|
9988 |
|
9989 }/*function_string_to_bool*/ |
|
9990 break; |
|
9991 |
|
9992 /**** |
|
9993 *STRING_TO_SINT |
|
9994 */ |
|
9995 case function_string_to_sint : |
|
9996 { |
|
9997 symbol_c *last_type_symbol = NULL; |
|
9998 |
|
9999 { |
|
10000 identifier_c param_name("IN"); |
|
10001 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10002 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10003 |
|
10004 /* Get the value from a foo(<param_value>) style call */ |
|
10005 if (IN_param_value == NULL) |
|
10006 IN_param_value = function_call_param_iterator.next(); |
|
10007 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10008 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10009 |
|
10010 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10011 { |
|
10012 |
|
10013 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
10014 s4o.print("("); |
|
10015 return_type_symbol->accept(*this); |
|
10016 s4o.print(")__string_to_sint("); |
|
10017 IN_param_value->accept(*this); |
|
10018 s4o.print(")"); |
|
10019 return NULL; |
|
10020 |
|
10021 } |
|
10022 |
|
10023 ERROR; |
|
10024 } |
|
10025 |
|
10026 }/*function_string_to_sint*/ |
|
10027 break; |
|
10028 |
|
10029 /**** |
|
10030 *STRING_TO_INT |
|
10031 */ |
|
10032 case function_string_to_int : |
|
10033 { |
|
10034 symbol_c *last_type_symbol = NULL; |
|
10035 |
|
10036 { |
|
10037 identifier_c param_name("IN"); |
|
10038 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10039 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10040 |
|
10041 /* Get the value from a foo(<param_value>) style call */ |
|
10042 if (IN_param_value == NULL) |
|
10043 IN_param_value = function_call_param_iterator.next(); |
|
10044 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10045 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10046 |
|
10047 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10048 { |
|
10049 |
|
10050 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
10051 s4o.print("("); |
|
10052 return_type_symbol->accept(*this); |
|
10053 s4o.print(")__string_to_sint("); |
|
10054 IN_param_value->accept(*this); |
|
10055 s4o.print(")"); |
|
10056 return NULL; |
|
10057 |
|
10058 } |
|
10059 |
|
10060 ERROR; |
|
10061 } |
|
10062 |
|
10063 }/*function_string_to_int*/ |
|
10064 break; |
|
10065 |
|
10066 /**** |
|
10067 *STRING_TO_DINT |
|
10068 */ |
|
10069 case function_string_to_dint : |
|
10070 { |
|
10071 symbol_c *last_type_symbol = NULL; |
|
10072 |
|
10073 { |
|
10074 identifier_c param_name("IN"); |
|
10075 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10076 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10077 |
|
10078 /* Get the value from a foo(<param_value>) style call */ |
|
10079 if (IN_param_value == NULL) |
|
10080 IN_param_value = function_call_param_iterator.next(); |
|
10081 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10082 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10083 |
|
10084 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10085 { |
|
10086 |
|
10087 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
10088 s4o.print("("); |
|
10089 return_type_symbol->accept(*this); |
|
10090 s4o.print(")__string_to_sint("); |
|
10091 IN_param_value->accept(*this); |
|
10092 s4o.print(")"); |
|
10093 return NULL; |
|
10094 |
|
10095 } |
|
10096 |
|
10097 ERROR; |
|
10098 } |
|
10099 |
|
10100 }/*function_string_to_dint*/ |
|
10101 break; |
|
10102 |
|
10103 /**** |
|
10104 *STRING_TO_LINT |
|
10105 */ |
|
10106 case function_string_to_lint : |
|
10107 { |
|
10108 symbol_c *last_type_symbol = NULL; |
|
10109 |
|
10110 { |
|
10111 identifier_c param_name("IN"); |
|
10112 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10113 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10114 |
|
10115 /* Get the value from a foo(<param_value>) style call */ |
|
10116 if (IN_param_value == NULL) |
|
10117 IN_param_value = function_call_param_iterator.next(); |
|
10118 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10119 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10120 |
|
10121 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10122 { |
|
10123 |
|
10124 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
10125 s4o.print("("); |
|
10126 return_type_symbol->accept(*this); |
|
10127 s4o.print(")__string_to_sint("); |
|
10128 IN_param_value->accept(*this); |
|
10129 s4o.print(")"); |
|
10130 return NULL; |
|
10131 |
|
10132 } |
|
10133 |
|
10134 ERROR; |
|
10135 } |
|
10136 |
|
10137 }/*function_string_to_lint*/ |
|
10138 break; |
|
10139 |
|
10140 /**** |
|
10141 *STRING_TO_USINT |
|
10142 */ |
|
10143 case function_string_to_usint : |
|
10144 { |
|
10145 symbol_c *last_type_symbol = NULL; |
|
10146 |
|
10147 { |
|
10148 identifier_c param_name("IN"); |
|
10149 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10150 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10151 |
|
10152 /* Get the value from a foo(<param_value>) style call */ |
|
10153 if (IN_param_value == NULL) |
|
10154 IN_param_value = function_call_param_iterator.next(); |
|
10155 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10156 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10157 |
|
10158 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10159 { |
|
10160 |
|
10161 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
10162 s4o.print("("); |
|
10163 return_type_symbol->accept(*this); |
|
10164 s4o.print(")__string_to_uint("); |
|
10165 IN_param_value->accept(*this); |
|
10166 s4o.print(")"); |
|
10167 return NULL; |
|
10168 |
|
10169 } |
|
10170 |
|
10171 ERROR; |
|
10172 } |
|
10173 |
|
10174 }/*function_string_to_usint*/ |
|
10175 break; |
|
10176 |
|
10177 /**** |
|
10178 *STRING_TO_UINT |
|
10179 */ |
|
10180 case function_string_to_uint : |
|
10181 { |
|
10182 symbol_c *last_type_symbol = NULL; |
|
10183 |
|
10184 { |
|
10185 identifier_c param_name("IN"); |
|
10186 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10187 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10188 |
|
10189 /* Get the value from a foo(<param_value>) style call */ |
|
10190 if (IN_param_value == NULL) |
|
10191 IN_param_value = function_call_param_iterator.next(); |
|
10192 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10193 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10194 |
|
10195 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10196 { |
|
10197 |
|
10198 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
10199 s4o.print("("); |
|
10200 return_type_symbol->accept(*this); |
|
10201 s4o.print(")__string_to_uint("); |
|
10202 IN_param_value->accept(*this); |
|
10203 s4o.print(")"); |
|
10204 return NULL; |
|
10205 |
|
10206 } |
|
10207 |
|
10208 ERROR; |
|
10209 } |
|
10210 |
|
10211 }/*function_string_to_uint*/ |
|
10212 break; |
|
10213 |
|
10214 /**** |
|
10215 *STRING_TO_UDINT |
|
10216 */ |
|
10217 case function_string_to_udint : |
|
10218 { |
|
10219 symbol_c *last_type_symbol = NULL; |
|
10220 |
|
10221 { |
|
10222 identifier_c param_name("IN"); |
|
10223 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10224 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10225 |
|
10226 /* Get the value from a foo(<param_value>) style call */ |
|
10227 if (IN_param_value == NULL) |
|
10228 IN_param_value = function_call_param_iterator.next(); |
|
10229 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10230 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10231 |
|
10232 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10233 { |
|
10234 |
|
10235 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
10236 s4o.print("("); |
|
10237 return_type_symbol->accept(*this); |
|
10238 s4o.print(")__string_to_uint("); |
|
10239 IN_param_value->accept(*this); |
|
10240 s4o.print(")"); |
|
10241 return NULL; |
|
10242 |
|
10243 } |
|
10244 |
|
10245 ERROR; |
|
10246 } |
|
10247 |
|
10248 }/*function_string_to_udint*/ |
|
10249 break; |
|
10250 |
|
10251 /**** |
|
10252 *STRING_TO_ULINT |
|
10253 */ |
|
10254 case function_string_to_ulint : |
|
10255 { |
|
10256 symbol_c *last_type_symbol = NULL; |
|
10257 |
|
10258 { |
|
10259 identifier_c param_name("IN"); |
|
10260 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10261 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10262 |
|
10263 /* Get the value from a foo(<param_value>) style call */ |
|
10264 if (IN_param_value == NULL) |
|
10265 IN_param_value = function_call_param_iterator.next(); |
|
10266 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10267 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10268 |
|
10269 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10270 { |
|
10271 |
|
10272 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
10273 s4o.print("("); |
|
10274 return_type_symbol->accept(*this); |
|
10275 s4o.print(")__string_to_uint("); |
|
10276 IN_param_value->accept(*this); |
|
10277 s4o.print(")"); |
|
10278 return NULL; |
|
10279 |
|
10280 } |
|
10281 |
|
10282 ERROR; |
|
10283 } |
|
10284 |
|
10285 }/*function_string_to_ulint*/ |
|
10286 break; |
|
10287 |
|
10288 /**** |
|
10289 *STRING_TO_REAL |
|
10290 */ |
|
10291 case function_string_to_real : |
|
10292 { |
|
10293 symbol_c *last_type_symbol = NULL; |
|
10294 |
|
10295 { |
|
10296 identifier_c param_name("IN"); |
|
10297 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10298 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10299 |
|
10300 /* Get the value from a foo(<param_value>) style call */ |
|
10301 if (IN_param_value == NULL) |
|
10302 IN_param_value = function_call_param_iterator.next(); |
|
10303 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10304 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10305 |
|
10306 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10307 { |
|
10308 |
|
10309 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
10310 s4o.print("("); |
|
10311 return_type_symbol->accept(*this); |
|
10312 s4o.print(")__string_to_real("); |
|
10313 IN_param_value->accept(*this); |
|
10314 s4o.print(")"); |
|
10315 return NULL; |
|
10316 |
|
10317 } |
|
10318 |
|
10319 ERROR; |
|
10320 } |
|
10321 |
|
10322 }/*function_string_to_real*/ |
|
10323 break; |
|
10324 |
|
10325 /**** |
|
10326 *STRING_TO_LREAL |
|
10327 */ |
|
10328 case function_string_to_lreal : |
|
10329 { |
|
10330 symbol_c *last_type_symbol = NULL; |
|
10331 |
|
10332 { |
|
10333 identifier_c param_name("IN"); |
|
10334 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10335 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10336 |
|
10337 /* Get the value from a foo(<param_value>) style call */ |
|
10338 if (IN_param_value == NULL) |
|
10339 IN_param_value = function_call_param_iterator.next(); |
|
10340 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10341 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10342 |
|
10343 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10344 { |
|
10345 |
|
10346 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
10347 s4o.print("("); |
|
10348 return_type_symbol->accept(*this); |
|
10349 s4o.print(")__string_to_real("); |
|
10350 IN_param_value->accept(*this); |
|
10351 s4o.print(")"); |
|
10352 return NULL; |
|
10353 |
|
10354 } |
|
10355 |
|
10356 ERROR; |
|
10357 } |
|
10358 |
|
10359 }/*function_string_to_lreal*/ |
|
10360 break; |
|
10361 |
|
10362 /**** |
|
10363 *STRING_TO_TIME |
|
10364 */ |
|
10365 case function_string_to_time : |
|
10366 { |
|
10367 symbol_c *last_type_symbol = NULL; |
|
10368 |
|
10369 { |
|
10370 identifier_c param_name("IN"); |
|
10371 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10372 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10373 |
|
10374 /* Get the value from a foo(<param_value>) style call */ |
|
10375 if (IN_param_value == NULL) |
|
10376 IN_param_value = function_call_param_iterator.next(); |
|
10377 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10378 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10379 |
|
10380 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10381 { |
|
10382 |
|
10383 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
10384 s4o.print("("); |
|
10385 return_type_symbol->accept(*this); |
|
10386 s4o.print(")__string_to_time("); |
|
10387 IN_param_value->accept(*this); |
|
10388 s4o.print(")"); |
|
10389 return NULL; |
|
10390 |
|
10391 } |
|
10392 |
|
10393 ERROR; |
|
10394 } |
|
10395 |
|
10396 }/*function_string_to_time*/ |
|
10397 break; |
|
10398 |
|
10399 /**** |
|
10400 *STRING_TO_DATE |
|
10401 */ |
|
10402 case function_string_to_date : |
|
10403 { |
|
10404 symbol_c *last_type_symbol = NULL; |
|
10405 |
|
10406 { |
|
10407 identifier_c param_name("IN"); |
|
10408 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10409 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10410 |
|
10411 /* Get the value from a foo(<param_value>) style call */ |
|
10412 if (IN_param_value == NULL) |
|
10413 IN_param_value = function_call_param_iterator.next(); |
|
10414 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10415 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10416 |
|
10417 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10418 { |
|
10419 |
|
10420 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
10421 s4o.print("("); |
|
10422 return_type_symbol->accept(*this); |
|
10423 s4o.print(")__string_to_time("); |
|
10424 IN_param_value->accept(*this); |
|
10425 s4o.print(")"); |
|
10426 return NULL; |
|
10427 |
|
10428 } |
|
10429 |
|
10430 ERROR; |
|
10431 } |
|
10432 |
|
10433 }/*function_string_to_date*/ |
|
10434 break; |
|
10435 |
|
10436 /**** |
|
10437 *STRING_TO_TOD |
|
10438 */ |
|
10439 case function_string_to_tod : |
|
10440 { |
|
10441 symbol_c *last_type_symbol = NULL; |
|
10442 |
|
10443 { |
|
10444 identifier_c param_name("IN"); |
|
10445 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10446 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10447 |
|
10448 /* Get the value from a foo(<param_value>) style call */ |
|
10449 if (IN_param_value == NULL) |
|
10450 IN_param_value = function_call_param_iterator.next(); |
|
10451 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10452 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10453 |
|
10454 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10455 { |
|
10456 |
|
10457 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
10458 s4o.print("("); |
|
10459 return_type_symbol->accept(*this); |
|
10460 s4o.print(")__string_to_time("); |
|
10461 IN_param_value->accept(*this); |
|
10462 s4o.print(")"); |
|
10463 return NULL; |
|
10464 |
|
10465 } |
|
10466 |
|
10467 ERROR; |
|
10468 } |
|
10469 |
|
10470 }/*function_string_to_tod*/ |
|
10471 break; |
|
10472 |
|
10473 /**** |
|
10474 *STRING_TO_DT |
|
10475 */ |
|
10476 case function_string_to_dt : |
|
10477 { |
|
10478 symbol_c *last_type_symbol = NULL; |
|
10479 |
|
10480 { |
|
10481 identifier_c param_name("IN"); |
|
10482 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10483 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10484 |
|
10485 /* Get the value from a foo(<param_value>) style call */ |
|
10486 if (IN_param_value == NULL) |
|
10487 IN_param_value = function_call_param_iterator.next(); |
|
10488 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10489 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10490 |
|
10491 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10492 { |
|
10493 |
|
10494 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
10495 s4o.print("("); |
|
10496 return_type_symbol->accept(*this); |
|
10497 s4o.print(")__string_to_time("); |
|
10498 IN_param_value->accept(*this); |
|
10499 s4o.print(")"); |
|
10500 return NULL; |
|
10501 |
|
10502 } |
|
10503 |
|
10504 ERROR; |
|
10505 } |
|
10506 |
|
10507 }/*function_string_to_dt*/ |
|
10508 break; |
|
10509 |
|
10510 /**** |
|
10511 *STRING_TO_BYTE |
|
10512 */ |
|
10513 case function_string_to_byte : |
|
10514 { |
|
10515 symbol_c *last_type_symbol = NULL; |
|
10516 |
|
10517 { |
|
10518 identifier_c param_name("IN"); |
|
10519 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10520 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10521 |
|
10522 /* Get the value from a foo(<param_value>) style call */ |
|
10523 if (IN_param_value == NULL) |
|
10524 IN_param_value = function_call_param_iterator.next(); |
|
10525 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10526 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10527 |
|
10528 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10529 { |
|
10530 |
|
10531 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
10532 s4o.print("("); |
|
10533 return_type_symbol->accept(*this); |
|
10534 s4o.print(")__string_to_bit("); |
|
10535 IN_param_value->accept(*this); |
|
10536 s4o.print(")"); |
|
10537 return NULL; |
|
10538 |
|
10539 } |
|
10540 |
|
10541 ERROR; |
|
10542 } |
|
10543 |
|
10544 }/*function_string_to_byte*/ |
|
10545 break; |
|
10546 |
|
10547 /**** |
|
10548 *STRING_TO_WORD |
|
10549 */ |
|
10550 case function_string_to_word : |
|
10551 { |
|
10552 symbol_c *last_type_symbol = NULL; |
|
10553 |
|
10554 { |
|
10555 identifier_c param_name("IN"); |
|
10556 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10557 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10558 |
|
10559 /* Get the value from a foo(<param_value>) style call */ |
|
10560 if (IN_param_value == NULL) |
|
10561 IN_param_value = function_call_param_iterator.next(); |
|
10562 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10563 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10564 |
|
10565 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10566 { |
|
10567 |
|
10568 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
10569 s4o.print("("); |
|
10570 return_type_symbol->accept(*this); |
|
10571 s4o.print(")__string_to_bit("); |
|
10572 IN_param_value->accept(*this); |
|
10573 s4o.print(")"); |
|
10574 return NULL; |
|
10575 |
|
10576 } |
|
10577 |
|
10578 ERROR; |
|
10579 } |
|
10580 |
|
10581 }/*function_string_to_word*/ |
|
10582 break; |
|
10583 |
|
10584 /**** |
|
10585 *STRING_TO_DWORD |
|
10586 */ |
|
10587 case function_string_to_dword : |
|
10588 { |
|
10589 symbol_c *last_type_symbol = NULL; |
|
10590 |
|
10591 { |
|
10592 identifier_c param_name("IN"); |
|
10593 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10594 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10595 |
|
10596 /* Get the value from a foo(<param_value>) style call */ |
|
10597 if (IN_param_value == NULL) |
|
10598 IN_param_value = function_call_param_iterator.next(); |
|
10599 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10600 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10601 |
|
10602 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10603 { |
|
10604 |
|
10605 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
10606 s4o.print("("); |
|
10607 return_type_symbol->accept(*this); |
|
10608 s4o.print(")__string_to_bit("); |
|
10609 IN_param_value->accept(*this); |
|
10610 s4o.print(")"); |
|
10611 return NULL; |
|
10612 |
|
10613 } |
|
10614 |
|
10615 ERROR; |
|
10616 } |
|
10617 |
|
10618 }/*function_string_to_dword*/ |
|
10619 break; |
|
10620 |
|
10621 /**** |
|
10622 *STRING_TO_LWORD |
|
10623 */ |
|
10624 case function_string_to_lword : |
|
10625 { |
|
10626 symbol_c *last_type_symbol = NULL; |
|
10627 |
|
10628 { |
|
10629 identifier_c param_name("IN"); |
|
10630 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10631 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10632 |
|
10633 /* Get the value from a foo(<param_value>) style call */ |
|
10634 if (IN_param_value == NULL) |
|
10635 IN_param_value = function_call_param_iterator.next(); |
|
10636 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10637 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10638 |
|
10639 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
10640 { |
|
10641 |
|
10642 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
10643 s4o.print("("); |
|
10644 return_type_symbol->accept(*this); |
|
10645 s4o.print(")__string_to_bit("); |
|
10646 IN_param_value->accept(*this); |
|
10647 s4o.print(")"); |
|
10648 return NULL; |
|
10649 |
|
10650 } |
|
10651 |
|
10652 ERROR; |
|
10653 } |
|
10654 |
|
10655 }/*function_string_to_lword*/ |
|
10656 break; |
|
10657 |
|
10658 /**** |
|
10659 *BYTE_TO_BOOL |
|
10660 */ |
|
10661 case function_byte_to_bool : |
|
10662 { |
|
10663 symbol_c *last_type_symbol = NULL; |
|
10664 |
|
10665 { |
|
10666 identifier_c param_name("IN"); |
|
10667 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10668 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10669 |
|
10670 /* Get the value from a foo(<param_value>) style call */ |
|
10671 if (IN_param_value == NULL) |
|
10672 IN_param_value = function_call_param_iterator.next(); |
|
10673 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10674 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10675 |
|
10676 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10677 { |
|
10678 |
|
10679 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
10680 s4o.print("("); |
|
10681 return_type_symbol->accept(*this); |
|
10682 s4o.print(")"); |
|
10683 IN_param_value->accept(*this); |
|
10684 return NULL; |
|
10685 |
|
10686 } |
|
10687 |
|
10688 ERROR; |
|
10689 } |
|
10690 |
|
10691 }/*function_byte_to_bool*/ |
|
10692 break; |
|
10693 |
|
10694 /**** |
|
10695 *BYTE_TO_SINT |
|
10696 */ |
|
10697 case function_byte_to_sint : |
|
10698 { |
|
10699 symbol_c *last_type_symbol = NULL; |
|
10700 |
|
10701 { |
|
10702 identifier_c param_name("IN"); |
|
10703 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10704 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10705 |
|
10706 /* Get the value from a foo(<param_value>) style call */ |
|
10707 if (IN_param_value == NULL) |
|
10708 IN_param_value = function_call_param_iterator.next(); |
|
10709 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10710 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10711 |
|
10712 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10713 { |
|
10714 |
|
10715 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
10716 s4o.print("("); |
|
10717 return_type_symbol->accept(*this); |
|
10718 s4o.print(")"); |
|
10719 IN_param_value->accept(*this); |
|
10720 return NULL; |
|
10721 |
|
10722 } |
|
10723 |
|
10724 ERROR; |
|
10725 } |
|
10726 |
|
10727 }/*function_byte_to_sint*/ |
|
10728 break; |
|
10729 |
|
10730 /**** |
|
10731 *BYTE_TO_INT |
|
10732 */ |
|
10733 case function_byte_to_int : |
|
10734 { |
|
10735 symbol_c *last_type_symbol = NULL; |
|
10736 |
|
10737 { |
|
10738 identifier_c param_name("IN"); |
|
10739 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10740 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10741 |
|
10742 /* Get the value from a foo(<param_value>) style call */ |
|
10743 if (IN_param_value == NULL) |
|
10744 IN_param_value = function_call_param_iterator.next(); |
|
10745 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10746 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10747 |
|
10748 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10749 { |
|
10750 |
|
10751 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
10752 s4o.print("("); |
|
10753 return_type_symbol->accept(*this); |
|
10754 s4o.print(")"); |
|
10755 IN_param_value->accept(*this); |
|
10756 return NULL; |
|
10757 |
|
10758 } |
|
10759 |
|
10760 ERROR; |
|
10761 } |
|
10762 |
|
10763 }/*function_byte_to_int*/ |
|
10764 break; |
|
10765 |
|
10766 /**** |
|
10767 *BYTE_TO_DINT |
|
10768 */ |
|
10769 case function_byte_to_dint : |
|
10770 { |
|
10771 symbol_c *last_type_symbol = NULL; |
|
10772 |
|
10773 { |
|
10774 identifier_c param_name("IN"); |
|
10775 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10776 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10777 |
|
10778 /* Get the value from a foo(<param_value>) style call */ |
|
10779 if (IN_param_value == NULL) |
|
10780 IN_param_value = function_call_param_iterator.next(); |
|
10781 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10782 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10783 |
|
10784 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10785 { |
|
10786 |
|
10787 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
10788 s4o.print("("); |
|
10789 return_type_symbol->accept(*this); |
|
10790 s4o.print(")"); |
|
10791 IN_param_value->accept(*this); |
|
10792 return NULL; |
|
10793 |
|
10794 } |
|
10795 |
|
10796 ERROR; |
|
10797 } |
|
10798 |
|
10799 }/*function_byte_to_dint*/ |
|
10800 break; |
|
10801 |
|
10802 /**** |
|
10803 *BYTE_TO_LINT |
|
10804 */ |
|
10805 case function_byte_to_lint : |
|
10806 { |
|
10807 symbol_c *last_type_symbol = NULL; |
|
10808 |
|
10809 { |
|
10810 identifier_c param_name("IN"); |
|
10811 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10812 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10813 |
|
10814 /* Get the value from a foo(<param_value>) style call */ |
|
10815 if (IN_param_value == NULL) |
|
10816 IN_param_value = function_call_param_iterator.next(); |
|
10817 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10818 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10819 |
|
10820 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10821 { |
|
10822 |
|
10823 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
10824 s4o.print("("); |
|
10825 return_type_symbol->accept(*this); |
|
10826 s4o.print(")"); |
|
10827 IN_param_value->accept(*this); |
|
10828 return NULL; |
|
10829 |
|
10830 } |
|
10831 |
|
10832 ERROR; |
|
10833 } |
|
10834 |
|
10835 }/*function_byte_to_lint*/ |
|
10836 break; |
|
10837 |
|
10838 /**** |
|
10839 *BYTE_TO_USINT |
|
10840 */ |
|
10841 case function_byte_to_usint : |
|
10842 { |
|
10843 symbol_c *last_type_symbol = NULL; |
|
10844 |
|
10845 { |
|
10846 identifier_c param_name("IN"); |
|
10847 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10848 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10849 |
|
10850 /* Get the value from a foo(<param_value>) style call */ |
|
10851 if (IN_param_value == NULL) |
|
10852 IN_param_value = function_call_param_iterator.next(); |
|
10853 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10854 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10855 |
|
10856 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10857 { |
|
10858 |
|
10859 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
10860 s4o.print("("); |
|
10861 return_type_symbol->accept(*this); |
|
10862 s4o.print(")"); |
|
10863 IN_param_value->accept(*this); |
|
10864 return NULL; |
|
10865 |
|
10866 } |
|
10867 |
|
10868 ERROR; |
|
10869 } |
|
10870 |
|
10871 }/*function_byte_to_usint*/ |
|
10872 break; |
|
10873 |
|
10874 /**** |
|
10875 *BYTE_TO_UINT |
|
10876 */ |
|
10877 case function_byte_to_uint : |
|
10878 { |
|
10879 symbol_c *last_type_symbol = NULL; |
|
10880 |
|
10881 { |
|
10882 identifier_c param_name("IN"); |
|
10883 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10884 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10885 |
|
10886 /* Get the value from a foo(<param_value>) style call */ |
|
10887 if (IN_param_value == NULL) |
|
10888 IN_param_value = function_call_param_iterator.next(); |
|
10889 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10890 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10891 |
|
10892 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10893 { |
|
10894 |
|
10895 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
10896 s4o.print("("); |
|
10897 return_type_symbol->accept(*this); |
|
10898 s4o.print(")"); |
|
10899 IN_param_value->accept(*this); |
|
10900 return NULL; |
|
10901 |
|
10902 } |
|
10903 |
|
10904 ERROR; |
|
10905 } |
|
10906 |
|
10907 }/*function_byte_to_uint*/ |
|
10908 break; |
|
10909 |
|
10910 /**** |
|
10911 *BYTE_TO_UDINT |
|
10912 */ |
|
10913 case function_byte_to_udint : |
|
10914 { |
|
10915 symbol_c *last_type_symbol = NULL; |
|
10916 |
|
10917 { |
|
10918 identifier_c param_name("IN"); |
|
10919 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10920 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10921 |
|
10922 /* Get the value from a foo(<param_value>) style call */ |
|
10923 if (IN_param_value == NULL) |
|
10924 IN_param_value = function_call_param_iterator.next(); |
|
10925 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10926 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10927 |
|
10928 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10929 { |
|
10930 |
|
10931 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
10932 s4o.print("("); |
|
10933 return_type_symbol->accept(*this); |
|
10934 s4o.print(")"); |
|
10935 IN_param_value->accept(*this); |
|
10936 return NULL; |
|
10937 |
|
10938 } |
|
10939 |
|
10940 ERROR; |
|
10941 } |
|
10942 |
|
10943 }/*function_byte_to_udint*/ |
|
10944 break; |
|
10945 |
|
10946 /**** |
|
10947 *BYTE_TO_ULINT |
|
10948 */ |
|
10949 case function_byte_to_ulint : |
|
10950 { |
|
10951 symbol_c *last_type_symbol = NULL; |
|
10952 |
|
10953 { |
|
10954 identifier_c param_name("IN"); |
|
10955 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10956 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10957 |
|
10958 /* Get the value from a foo(<param_value>) style call */ |
|
10959 if (IN_param_value == NULL) |
|
10960 IN_param_value = function_call_param_iterator.next(); |
|
10961 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10962 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10963 |
|
10964 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10965 { |
|
10966 |
|
10967 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
10968 s4o.print("("); |
|
10969 return_type_symbol->accept(*this); |
|
10970 s4o.print(")"); |
|
10971 IN_param_value->accept(*this); |
|
10972 return NULL; |
|
10973 |
|
10974 } |
|
10975 |
|
10976 ERROR; |
|
10977 } |
|
10978 |
|
10979 }/*function_byte_to_ulint*/ |
|
10980 break; |
|
10981 |
|
10982 /**** |
|
10983 *BYTE_TO_REAL |
|
10984 */ |
|
10985 case function_byte_to_real : |
|
10986 { |
|
10987 symbol_c *last_type_symbol = NULL; |
|
10988 |
|
10989 { |
|
10990 identifier_c param_name("IN"); |
|
10991 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10992 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10993 |
|
10994 /* Get the value from a foo(<param_value>) style call */ |
|
10995 if (IN_param_value == NULL) |
|
10996 IN_param_value = function_call_param_iterator.next(); |
|
10997 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10998 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10999 |
|
11000 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
11001 { |
|
11002 |
|
11003 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
11004 s4o.print("("); |
|
11005 return_type_symbol->accept(*this); |
|
11006 s4o.print(")"); |
|
11007 IN_param_value->accept(*this); |
|
11008 return NULL; |
|
11009 |
|
11010 } |
|
11011 |
|
11012 ERROR; |
|
11013 } |
|
11014 |
|
11015 }/*function_byte_to_real*/ |
|
11016 break; |
|
11017 |
|
11018 /**** |
|
11019 *BYTE_TO_LREAL |
|
11020 */ |
|
11021 case function_byte_to_lreal : |
|
11022 { |
|
11023 symbol_c *last_type_symbol = NULL; |
|
11024 |
|
11025 { |
|
11026 identifier_c param_name("IN"); |
|
11027 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11028 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11029 |
|
11030 /* Get the value from a foo(<param_value>) style call */ |
|
11031 if (IN_param_value == NULL) |
|
11032 IN_param_value = function_call_param_iterator.next(); |
|
11033 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11034 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11035 |
|
11036 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
11037 { |
|
11038 |
|
11039 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
11040 s4o.print("("); |
|
11041 return_type_symbol->accept(*this); |
|
11042 s4o.print(")"); |
|
11043 IN_param_value->accept(*this); |
|
11044 return NULL; |
|
11045 |
|
11046 } |
|
11047 |
|
11048 ERROR; |
|
11049 } |
|
11050 |
|
11051 }/*function_byte_to_lreal*/ |
|
11052 break; |
|
11053 |
|
11054 /**** |
|
11055 *BYTE_TO_TIME |
|
11056 */ |
|
11057 case function_byte_to_time : |
|
11058 { |
|
11059 symbol_c *last_type_symbol = NULL; |
|
11060 |
|
11061 { |
|
11062 identifier_c param_name("IN"); |
|
11063 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11064 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11065 |
|
11066 /* Get the value from a foo(<param_value>) style call */ |
|
11067 if (IN_param_value == NULL) |
|
11068 IN_param_value = function_call_param_iterator.next(); |
|
11069 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11070 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11071 |
|
11072 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
11073 { |
|
11074 |
|
11075 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
11076 s4o.print("("); |
|
11077 return_type_symbol->accept(*this); |
|
11078 s4o.print(")__int_to_time("); |
|
11079 IN_param_value->accept(*this); |
|
11080 s4o.print(")"); |
|
11081 return NULL; |
|
11082 |
|
11083 } |
|
11084 |
|
11085 ERROR; |
|
11086 } |
|
11087 |
|
11088 }/*function_byte_to_time*/ |
|
11089 break; |
|
11090 |
|
11091 /**** |
|
11092 *BYTE_TO_DATE |
|
11093 */ |
|
11094 case function_byte_to_date : |
|
11095 { |
|
11096 symbol_c *last_type_symbol = NULL; |
|
11097 |
|
11098 { |
|
11099 identifier_c param_name("IN"); |
|
11100 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11101 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11102 |
|
11103 /* Get the value from a foo(<param_value>) style call */ |
|
11104 if (IN_param_value == NULL) |
|
11105 IN_param_value = function_call_param_iterator.next(); |
|
11106 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11107 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11108 |
|
11109 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
11110 { |
|
11111 |
|
11112 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
11113 s4o.print("("); |
|
11114 return_type_symbol->accept(*this); |
|
11115 s4o.print(")__int_to_time("); |
|
11116 IN_param_value->accept(*this); |
|
11117 s4o.print(")"); |
|
11118 return NULL; |
|
11119 |
|
11120 } |
|
11121 |
|
11122 ERROR; |
|
11123 } |
|
11124 |
|
11125 }/*function_byte_to_date*/ |
|
11126 break; |
|
11127 |
|
11128 /**** |
|
11129 *BYTE_TO_TOD |
|
11130 */ |
|
11131 case function_byte_to_tod : |
|
11132 { |
|
11133 symbol_c *last_type_symbol = NULL; |
|
11134 |
|
11135 { |
|
11136 identifier_c param_name("IN"); |
|
11137 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11138 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11139 |
|
11140 /* Get the value from a foo(<param_value>) style call */ |
|
11141 if (IN_param_value == NULL) |
|
11142 IN_param_value = function_call_param_iterator.next(); |
|
11143 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11144 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11145 |
|
11146 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
11147 { |
|
11148 |
|
11149 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
11150 s4o.print("("); |
|
11151 return_type_symbol->accept(*this); |
|
11152 s4o.print(")__int_to_time("); |
|
11153 IN_param_value->accept(*this); |
|
11154 s4o.print(")"); |
|
11155 return NULL; |
|
11156 |
|
11157 } |
|
11158 |
|
11159 ERROR; |
|
11160 } |
|
11161 |
|
11162 }/*function_byte_to_tod*/ |
|
11163 break; |
|
11164 |
|
11165 /**** |
|
11166 *BYTE_TO_DT |
|
11167 */ |
|
11168 case function_byte_to_dt : |
|
11169 { |
|
11170 symbol_c *last_type_symbol = NULL; |
|
11171 |
|
11172 { |
|
11173 identifier_c param_name("IN"); |
|
11174 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11175 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11176 |
|
11177 /* Get the value from a foo(<param_value>) style call */ |
|
11178 if (IN_param_value == NULL) |
|
11179 IN_param_value = function_call_param_iterator.next(); |
|
11180 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11181 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11182 |
|
11183 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
11184 { |
|
11185 |
|
11186 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
11187 s4o.print("("); |
|
11188 return_type_symbol->accept(*this); |
|
11189 s4o.print(")__int_to_time("); |
|
11190 IN_param_value->accept(*this); |
|
11191 s4o.print(")"); |
|
11192 return NULL; |
|
11193 |
|
11194 } |
|
11195 |
|
11196 ERROR; |
|
11197 } |
|
11198 |
|
11199 }/*function_byte_to_dt*/ |
|
11200 break; |
|
11201 |
|
11202 /**** |
|
11203 *BYTE_TO_STRING |
|
11204 */ |
|
11205 case function_byte_to_string : |
|
11206 { |
|
11207 symbol_c *last_type_symbol = NULL; |
|
11208 |
|
11209 { |
|
11210 identifier_c param_name("IN"); |
|
11211 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11212 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11213 |
|
11214 /* Get the value from a foo(<param_value>) style call */ |
|
11215 if (IN_param_value == NULL) |
|
11216 IN_param_value = function_call_param_iterator.next(); |
|
11217 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11218 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11219 |
|
11220 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
11221 { |
|
11222 |
|
11223 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
11224 s4o.print("("); |
|
11225 return_type_symbol->accept(*this); |
|
11226 s4o.print(")__bit_to_string("); |
|
11227 IN_param_value->accept(*this); |
|
11228 s4o.print(")"); |
|
11229 return NULL; |
|
11230 |
|
11231 } |
|
11232 |
|
11233 ERROR; |
|
11234 } |
|
11235 |
|
11236 }/*function_byte_to_string*/ |
|
11237 break; |
|
11238 |
|
11239 /**** |
|
11240 *BYTE_TO_WORD |
|
11241 */ |
|
11242 case function_byte_to_word : |
|
11243 { |
|
11244 symbol_c *last_type_symbol = NULL; |
|
11245 |
|
11246 { |
|
11247 identifier_c param_name("IN"); |
|
11248 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11249 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11250 |
|
11251 /* Get the value from a foo(<param_value>) style call */ |
|
11252 if (IN_param_value == NULL) |
|
11253 IN_param_value = function_call_param_iterator.next(); |
|
11254 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11255 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11256 |
|
11257 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
11258 { |
|
11259 |
|
11260 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
11261 s4o.print("("); |
|
11262 return_type_symbol->accept(*this); |
|
11263 s4o.print(")"); |
|
11264 IN_param_value->accept(*this); |
|
11265 return NULL; |
|
11266 |
|
11267 } |
|
11268 |
|
11269 ERROR; |
|
11270 } |
|
11271 |
|
11272 }/*function_byte_to_word*/ |
|
11273 break; |
|
11274 |
|
11275 /**** |
|
11276 *BYTE_TO_DWORD |
|
11277 */ |
|
11278 case function_byte_to_dword : |
|
11279 { |
|
11280 symbol_c *last_type_symbol = NULL; |
|
11281 |
|
11282 { |
|
11283 identifier_c param_name("IN"); |
|
11284 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11285 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11286 |
|
11287 /* Get the value from a foo(<param_value>) style call */ |
|
11288 if (IN_param_value == NULL) |
|
11289 IN_param_value = function_call_param_iterator.next(); |
|
11290 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11291 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11292 |
|
11293 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
11294 { |
|
11295 |
|
11296 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
11297 s4o.print("("); |
|
11298 return_type_symbol->accept(*this); |
|
11299 s4o.print(")"); |
|
11300 IN_param_value->accept(*this); |
|
11301 return NULL; |
|
11302 |
|
11303 } |
|
11304 |
|
11305 ERROR; |
|
11306 } |
|
11307 |
|
11308 }/*function_byte_to_dword*/ |
|
11309 break; |
|
11310 |
|
11311 /**** |
|
11312 *BYTE_TO_LWORD |
|
11313 */ |
|
11314 case function_byte_to_lword : |
|
11315 { |
|
11316 symbol_c *last_type_symbol = NULL; |
|
11317 |
|
11318 { |
|
11319 identifier_c param_name("IN"); |
|
11320 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11321 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11322 |
|
11323 /* Get the value from a foo(<param_value>) style call */ |
|
11324 if (IN_param_value == NULL) |
|
11325 IN_param_value = function_call_param_iterator.next(); |
|
11326 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11327 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11328 |
|
11329 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
11330 { |
|
11331 |
|
11332 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
11333 s4o.print("("); |
|
11334 return_type_symbol->accept(*this); |
|
11335 s4o.print(")"); |
|
11336 IN_param_value->accept(*this); |
|
11337 return NULL; |
|
11338 |
|
11339 } |
|
11340 |
|
11341 ERROR; |
|
11342 } |
|
11343 |
|
11344 }/*function_byte_to_lword*/ |
|
11345 break; |
|
11346 |
|
11347 /**** |
|
11348 *WORD_TO_BOOL |
|
11349 */ |
|
11350 case function_word_to_bool : |
|
11351 { |
|
11352 symbol_c *last_type_symbol = NULL; |
|
11353 |
|
11354 { |
|
11355 identifier_c param_name("IN"); |
|
11356 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11357 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11358 |
|
11359 /* Get the value from a foo(<param_value>) style call */ |
|
11360 if (IN_param_value == NULL) |
|
11361 IN_param_value = function_call_param_iterator.next(); |
|
11362 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11363 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11364 |
|
11365 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11366 { |
|
11367 |
|
11368 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
11369 s4o.print("("); |
|
11370 return_type_symbol->accept(*this); |
|
11371 s4o.print(")"); |
|
11372 IN_param_value->accept(*this); |
|
11373 return NULL; |
|
11374 |
|
11375 } |
|
11376 |
|
11377 ERROR; |
|
11378 } |
|
11379 |
|
11380 }/*function_word_to_bool*/ |
|
11381 break; |
|
11382 |
|
11383 /**** |
|
11384 *WORD_TO_SINT |
|
11385 */ |
|
11386 case function_word_to_sint : |
|
11387 { |
|
11388 symbol_c *last_type_symbol = NULL; |
|
11389 |
|
11390 { |
|
11391 identifier_c param_name("IN"); |
|
11392 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11393 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11394 |
|
11395 /* Get the value from a foo(<param_value>) style call */ |
|
11396 if (IN_param_value == NULL) |
|
11397 IN_param_value = function_call_param_iterator.next(); |
|
11398 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11399 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11400 |
|
11401 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11402 { |
|
11403 |
|
11404 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
11405 s4o.print("("); |
|
11406 return_type_symbol->accept(*this); |
|
11407 s4o.print(")"); |
|
11408 IN_param_value->accept(*this); |
|
11409 return NULL; |
|
11410 |
|
11411 } |
|
11412 |
|
11413 ERROR; |
|
11414 } |
|
11415 |
|
11416 }/*function_word_to_sint*/ |
|
11417 break; |
|
11418 |
|
11419 /**** |
|
11420 *WORD_TO_INT |
|
11421 */ |
|
11422 case function_word_to_int : |
|
11423 { |
|
11424 symbol_c *last_type_symbol = NULL; |
|
11425 |
|
11426 { |
|
11427 identifier_c param_name("IN"); |
|
11428 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11429 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11430 |
|
11431 /* Get the value from a foo(<param_value>) style call */ |
|
11432 if (IN_param_value == NULL) |
|
11433 IN_param_value = function_call_param_iterator.next(); |
|
11434 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11435 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11436 |
|
11437 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11438 { |
|
11439 |
|
11440 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
11441 s4o.print("("); |
|
11442 return_type_symbol->accept(*this); |
|
11443 s4o.print(")"); |
|
11444 IN_param_value->accept(*this); |
|
11445 return NULL; |
|
11446 |
|
11447 } |
|
11448 |
|
11449 ERROR; |
|
11450 } |
|
11451 |
|
11452 }/*function_word_to_int*/ |
|
11453 break; |
|
11454 |
|
11455 /**** |
|
11456 *WORD_TO_DINT |
|
11457 */ |
|
11458 case function_word_to_dint : |
|
11459 { |
|
11460 symbol_c *last_type_symbol = NULL; |
|
11461 |
|
11462 { |
|
11463 identifier_c param_name("IN"); |
|
11464 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11465 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11466 |
|
11467 /* Get the value from a foo(<param_value>) style call */ |
|
11468 if (IN_param_value == NULL) |
|
11469 IN_param_value = function_call_param_iterator.next(); |
|
11470 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11471 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11472 |
|
11473 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11474 { |
|
11475 |
|
11476 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
11477 s4o.print("("); |
|
11478 return_type_symbol->accept(*this); |
|
11479 s4o.print(")"); |
|
11480 IN_param_value->accept(*this); |
|
11481 return NULL; |
|
11482 |
|
11483 } |
|
11484 |
|
11485 ERROR; |
|
11486 } |
|
11487 |
|
11488 }/*function_word_to_dint*/ |
|
11489 break; |
|
11490 |
|
11491 /**** |
|
11492 *WORD_TO_LINT |
|
11493 */ |
|
11494 case function_word_to_lint : |
|
11495 { |
|
11496 symbol_c *last_type_symbol = NULL; |
|
11497 |
|
11498 { |
|
11499 identifier_c param_name("IN"); |
|
11500 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11501 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11502 |
|
11503 /* Get the value from a foo(<param_value>) style call */ |
|
11504 if (IN_param_value == NULL) |
|
11505 IN_param_value = function_call_param_iterator.next(); |
|
11506 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11507 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11508 |
|
11509 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11510 { |
|
11511 |
|
11512 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
11513 s4o.print("("); |
|
11514 return_type_symbol->accept(*this); |
|
11515 s4o.print(")"); |
|
11516 IN_param_value->accept(*this); |
|
11517 return NULL; |
|
11518 |
|
11519 } |
|
11520 |
|
11521 ERROR; |
|
11522 } |
|
11523 |
|
11524 }/*function_word_to_lint*/ |
|
11525 break; |
|
11526 |
|
11527 /**** |
|
11528 *WORD_TO_USINT |
|
11529 */ |
|
11530 case function_word_to_usint : |
|
11531 { |
|
11532 symbol_c *last_type_symbol = NULL; |
|
11533 |
|
11534 { |
|
11535 identifier_c param_name("IN"); |
|
11536 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11537 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11538 |
|
11539 /* Get the value from a foo(<param_value>) style call */ |
|
11540 if (IN_param_value == NULL) |
|
11541 IN_param_value = function_call_param_iterator.next(); |
|
11542 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11543 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11544 |
|
11545 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11546 { |
|
11547 |
|
11548 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
11549 s4o.print("("); |
|
11550 return_type_symbol->accept(*this); |
|
11551 s4o.print(")"); |
|
11552 IN_param_value->accept(*this); |
|
11553 return NULL; |
|
11554 |
|
11555 } |
|
11556 |
|
11557 ERROR; |
|
11558 } |
|
11559 |
|
11560 }/*function_word_to_usint*/ |
|
11561 break; |
|
11562 |
|
11563 /**** |
|
11564 *WORD_TO_UINT |
|
11565 */ |
|
11566 case function_word_to_uint : |
|
11567 { |
|
11568 symbol_c *last_type_symbol = NULL; |
|
11569 |
|
11570 { |
|
11571 identifier_c param_name("IN"); |
|
11572 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11573 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11574 |
|
11575 /* Get the value from a foo(<param_value>) style call */ |
|
11576 if (IN_param_value == NULL) |
|
11577 IN_param_value = function_call_param_iterator.next(); |
|
11578 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11579 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11580 |
|
11581 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11582 { |
|
11583 |
|
11584 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
11585 s4o.print("("); |
|
11586 return_type_symbol->accept(*this); |
|
11587 s4o.print(")"); |
|
11588 IN_param_value->accept(*this); |
|
11589 return NULL; |
|
11590 |
|
11591 } |
|
11592 |
|
11593 ERROR; |
|
11594 } |
|
11595 |
|
11596 }/*function_word_to_uint*/ |
|
11597 break; |
|
11598 |
|
11599 /**** |
|
11600 *WORD_TO_UDINT |
|
11601 */ |
|
11602 case function_word_to_udint : |
|
11603 { |
|
11604 symbol_c *last_type_symbol = NULL; |
|
11605 |
|
11606 { |
|
11607 identifier_c param_name("IN"); |
|
11608 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11609 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11610 |
|
11611 /* Get the value from a foo(<param_value>) style call */ |
|
11612 if (IN_param_value == NULL) |
|
11613 IN_param_value = function_call_param_iterator.next(); |
|
11614 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11615 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11616 |
|
11617 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11618 { |
|
11619 |
|
11620 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
11621 s4o.print("("); |
|
11622 return_type_symbol->accept(*this); |
|
11623 s4o.print(")"); |
|
11624 IN_param_value->accept(*this); |
|
11625 return NULL; |
|
11626 |
|
11627 } |
|
11628 |
|
11629 ERROR; |
|
11630 } |
|
11631 |
|
11632 }/*function_word_to_udint*/ |
|
11633 break; |
|
11634 |
|
11635 /**** |
|
11636 *WORD_TO_ULINT |
|
11637 */ |
|
11638 case function_word_to_ulint : |
|
11639 { |
|
11640 symbol_c *last_type_symbol = NULL; |
|
11641 |
|
11642 { |
|
11643 identifier_c param_name("IN"); |
|
11644 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11645 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11646 |
|
11647 /* Get the value from a foo(<param_value>) style call */ |
|
11648 if (IN_param_value == NULL) |
|
11649 IN_param_value = function_call_param_iterator.next(); |
|
11650 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11651 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11652 |
|
11653 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11654 { |
|
11655 |
|
11656 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
11657 s4o.print("("); |
|
11658 return_type_symbol->accept(*this); |
|
11659 s4o.print(")"); |
|
11660 IN_param_value->accept(*this); |
|
11661 return NULL; |
|
11662 |
|
11663 } |
|
11664 |
|
11665 ERROR; |
|
11666 } |
|
11667 |
|
11668 }/*function_word_to_ulint*/ |
|
11669 break; |
|
11670 |
|
11671 /**** |
|
11672 *WORD_TO_REAL |
|
11673 */ |
|
11674 case function_word_to_real : |
|
11675 { |
|
11676 symbol_c *last_type_symbol = NULL; |
|
11677 |
|
11678 { |
|
11679 identifier_c param_name("IN"); |
|
11680 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11681 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11682 |
|
11683 /* Get the value from a foo(<param_value>) style call */ |
|
11684 if (IN_param_value == NULL) |
|
11685 IN_param_value = function_call_param_iterator.next(); |
|
11686 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11687 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11688 |
|
11689 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11690 { |
|
11691 |
|
11692 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
11693 s4o.print("("); |
|
11694 return_type_symbol->accept(*this); |
|
11695 s4o.print(")"); |
|
11696 IN_param_value->accept(*this); |
|
11697 return NULL; |
|
11698 |
|
11699 } |
|
11700 |
|
11701 ERROR; |
|
11702 } |
|
11703 |
|
11704 }/*function_word_to_real*/ |
|
11705 break; |
|
11706 |
|
11707 /**** |
|
11708 *WORD_TO_LREAL |
|
11709 */ |
|
11710 case function_word_to_lreal : |
|
11711 { |
|
11712 symbol_c *last_type_symbol = NULL; |
|
11713 |
|
11714 { |
|
11715 identifier_c param_name("IN"); |
|
11716 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11717 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11718 |
|
11719 /* Get the value from a foo(<param_value>) style call */ |
|
11720 if (IN_param_value == NULL) |
|
11721 IN_param_value = function_call_param_iterator.next(); |
|
11722 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11723 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11724 |
|
11725 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11726 { |
|
11727 |
|
11728 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
11729 s4o.print("("); |
|
11730 return_type_symbol->accept(*this); |
|
11731 s4o.print(")"); |
|
11732 IN_param_value->accept(*this); |
|
11733 return NULL; |
|
11734 |
|
11735 } |
|
11736 |
|
11737 ERROR; |
|
11738 } |
|
11739 |
|
11740 }/*function_word_to_lreal*/ |
|
11741 break; |
|
11742 |
|
11743 /**** |
|
11744 *WORD_TO_TIME |
|
11745 */ |
|
11746 case function_word_to_time : |
|
11747 { |
|
11748 symbol_c *last_type_symbol = NULL; |
|
11749 |
|
11750 { |
|
11751 identifier_c param_name("IN"); |
|
11752 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11753 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11754 |
|
11755 /* Get the value from a foo(<param_value>) style call */ |
|
11756 if (IN_param_value == NULL) |
|
11757 IN_param_value = function_call_param_iterator.next(); |
|
11758 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11759 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11760 |
|
11761 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11762 { |
|
11763 |
|
11764 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
11765 s4o.print("("); |
|
11766 return_type_symbol->accept(*this); |
|
11767 s4o.print(")__int_to_time("); |
|
11768 IN_param_value->accept(*this); |
|
11769 s4o.print(")"); |
|
11770 return NULL; |
|
11771 |
|
11772 } |
|
11773 |
|
11774 ERROR; |
|
11775 } |
|
11776 |
|
11777 }/*function_word_to_time*/ |
|
11778 break; |
|
11779 |
|
11780 /**** |
|
11781 *WORD_TO_DATE |
|
11782 */ |
|
11783 case function_word_to_date : |
|
11784 { |
|
11785 symbol_c *last_type_symbol = NULL; |
|
11786 |
|
11787 { |
|
11788 identifier_c param_name("IN"); |
|
11789 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11790 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11791 |
|
11792 /* Get the value from a foo(<param_value>) style call */ |
|
11793 if (IN_param_value == NULL) |
|
11794 IN_param_value = function_call_param_iterator.next(); |
|
11795 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11796 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11797 |
|
11798 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11799 { |
|
11800 |
|
11801 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
11802 s4o.print("("); |
|
11803 return_type_symbol->accept(*this); |
|
11804 s4o.print(")__int_to_time("); |
|
11805 IN_param_value->accept(*this); |
|
11806 s4o.print(")"); |
|
11807 return NULL; |
|
11808 |
|
11809 } |
|
11810 |
|
11811 ERROR; |
|
11812 } |
|
11813 |
|
11814 }/*function_word_to_date*/ |
|
11815 break; |
|
11816 |
|
11817 /**** |
|
11818 *WORD_TO_TOD |
|
11819 */ |
|
11820 case function_word_to_tod : |
|
11821 { |
|
11822 symbol_c *last_type_symbol = NULL; |
|
11823 |
|
11824 { |
|
11825 identifier_c param_name("IN"); |
|
11826 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11827 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11828 |
|
11829 /* Get the value from a foo(<param_value>) style call */ |
|
11830 if (IN_param_value == NULL) |
|
11831 IN_param_value = function_call_param_iterator.next(); |
|
11832 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11833 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11834 |
|
11835 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11836 { |
|
11837 |
|
11838 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
11839 s4o.print("("); |
|
11840 return_type_symbol->accept(*this); |
|
11841 s4o.print(")__int_to_time("); |
|
11842 IN_param_value->accept(*this); |
|
11843 s4o.print(")"); |
|
11844 return NULL; |
|
11845 |
|
11846 } |
|
11847 |
|
11848 ERROR; |
|
11849 } |
|
11850 |
|
11851 }/*function_word_to_tod*/ |
|
11852 break; |
|
11853 |
|
11854 /**** |
|
11855 *WORD_TO_DT |
|
11856 */ |
|
11857 case function_word_to_dt : |
|
11858 { |
|
11859 symbol_c *last_type_symbol = NULL; |
|
11860 |
|
11861 { |
|
11862 identifier_c param_name("IN"); |
|
11863 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11864 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11865 |
|
11866 /* Get the value from a foo(<param_value>) style call */ |
|
11867 if (IN_param_value == NULL) |
|
11868 IN_param_value = function_call_param_iterator.next(); |
|
11869 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11870 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11871 |
|
11872 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11873 { |
|
11874 |
|
11875 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
11876 s4o.print("("); |
|
11877 return_type_symbol->accept(*this); |
|
11878 s4o.print(")__int_to_time("); |
|
11879 IN_param_value->accept(*this); |
|
11880 s4o.print(")"); |
|
11881 return NULL; |
|
11882 |
|
11883 } |
|
11884 |
|
11885 ERROR; |
|
11886 } |
|
11887 |
|
11888 }/*function_word_to_dt*/ |
|
11889 break; |
|
11890 |
|
11891 /**** |
|
11892 *WORD_TO_STRING |
|
11893 */ |
|
11894 case function_word_to_string : |
|
11895 { |
|
11896 symbol_c *last_type_symbol = NULL; |
|
11897 |
|
11898 { |
|
11899 identifier_c param_name("IN"); |
|
11900 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11901 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11902 |
|
11903 /* Get the value from a foo(<param_value>) style call */ |
|
11904 if (IN_param_value == NULL) |
|
11905 IN_param_value = function_call_param_iterator.next(); |
|
11906 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11907 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11908 |
|
11909 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11910 { |
|
11911 |
|
11912 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
11913 s4o.print("("); |
|
11914 return_type_symbol->accept(*this); |
|
11915 s4o.print(")__bit_to_string("); |
|
11916 IN_param_value->accept(*this); |
|
11917 s4o.print(")"); |
|
11918 return NULL; |
|
11919 |
|
11920 } |
|
11921 |
|
11922 ERROR; |
|
11923 } |
|
11924 |
|
11925 }/*function_word_to_string*/ |
|
11926 break; |
|
11927 |
|
11928 /**** |
|
11929 *WORD_TO_BYTE |
|
11930 */ |
|
11931 case function_word_to_byte : |
|
11932 { |
|
11933 symbol_c *last_type_symbol = NULL; |
|
11934 |
|
11935 { |
|
11936 identifier_c param_name("IN"); |
|
11937 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11938 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11939 |
|
11940 /* Get the value from a foo(<param_value>) style call */ |
|
11941 if (IN_param_value == NULL) |
|
11942 IN_param_value = function_call_param_iterator.next(); |
|
11943 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11944 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11945 |
|
11946 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11947 { |
|
11948 |
|
11949 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
11950 s4o.print("("); |
|
11951 return_type_symbol->accept(*this); |
|
11952 s4o.print(")"); |
|
11953 IN_param_value->accept(*this); |
|
11954 return NULL; |
|
11955 |
|
11956 } |
|
11957 |
|
11958 ERROR; |
|
11959 } |
|
11960 |
|
11961 }/*function_word_to_byte*/ |
|
11962 break; |
|
11963 |
|
11964 /**** |
|
11965 *WORD_TO_DWORD |
|
11966 */ |
|
11967 case function_word_to_dword : |
|
11968 { |
|
11969 symbol_c *last_type_symbol = NULL; |
|
11970 |
|
11971 { |
|
11972 identifier_c param_name("IN"); |
|
11973 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11974 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11975 |
|
11976 /* Get the value from a foo(<param_value>) style call */ |
|
11977 if (IN_param_value == NULL) |
|
11978 IN_param_value = function_call_param_iterator.next(); |
|
11979 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11980 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11981 |
|
11982 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
11983 { |
|
11984 |
|
11985 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
11986 s4o.print("("); |
|
11987 return_type_symbol->accept(*this); |
|
11988 s4o.print(")"); |
|
11989 IN_param_value->accept(*this); |
|
11990 return NULL; |
|
11991 |
|
11992 } |
|
11993 |
|
11994 ERROR; |
|
11995 } |
|
11996 |
|
11997 }/*function_word_to_dword*/ |
|
11998 break; |
|
11999 |
|
12000 /**** |
|
12001 *WORD_TO_LWORD |
|
12002 */ |
|
12003 case function_word_to_lword : |
|
12004 { |
|
12005 symbol_c *last_type_symbol = NULL; |
|
12006 |
|
12007 { |
|
12008 identifier_c param_name("IN"); |
|
12009 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12010 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12011 |
|
12012 /* Get the value from a foo(<param_value>) style call */ |
|
12013 if (IN_param_value == NULL) |
|
12014 IN_param_value = function_call_param_iterator.next(); |
|
12015 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12016 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12017 |
|
12018 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
12019 { |
|
12020 |
|
12021 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
12022 s4o.print("("); |
|
12023 return_type_symbol->accept(*this); |
|
12024 s4o.print(")"); |
|
12025 IN_param_value->accept(*this); |
|
12026 return NULL; |
|
12027 |
|
12028 } |
|
12029 |
|
12030 ERROR; |
|
12031 } |
|
12032 |
|
12033 }/*function_word_to_lword*/ |
|
12034 break; |
|
12035 |
|
12036 /**** |
|
12037 *DWORD_TO_BOOL |
|
12038 */ |
|
12039 case function_dword_to_bool : |
|
12040 { |
|
12041 symbol_c *last_type_symbol = NULL; |
|
12042 |
|
12043 { |
|
12044 identifier_c param_name("IN"); |
|
12045 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12046 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12047 |
|
12048 /* Get the value from a foo(<param_value>) style call */ |
|
12049 if (IN_param_value == NULL) |
|
12050 IN_param_value = function_call_param_iterator.next(); |
|
12051 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12052 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12053 |
|
12054 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12055 { |
|
12056 |
|
12057 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
12058 s4o.print("("); |
|
12059 return_type_symbol->accept(*this); |
|
12060 s4o.print(")"); |
|
12061 IN_param_value->accept(*this); |
|
12062 return NULL; |
|
12063 |
|
12064 } |
|
12065 |
|
12066 ERROR; |
|
12067 } |
|
12068 |
|
12069 }/*function_dword_to_bool*/ |
|
12070 break; |
|
12071 |
|
12072 /**** |
|
12073 *DWORD_TO_SINT |
|
12074 */ |
|
12075 case function_dword_to_sint : |
|
12076 { |
|
12077 symbol_c *last_type_symbol = NULL; |
|
12078 |
|
12079 { |
|
12080 identifier_c param_name("IN"); |
|
12081 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12082 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12083 |
|
12084 /* Get the value from a foo(<param_value>) style call */ |
|
12085 if (IN_param_value == NULL) |
|
12086 IN_param_value = function_call_param_iterator.next(); |
|
12087 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12088 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12089 |
|
12090 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12091 { |
|
12092 |
|
12093 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
12094 s4o.print("("); |
|
12095 return_type_symbol->accept(*this); |
|
12096 s4o.print(")"); |
|
12097 IN_param_value->accept(*this); |
|
12098 return NULL; |
|
12099 |
|
12100 } |
|
12101 |
|
12102 ERROR; |
|
12103 } |
|
12104 |
|
12105 }/*function_dword_to_sint*/ |
|
12106 break; |
|
12107 |
|
12108 /**** |
|
12109 *DWORD_TO_INT |
|
12110 */ |
|
12111 case function_dword_to_int : |
|
12112 { |
|
12113 symbol_c *last_type_symbol = NULL; |
|
12114 |
|
12115 { |
|
12116 identifier_c param_name("IN"); |
|
12117 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12118 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12119 |
|
12120 /* Get the value from a foo(<param_value>) style call */ |
|
12121 if (IN_param_value == NULL) |
|
12122 IN_param_value = function_call_param_iterator.next(); |
|
12123 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12124 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12125 |
|
12126 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12127 { |
|
12128 |
|
12129 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
12130 s4o.print("("); |
|
12131 return_type_symbol->accept(*this); |
|
12132 s4o.print(")"); |
|
12133 IN_param_value->accept(*this); |
|
12134 return NULL; |
|
12135 |
|
12136 } |
|
12137 |
|
12138 ERROR; |
|
12139 } |
|
12140 |
|
12141 }/*function_dword_to_int*/ |
|
12142 break; |
|
12143 |
|
12144 /**** |
|
12145 *DWORD_TO_DINT |
|
12146 */ |
|
12147 case function_dword_to_dint : |
|
12148 { |
|
12149 symbol_c *last_type_symbol = NULL; |
|
12150 |
|
12151 { |
|
12152 identifier_c param_name("IN"); |
|
12153 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12154 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12155 |
|
12156 /* Get the value from a foo(<param_value>) style call */ |
|
12157 if (IN_param_value == NULL) |
|
12158 IN_param_value = function_call_param_iterator.next(); |
|
12159 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12160 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12161 |
|
12162 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12163 { |
|
12164 |
|
12165 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
12166 s4o.print("("); |
|
12167 return_type_symbol->accept(*this); |
|
12168 s4o.print(")"); |
|
12169 IN_param_value->accept(*this); |
|
12170 return NULL; |
|
12171 |
|
12172 } |
|
12173 |
|
12174 ERROR; |
|
12175 } |
|
12176 |
|
12177 }/*function_dword_to_dint*/ |
|
12178 break; |
|
12179 |
|
12180 /**** |
|
12181 *DWORD_TO_LINT |
|
12182 */ |
|
12183 case function_dword_to_lint : |
|
12184 { |
|
12185 symbol_c *last_type_symbol = NULL; |
|
12186 |
|
12187 { |
|
12188 identifier_c param_name("IN"); |
|
12189 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12190 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12191 |
|
12192 /* Get the value from a foo(<param_value>) style call */ |
|
12193 if (IN_param_value == NULL) |
|
12194 IN_param_value = function_call_param_iterator.next(); |
|
12195 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12196 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12197 |
|
12198 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12199 { |
|
12200 |
|
12201 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
12202 s4o.print("("); |
|
12203 return_type_symbol->accept(*this); |
|
12204 s4o.print(")"); |
|
12205 IN_param_value->accept(*this); |
|
12206 return NULL; |
|
12207 |
|
12208 } |
|
12209 |
|
12210 ERROR; |
|
12211 } |
|
12212 |
|
12213 }/*function_dword_to_lint*/ |
|
12214 break; |
|
12215 |
|
12216 /**** |
|
12217 *DWORD_TO_USINT |
|
12218 */ |
|
12219 case function_dword_to_usint : |
|
12220 { |
|
12221 symbol_c *last_type_symbol = NULL; |
|
12222 |
|
12223 { |
|
12224 identifier_c param_name("IN"); |
|
12225 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12226 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12227 |
|
12228 /* Get the value from a foo(<param_value>) style call */ |
|
12229 if (IN_param_value == NULL) |
|
12230 IN_param_value = function_call_param_iterator.next(); |
|
12231 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12232 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12233 |
|
12234 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12235 { |
|
12236 |
|
12237 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
12238 s4o.print("("); |
|
12239 return_type_symbol->accept(*this); |
|
12240 s4o.print(")"); |
|
12241 IN_param_value->accept(*this); |
|
12242 return NULL; |
|
12243 |
|
12244 } |
|
12245 |
|
12246 ERROR; |
|
12247 } |
|
12248 |
|
12249 }/*function_dword_to_usint*/ |
|
12250 break; |
|
12251 |
|
12252 /**** |
|
12253 *DWORD_TO_UINT |
|
12254 */ |
|
12255 case function_dword_to_uint : |
|
12256 { |
|
12257 symbol_c *last_type_symbol = NULL; |
|
12258 |
|
12259 { |
|
12260 identifier_c param_name("IN"); |
|
12261 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12262 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12263 |
|
12264 /* Get the value from a foo(<param_value>) style call */ |
|
12265 if (IN_param_value == NULL) |
|
12266 IN_param_value = function_call_param_iterator.next(); |
|
12267 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12268 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12269 |
|
12270 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12271 { |
|
12272 |
|
12273 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
12274 s4o.print("("); |
|
12275 return_type_symbol->accept(*this); |
|
12276 s4o.print(")"); |
|
12277 IN_param_value->accept(*this); |
|
12278 return NULL; |
|
12279 |
|
12280 } |
|
12281 |
|
12282 ERROR; |
|
12283 } |
|
12284 |
|
12285 }/*function_dword_to_uint*/ |
|
12286 break; |
|
12287 |
|
12288 /**** |
|
12289 *DWORD_TO_UDINT |
|
12290 */ |
|
12291 case function_dword_to_udint : |
|
12292 { |
|
12293 symbol_c *last_type_symbol = NULL; |
|
12294 |
|
12295 { |
|
12296 identifier_c param_name("IN"); |
|
12297 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12298 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12299 |
|
12300 /* Get the value from a foo(<param_value>) style call */ |
|
12301 if (IN_param_value == NULL) |
|
12302 IN_param_value = function_call_param_iterator.next(); |
|
12303 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12304 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12305 |
|
12306 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12307 { |
|
12308 |
|
12309 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
12310 s4o.print("("); |
|
12311 return_type_symbol->accept(*this); |
|
12312 s4o.print(")"); |
|
12313 IN_param_value->accept(*this); |
|
12314 return NULL; |
|
12315 |
|
12316 } |
|
12317 |
|
12318 ERROR; |
|
12319 } |
|
12320 |
|
12321 }/*function_dword_to_udint*/ |
|
12322 break; |
|
12323 |
|
12324 /**** |
|
12325 *DWORD_TO_ULINT |
|
12326 */ |
|
12327 case function_dword_to_ulint : |
|
12328 { |
|
12329 symbol_c *last_type_symbol = NULL; |
|
12330 |
|
12331 { |
|
12332 identifier_c param_name("IN"); |
|
12333 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12334 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12335 |
|
12336 /* Get the value from a foo(<param_value>) style call */ |
|
12337 if (IN_param_value == NULL) |
|
12338 IN_param_value = function_call_param_iterator.next(); |
|
12339 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12340 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12341 |
|
12342 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12343 { |
|
12344 |
|
12345 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
12346 s4o.print("("); |
|
12347 return_type_symbol->accept(*this); |
|
12348 s4o.print(")"); |
|
12349 IN_param_value->accept(*this); |
|
12350 return NULL; |
|
12351 |
|
12352 } |
|
12353 |
|
12354 ERROR; |
|
12355 } |
|
12356 |
|
12357 }/*function_dword_to_ulint*/ |
|
12358 break; |
|
12359 |
|
12360 /**** |
|
12361 *DWORD_TO_REAL |
|
12362 */ |
|
12363 case function_dword_to_real : |
|
12364 { |
|
12365 symbol_c *last_type_symbol = NULL; |
|
12366 |
|
12367 { |
|
12368 identifier_c param_name("IN"); |
|
12369 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12370 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12371 |
|
12372 /* Get the value from a foo(<param_value>) style call */ |
|
12373 if (IN_param_value == NULL) |
|
12374 IN_param_value = function_call_param_iterator.next(); |
|
12375 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12376 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12377 |
|
12378 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12379 { |
|
12380 |
|
12381 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
12382 s4o.print("("); |
|
12383 return_type_symbol->accept(*this); |
|
12384 s4o.print(")"); |
|
12385 IN_param_value->accept(*this); |
|
12386 return NULL; |
|
12387 |
|
12388 } |
|
12389 |
|
12390 ERROR; |
|
12391 } |
|
12392 |
|
12393 }/*function_dword_to_real*/ |
|
12394 break; |
|
12395 |
|
12396 /**** |
|
12397 *DWORD_TO_LREAL |
|
12398 */ |
|
12399 case function_dword_to_lreal : |
|
12400 { |
|
12401 symbol_c *last_type_symbol = NULL; |
|
12402 |
|
12403 { |
|
12404 identifier_c param_name("IN"); |
|
12405 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12406 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12407 |
|
12408 /* Get the value from a foo(<param_value>) style call */ |
|
12409 if (IN_param_value == NULL) |
|
12410 IN_param_value = function_call_param_iterator.next(); |
|
12411 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12412 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12413 |
|
12414 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12415 { |
|
12416 |
|
12417 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
12418 s4o.print("("); |
|
12419 return_type_symbol->accept(*this); |
|
12420 s4o.print(")"); |
|
12421 IN_param_value->accept(*this); |
|
12422 return NULL; |
|
12423 |
|
12424 } |
|
12425 |
|
12426 ERROR; |
|
12427 } |
|
12428 |
|
12429 }/*function_dword_to_lreal*/ |
|
12430 break; |
|
12431 |
|
12432 /**** |
|
12433 *DWORD_TO_TIME |
|
12434 */ |
|
12435 case function_dword_to_time : |
|
12436 { |
|
12437 symbol_c *last_type_symbol = NULL; |
|
12438 |
|
12439 { |
|
12440 identifier_c param_name("IN"); |
|
12441 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12442 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12443 |
|
12444 /* Get the value from a foo(<param_value>) style call */ |
|
12445 if (IN_param_value == NULL) |
|
12446 IN_param_value = function_call_param_iterator.next(); |
|
12447 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12448 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12449 |
|
12450 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12451 { |
|
12452 |
|
12453 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
12454 s4o.print("("); |
|
12455 return_type_symbol->accept(*this); |
|
12456 s4o.print(")__int_to_time("); |
|
12457 IN_param_value->accept(*this); |
|
12458 s4o.print(")"); |
|
12459 return NULL; |
|
12460 |
|
12461 } |
|
12462 |
|
12463 ERROR; |
|
12464 } |
|
12465 |
|
12466 }/*function_dword_to_time*/ |
|
12467 break; |
|
12468 |
|
12469 /**** |
|
12470 *DWORD_TO_DATE |
|
12471 */ |
|
12472 case function_dword_to_date : |
|
12473 { |
|
12474 symbol_c *last_type_symbol = NULL; |
|
12475 |
|
12476 { |
|
12477 identifier_c param_name("IN"); |
|
12478 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12479 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12480 |
|
12481 /* Get the value from a foo(<param_value>) style call */ |
|
12482 if (IN_param_value == NULL) |
|
12483 IN_param_value = function_call_param_iterator.next(); |
|
12484 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12485 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12486 |
|
12487 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12488 { |
|
12489 |
|
12490 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
12491 s4o.print("("); |
|
12492 return_type_symbol->accept(*this); |
|
12493 s4o.print(")__int_to_time("); |
|
12494 IN_param_value->accept(*this); |
|
12495 s4o.print(")"); |
|
12496 return NULL; |
|
12497 |
|
12498 } |
|
12499 |
|
12500 ERROR; |
|
12501 } |
|
12502 |
|
12503 }/*function_dword_to_date*/ |
|
12504 break; |
|
12505 |
|
12506 /**** |
|
12507 *DWORD_TO_TOD |
|
12508 */ |
|
12509 case function_dword_to_tod : |
|
12510 { |
|
12511 symbol_c *last_type_symbol = NULL; |
|
12512 |
|
12513 { |
|
12514 identifier_c param_name("IN"); |
|
12515 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12516 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12517 |
|
12518 /* Get the value from a foo(<param_value>) style call */ |
|
12519 if (IN_param_value == NULL) |
|
12520 IN_param_value = function_call_param_iterator.next(); |
|
12521 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12522 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12523 |
|
12524 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12525 { |
|
12526 |
|
12527 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
12528 s4o.print("("); |
|
12529 return_type_symbol->accept(*this); |
|
12530 s4o.print(")__int_to_time("); |
|
12531 IN_param_value->accept(*this); |
|
12532 s4o.print(")"); |
|
12533 return NULL; |
|
12534 |
|
12535 } |
|
12536 |
|
12537 ERROR; |
|
12538 } |
|
12539 |
|
12540 }/*function_dword_to_tod*/ |
|
12541 break; |
|
12542 |
|
12543 /**** |
|
12544 *DWORD_TO_DT |
|
12545 */ |
|
12546 case function_dword_to_dt : |
|
12547 { |
|
12548 symbol_c *last_type_symbol = NULL; |
|
12549 |
|
12550 { |
|
12551 identifier_c param_name("IN"); |
|
12552 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12553 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12554 |
|
12555 /* Get the value from a foo(<param_value>) style call */ |
|
12556 if (IN_param_value == NULL) |
|
12557 IN_param_value = function_call_param_iterator.next(); |
|
12558 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12559 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12560 |
|
12561 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12562 { |
|
12563 |
|
12564 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
12565 s4o.print("("); |
|
12566 return_type_symbol->accept(*this); |
|
12567 s4o.print(")__int_to_time("); |
|
12568 IN_param_value->accept(*this); |
|
12569 s4o.print(")"); |
|
12570 return NULL; |
|
12571 |
|
12572 } |
|
12573 |
|
12574 ERROR; |
|
12575 } |
|
12576 |
|
12577 }/*function_dword_to_dt*/ |
|
12578 break; |
|
12579 |
|
12580 /**** |
|
12581 *DWORD_TO_STRING |
|
12582 */ |
|
12583 case function_dword_to_string : |
|
12584 { |
|
12585 symbol_c *last_type_symbol = NULL; |
|
12586 |
|
12587 { |
|
12588 identifier_c param_name("IN"); |
|
12589 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12590 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12591 |
|
12592 /* Get the value from a foo(<param_value>) style call */ |
|
12593 if (IN_param_value == NULL) |
|
12594 IN_param_value = function_call_param_iterator.next(); |
|
12595 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12596 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12597 |
|
12598 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12599 { |
|
12600 |
|
12601 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
12602 s4o.print("("); |
|
12603 return_type_symbol->accept(*this); |
|
12604 s4o.print(")__bit_to_string("); |
|
12605 IN_param_value->accept(*this); |
|
12606 s4o.print(")"); |
|
12607 return NULL; |
|
12608 |
|
12609 } |
|
12610 |
|
12611 ERROR; |
|
12612 } |
|
12613 |
|
12614 }/*function_dword_to_string*/ |
|
12615 break; |
|
12616 |
|
12617 /**** |
|
12618 *DWORD_TO_BYTE |
|
12619 */ |
|
12620 case function_dword_to_byte : |
|
12621 { |
|
12622 symbol_c *last_type_symbol = NULL; |
|
12623 |
|
12624 { |
|
12625 identifier_c param_name("IN"); |
|
12626 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12627 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12628 |
|
12629 /* Get the value from a foo(<param_value>) style call */ |
|
12630 if (IN_param_value == NULL) |
|
12631 IN_param_value = function_call_param_iterator.next(); |
|
12632 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12633 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12634 |
|
12635 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12636 { |
|
12637 |
|
12638 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
12639 s4o.print("("); |
|
12640 return_type_symbol->accept(*this); |
|
12641 s4o.print(")"); |
|
12642 IN_param_value->accept(*this); |
|
12643 return NULL; |
|
12644 |
|
12645 } |
|
12646 |
|
12647 ERROR; |
|
12648 } |
|
12649 |
|
12650 }/*function_dword_to_byte*/ |
|
12651 break; |
|
12652 |
|
12653 /**** |
|
12654 *DWORD_TO_WORD |
|
12655 */ |
|
12656 case function_dword_to_word : |
|
12657 { |
|
12658 symbol_c *last_type_symbol = NULL; |
|
12659 |
|
12660 { |
|
12661 identifier_c param_name("IN"); |
|
12662 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12663 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12664 |
|
12665 /* Get the value from a foo(<param_value>) style call */ |
|
12666 if (IN_param_value == NULL) |
|
12667 IN_param_value = function_call_param_iterator.next(); |
|
12668 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12669 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12670 |
|
12671 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12672 { |
|
12673 |
|
12674 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
12675 s4o.print("("); |
|
12676 return_type_symbol->accept(*this); |
|
12677 s4o.print(")"); |
|
12678 IN_param_value->accept(*this); |
|
12679 return NULL; |
|
12680 |
|
12681 } |
|
12682 |
|
12683 ERROR; |
|
12684 } |
|
12685 |
|
12686 }/*function_dword_to_word*/ |
|
12687 break; |
|
12688 |
|
12689 /**** |
|
12690 *DWORD_TO_LWORD |
|
12691 */ |
|
12692 case function_dword_to_lword : |
|
12693 { |
|
12694 symbol_c *last_type_symbol = NULL; |
|
12695 |
|
12696 { |
|
12697 identifier_c param_name("IN"); |
|
12698 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12699 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12700 |
|
12701 /* Get the value from a foo(<param_value>) style call */ |
|
12702 if (IN_param_value == NULL) |
|
12703 IN_param_value = function_call_param_iterator.next(); |
|
12704 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12705 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12706 |
|
12707 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
12708 { |
|
12709 |
|
12710 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
12711 s4o.print("("); |
|
12712 return_type_symbol->accept(*this); |
|
12713 s4o.print(")"); |
|
12714 IN_param_value->accept(*this); |
|
12715 return NULL; |
|
12716 |
|
12717 } |
|
12718 |
|
12719 ERROR; |
|
12720 } |
|
12721 |
|
12722 }/*function_dword_to_lword*/ |
|
12723 break; |
|
12724 |
|
12725 /**** |
|
12726 *LWORD_TO_BOOL |
|
12727 */ |
|
12728 case function_lword_to_bool : |
|
12729 { |
|
12730 symbol_c *last_type_symbol = NULL; |
|
12731 |
|
12732 { |
|
12733 identifier_c param_name("IN"); |
|
12734 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12735 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12736 |
|
12737 /* Get the value from a foo(<param_value>) style call */ |
|
12738 if (IN_param_value == NULL) |
|
12739 IN_param_value = function_call_param_iterator.next(); |
|
12740 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12741 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12742 |
|
12743 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
12744 { |
|
12745 |
|
12746 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
12747 s4o.print("("); |
|
12748 return_type_symbol->accept(*this); |
|
12749 s4o.print(")"); |
|
12750 IN_param_value->accept(*this); |
|
12751 return NULL; |
|
12752 |
|
12753 } |
|
12754 |
|
12755 ERROR; |
|
12756 } |
|
12757 |
|
12758 }/*function_lword_to_bool*/ |
|
12759 break; |
|
12760 |
|
12761 /**** |
|
12762 *LWORD_TO_SINT |
|
12763 */ |
|
12764 case function_lword_to_sint : |
|
12765 { |
|
12766 symbol_c *last_type_symbol = NULL; |
|
12767 |
|
12768 { |
|
12769 identifier_c param_name("IN"); |
|
12770 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12771 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12772 |
|
12773 /* Get the value from a foo(<param_value>) style call */ |
|
12774 if (IN_param_value == NULL) |
|
12775 IN_param_value = function_call_param_iterator.next(); |
|
12776 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12777 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12778 |
|
12779 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
12780 { |
|
12781 |
|
12782 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
12783 s4o.print("("); |
|
12784 return_type_symbol->accept(*this); |
|
12785 s4o.print(")"); |
|
12786 IN_param_value->accept(*this); |
|
12787 return NULL; |
|
12788 |
|
12789 } |
|
12790 |
|
12791 ERROR; |
|
12792 } |
|
12793 |
|
12794 }/*function_lword_to_sint*/ |
|
12795 break; |
|
12796 |
|
12797 /**** |
|
12798 *LWORD_TO_INT |
|
12799 */ |
|
12800 case function_lword_to_int : |
|
12801 { |
|
12802 symbol_c *last_type_symbol = NULL; |
|
12803 |
|
12804 { |
|
12805 identifier_c param_name("IN"); |
|
12806 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12807 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12808 |
|
12809 /* Get the value from a foo(<param_value>) style call */ |
|
12810 if (IN_param_value == NULL) |
|
12811 IN_param_value = function_call_param_iterator.next(); |
|
12812 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12813 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12814 |
|
12815 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
12816 { |
|
12817 |
|
12818 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
12819 s4o.print("("); |
|
12820 return_type_symbol->accept(*this); |
|
12821 s4o.print(")"); |
|
12822 IN_param_value->accept(*this); |
|
12823 return NULL; |
|
12824 |
|
12825 } |
|
12826 |
|
12827 ERROR; |
|
12828 } |
|
12829 |
|
12830 }/*function_lword_to_int*/ |
|
12831 break; |
|
12832 |
|
12833 /**** |
|
12834 *LWORD_TO_DINT |
|
12835 */ |
|
12836 case function_lword_to_dint : |
|
12837 { |
|
12838 symbol_c *last_type_symbol = NULL; |
|
12839 |
|
12840 { |
|
12841 identifier_c param_name("IN"); |
|
12842 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12843 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12844 |
|
12845 /* Get the value from a foo(<param_value>) style call */ |
|
12846 if (IN_param_value == NULL) |
|
12847 IN_param_value = function_call_param_iterator.next(); |
|
12848 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12849 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12850 |
|
12851 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
12852 { |
|
12853 |
|
12854 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
12855 s4o.print("("); |
|
12856 return_type_symbol->accept(*this); |
|
12857 s4o.print(")"); |
|
12858 IN_param_value->accept(*this); |
|
12859 return NULL; |
|
12860 |
|
12861 } |
|
12862 |
|
12863 ERROR; |
|
12864 } |
|
12865 |
|
12866 }/*function_lword_to_dint*/ |
|
12867 break; |
|
12868 |
|
12869 /**** |
|
12870 *LWORD_TO_LINT |
|
12871 */ |
|
12872 case function_lword_to_lint : |
|
12873 { |
|
12874 symbol_c *last_type_symbol = NULL; |
|
12875 |
|
12876 { |
|
12877 identifier_c param_name("IN"); |
|
12878 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12879 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12880 |
|
12881 /* Get the value from a foo(<param_value>) style call */ |
|
12882 if (IN_param_value == NULL) |
|
12883 IN_param_value = function_call_param_iterator.next(); |
|
12884 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12885 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12886 |
|
12887 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
12888 { |
|
12889 |
|
12890 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
12891 s4o.print("("); |
|
12892 return_type_symbol->accept(*this); |
|
12893 s4o.print(")"); |
|
12894 IN_param_value->accept(*this); |
|
12895 return NULL; |
|
12896 |
|
12897 } |
|
12898 |
|
12899 ERROR; |
|
12900 } |
|
12901 |
|
12902 }/*function_lword_to_lint*/ |
|
12903 break; |
|
12904 |
|
12905 /**** |
|
12906 *LWORD_TO_USINT |
|
12907 */ |
|
12908 case function_lword_to_usint : |
|
12909 { |
|
12910 symbol_c *last_type_symbol = NULL; |
|
12911 |
|
12912 { |
|
12913 identifier_c param_name("IN"); |
|
12914 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12915 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12916 |
|
12917 /* Get the value from a foo(<param_value>) style call */ |
|
12918 if (IN_param_value == NULL) |
|
12919 IN_param_value = function_call_param_iterator.next(); |
|
12920 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12921 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12922 |
|
12923 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
12924 { |
|
12925 |
|
12926 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
12927 s4o.print("("); |
|
12928 return_type_symbol->accept(*this); |
|
12929 s4o.print(")"); |
|
12930 IN_param_value->accept(*this); |
|
12931 return NULL; |
|
12932 |
|
12933 } |
|
12934 |
|
12935 ERROR; |
|
12936 } |
|
12937 |
|
12938 }/*function_lword_to_usint*/ |
|
12939 break; |
|
12940 |
|
12941 /**** |
|
12942 *LWORD_TO_UINT |
|
12943 */ |
|
12944 case function_lword_to_uint : |
|
12945 { |
|
12946 symbol_c *last_type_symbol = NULL; |
|
12947 |
|
12948 { |
|
12949 identifier_c param_name("IN"); |
|
12950 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12951 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12952 |
|
12953 /* Get the value from a foo(<param_value>) style call */ |
|
12954 if (IN_param_value == NULL) |
|
12955 IN_param_value = function_call_param_iterator.next(); |
|
12956 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12957 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12958 |
|
12959 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
12960 { |
|
12961 |
|
12962 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
12963 s4o.print("("); |
|
12964 return_type_symbol->accept(*this); |
|
12965 s4o.print(")"); |
|
12966 IN_param_value->accept(*this); |
|
12967 return NULL; |
|
12968 |
|
12969 } |
|
12970 |
|
12971 ERROR; |
|
12972 } |
|
12973 |
|
12974 }/*function_lword_to_uint*/ |
|
12975 break; |
|
12976 |
|
12977 /**** |
|
12978 *LWORD_TO_UDINT |
|
12979 */ |
|
12980 case function_lword_to_udint : |
|
12981 { |
|
12982 symbol_c *last_type_symbol = NULL; |
|
12983 |
|
12984 { |
|
12985 identifier_c param_name("IN"); |
|
12986 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12987 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12988 |
|
12989 /* Get the value from a foo(<param_value>) style call */ |
|
12990 if (IN_param_value == NULL) |
|
12991 IN_param_value = function_call_param_iterator.next(); |
|
12992 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12993 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12994 |
|
12995 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
12996 { |
|
12997 |
|
12998 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
12999 s4o.print("("); |
|
13000 return_type_symbol->accept(*this); |
|
13001 s4o.print(")"); |
|
13002 IN_param_value->accept(*this); |
|
13003 return NULL; |
|
13004 |
|
13005 } |
|
13006 |
|
13007 ERROR; |
|
13008 } |
|
13009 |
|
13010 }/*function_lword_to_udint*/ |
|
13011 break; |
|
13012 |
|
13013 /**** |
|
13014 *LWORD_TO_ULINT |
|
13015 */ |
|
13016 case function_lword_to_ulint : |
|
13017 { |
|
13018 symbol_c *last_type_symbol = NULL; |
|
13019 |
|
13020 { |
|
13021 identifier_c param_name("IN"); |
|
13022 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13023 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13024 |
|
13025 /* Get the value from a foo(<param_value>) style call */ |
|
13026 if (IN_param_value == NULL) |
|
13027 IN_param_value = function_call_param_iterator.next(); |
|
13028 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13029 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13030 |
|
13031 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
13032 { |
|
13033 |
|
13034 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
13035 s4o.print("("); |
|
13036 return_type_symbol->accept(*this); |
|
13037 s4o.print(")"); |
|
13038 IN_param_value->accept(*this); |
|
13039 return NULL; |
|
13040 |
|
13041 } |
|
13042 |
|
13043 ERROR; |
|
13044 } |
|
13045 |
|
13046 }/*function_lword_to_ulint*/ |
|
13047 break; |
|
13048 |
|
13049 /**** |
|
13050 *LWORD_TO_REAL |
|
13051 */ |
|
13052 case function_lword_to_real : |
|
13053 { |
|
13054 symbol_c *last_type_symbol = NULL; |
|
13055 |
|
13056 { |
|
13057 identifier_c param_name("IN"); |
|
13058 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13059 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13060 |
|
13061 /* Get the value from a foo(<param_value>) style call */ |
|
13062 if (IN_param_value == NULL) |
|
13063 IN_param_value = function_call_param_iterator.next(); |
|
13064 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13065 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13066 |
|
13067 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
13068 { |
|
13069 |
|
13070 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
13071 s4o.print("("); |
|
13072 return_type_symbol->accept(*this); |
|
13073 s4o.print(")"); |
|
13074 IN_param_value->accept(*this); |
|
13075 return NULL; |
|
13076 |
|
13077 } |
|
13078 |
|
13079 ERROR; |
|
13080 } |
|
13081 |
|
13082 }/*function_lword_to_real*/ |
|
13083 break; |
|
13084 |
|
13085 /**** |
|
13086 *LWORD_TO_LREAL |
|
13087 */ |
|
13088 case function_lword_to_lreal : |
|
13089 { |
|
13090 symbol_c *last_type_symbol = NULL; |
|
13091 |
|
13092 { |
|
13093 identifier_c param_name("IN"); |
|
13094 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13095 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13096 |
|
13097 /* Get the value from a foo(<param_value>) style call */ |
|
13098 if (IN_param_value == NULL) |
|
13099 IN_param_value = function_call_param_iterator.next(); |
|
13100 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13101 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13102 |
|
13103 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
13104 { |
|
13105 |
|
13106 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
13107 s4o.print("("); |
|
13108 return_type_symbol->accept(*this); |
|
13109 s4o.print(")"); |
|
13110 IN_param_value->accept(*this); |
|
13111 return NULL; |
|
13112 |
|
13113 } |
|
13114 |
|
13115 ERROR; |
|
13116 } |
|
13117 |
|
13118 }/*function_lword_to_lreal*/ |
|
13119 break; |
|
13120 |
|
13121 /**** |
|
13122 *LWORD_TO_TIME |
|
13123 */ |
|
13124 case function_lword_to_time : |
|
13125 { |
|
13126 symbol_c *last_type_symbol = NULL; |
|
13127 |
|
13128 { |
|
13129 identifier_c param_name("IN"); |
|
13130 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13131 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13132 |
|
13133 /* Get the value from a foo(<param_value>) style call */ |
|
13134 if (IN_param_value == NULL) |
|
13135 IN_param_value = function_call_param_iterator.next(); |
|
13136 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13137 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13138 |
|
13139 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
13140 { |
|
13141 |
|
13142 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
13143 s4o.print("("); |
|
13144 return_type_symbol->accept(*this); |
|
13145 s4o.print(")__int_to_time("); |
|
13146 IN_param_value->accept(*this); |
|
13147 s4o.print(")"); |
|
13148 return NULL; |
|
13149 |
|
13150 } |
|
13151 |
|
13152 ERROR; |
|
13153 } |
|
13154 |
|
13155 }/*function_lword_to_time*/ |
|
13156 break; |
|
13157 |
|
13158 /**** |
|
13159 *LWORD_TO_DATE |
|
13160 */ |
|
13161 case function_lword_to_date : |
|
13162 { |
|
13163 symbol_c *last_type_symbol = NULL; |
|
13164 |
|
13165 { |
|
13166 identifier_c param_name("IN"); |
|
13167 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13168 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13169 |
|
13170 /* Get the value from a foo(<param_value>) style call */ |
|
13171 if (IN_param_value == NULL) |
|
13172 IN_param_value = function_call_param_iterator.next(); |
|
13173 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13174 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13175 |
|
13176 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
13177 { |
|
13178 |
|
13179 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
13180 s4o.print("("); |
|
13181 return_type_symbol->accept(*this); |
|
13182 s4o.print(")__int_to_time("); |
|
13183 IN_param_value->accept(*this); |
|
13184 s4o.print(")"); |
|
13185 return NULL; |
|
13186 |
|
13187 } |
|
13188 |
|
13189 ERROR; |
|
13190 } |
|
13191 |
|
13192 }/*function_lword_to_date*/ |
|
13193 break; |
|
13194 |
|
13195 /**** |
|
13196 *LWORD_TO_TOD |
|
13197 */ |
|
13198 case function_lword_to_tod : |
|
13199 { |
|
13200 symbol_c *last_type_symbol = NULL; |
|
13201 |
|
13202 { |
|
13203 identifier_c param_name("IN"); |
|
13204 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13205 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13206 |
|
13207 /* Get the value from a foo(<param_value>) style call */ |
|
13208 if (IN_param_value == NULL) |
|
13209 IN_param_value = function_call_param_iterator.next(); |
|
13210 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13211 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13212 |
|
13213 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
13214 { |
|
13215 |
|
13216 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
13217 s4o.print("("); |
|
13218 return_type_symbol->accept(*this); |
|
13219 s4o.print(")__int_to_time("); |
|
13220 IN_param_value->accept(*this); |
|
13221 s4o.print(")"); |
|
13222 return NULL; |
|
13223 |
|
13224 } |
|
13225 |
|
13226 ERROR; |
|
13227 } |
|
13228 |
|
13229 }/*function_lword_to_tod*/ |
|
13230 break; |
|
13231 |
|
13232 /**** |
|
13233 *LWORD_TO_DT |
|
13234 */ |
|
13235 case function_lword_to_dt : |
|
13236 { |
|
13237 symbol_c *last_type_symbol = NULL; |
|
13238 |
|
13239 { |
|
13240 identifier_c param_name("IN"); |
|
13241 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13242 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13243 |
|
13244 /* Get the value from a foo(<param_value>) style call */ |
|
13245 if (IN_param_value == NULL) |
|
13246 IN_param_value = function_call_param_iterator.next(); |
|
13247 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13248 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13249 |
|
13250 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
13251 { |
|
13252 |
|
13253 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
13254 s4o.print("("); |
|
13255 return_type_symbol->accept(*this); |
|
13256 s4o.print(")__int_to_time("); |
|
13257 IN_param_value->accept(*this); |
|
13258 s4o.print(")"); |
|
13259 return NULL; |
|
13260 |
|
13261 } |
|
13262 |
|
13263 ERROR; |
|
13264 } |
|
13265 |
|
13266 }/*function_lword_to_dt*/ |
|
13267 break; |
|
13268 |
|
13269 /**** |
|
13270 *LWORD_TO_STRING |
|
13271 */ |
|
13272 case function_lword_to_string : |
|
13273 { |
|
13274 symbol_c *last_type_symbol = NULL; |
|
13275 |
|
13276 { |
|
13277 identifier_c param_name("IN"); |
|
13278 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13279 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13280 |
|
13281 /* Get the value from a foo(<param_value>) style call */ |
|
13282 if (IN_param_value == NULL) |
|
13283 IN_param_value = function_call_param_iterator.next(); |
|
13284 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13285 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13286 |
|
13287 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
13288 { |
|
13289 |
|
13290 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
13291 s4o.print("("); |
|
13292 return_type_symbol->accept(*this); |
|
13293 s4o.print(")__bit_to_string("); |
|
13294 IN_param_value->accept(*this); |
|
13295 s4o.print(")"); |
|
13296 return NULL; |
|
13297 |
|
13298 } |
|
13299 |
|
13300 ERROR; |
|
13301 } |
|
13302 |
|
13303 }/*function_lword_to_string*/ |
|
13304 break; |
|
13305 |
|
13306 /**** |
|
13307 *LWORD_TO_BYTE |
|
13308 */ |
|
13309 case function_lword_to_byte : |
|
13310 { |
|
13311 symbol_c *last_type_symbol = NULL; |
|
13312 |
|
13313 { |
|
13314 identifier_c param_name("IN"); |
|
13315 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13316 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13317 |
|
13318 /* Get the value from a foo(<param_value>) style call */ |
|
13319 if (IN_param_value == NULL) |
|
13320 IN_param_value = function_call_param_iterator.next(); |
|
13321 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13322 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13323 |
|
13324 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
13325 { |
|
13326 |
|
13327 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
13328 s4o.print("("); |
|
13329 return_type_symbol->accept(*this); |
|
13330 s4o.print(")"); |
|
13331 IN_param_value->accept(*this); |
|
13332 return NULL; |
|
13333 |
|
13334 } |
|
13335 |
|
13336 ERROR; |
|
13337 } |
|
13338 |
|
13339 }/*function_lword_to_byte*/ |
|
13340 break; |
|
13341 |
|
13342 /**** |
|
13343 *LWORD_TO_WORD |
|
13344 */ |
|
13345 case function_lword_to_word : |
|
13346 { |
|
13347 symbol_c *last_type_symbol = NULL; |
|
13348 |
|
13349 { |
|
13350 identifier_c param_name("IN"); |
|
13351 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13352 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13353 |
|
13354 /* Get the value from a foo(<param_value>) style call */ |
|
13355 if (IN_param_value == NULL) |
|
13356 IN_param_value = function_call_param_iterator.next(); |
|
13357 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13358 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13359 |
|
13360 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
13361 { |
|
13362 |
|
13363 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
13364 s4o.print("("); |
|
13365 return_type_symbol->accept(*this); |
|
13366 s4o.print(")"); |
13218 s4o.print(")"); |
13367 IN_param_value->accept(*this); |
13219 IN_param_value->accept(*this); |
13368 return NULL; |
13220 return NULL; |
13369 |
13221 |
13370 } |
13222 } |